21.02.2014, 18:17
If I run the code I get the message the format itself crashed therefore it is unrelated to va_format
format simple crashes if the output address is out of range like
Test code
format simple crashes if the output address is out of range like
pawn Код:
NotFine(out[], size, const fmt[], va_args<>) {
format(killer, sizeof killer, fmt, ...);
new
killer[128]
;
}
pawn Код:
main() {
static
addr,
array[] = "Hello World"
;
format(array, sizeof array, array);
const
size = sizeof array,
byte = size * -4
;
// Calculating address of tmp
#emit lctrl 4 // stack
#emit add.c byte
#emit stor.pri addr
// new tmp[sizeof array]; // works
#emit push.c array
#emit push.c size
#emit push addr
#emit push.c 12
#emit sysreq.c format
#emit stack 16
new tmp[sizeof array]; // doesn't
print(tmp);
}