• A
    checkEyecatchers() used to crash if a heap problem was detected · 6602a789
    Axel Sommerfeldt 提交于
    checkEyecatchers() used vsnprintf() with a format specifier "%d" to print the wrong eyecatcher content, but an eyecatcher was defined as 'double'.
    Since "%d" expects an 'int' on the stack (which is usually 32 bit in size) but gets a 'double' instead (which is usually 64 bit), the following 'file' argument will be retrieved as wrong pointer value from stack, resulting in a crash in Log() -> vsnprintf() -> strlen().
    
    This was fixed by defining 'eyecatcher' as 'uint64_t' (instead of 'double') and printing an eyecatcher using 'PRIx64' (instead of "d").
    Signed-off-by: NAxel Sommerfeldt <axel.sommerfeldt@fastmail.de>
    6602a789
Heap.c 14.7 KB