This reflects the truth that the heap has been corrupted. So, running valgrind tells us the following:
==10534== Invalid write of size 8
==10534== at 0x11D6B8E: _platform_memmove$VARIANT$Unknown (in /usr/lib/system/libsystem_platform.dylib)
==10534== by 0x1056D74: __memcpy_chk (in /usr/lib/system/libsystem_c.dylib)
==10534== by 0xC8EA73: strbuf_append (in /Users/pancake/prg/radare2/libr/db/libr_db.dylib)
==10534== by 0xC8EE11: foreach_list_cb (in /Users/pancake/prg/radare2/libr/db/libr_db.dylib)
==10534== by 0xC90B2E: sdb_foreach (in /Users/pancake/prg/radare2/libr/db/libr_db.dylib)
==10534== by 0xC8EB78: walk_namespace (in /Users/pancake/prg/radare2/libr/db/libr_db.dylib)
==10534== by 0xC8ECB5: walk_namespace (in /Users/pancake/prg/radare2/libr/db/libr_db.dylib)
==10534== by 0xC8D087: sdb_querys (in /Users/pancake/prg/radare2/libr/db/libr_db.dylib)
==10534== by 0x25D32: cmd_kuery (in /Users/pancake/prg/radare2/libr/core/libr_core.dylib)
==10534== by 0x67A1F: r_cmd_call (in /Users/pancake/prg/radare2/libr/core/libr_core.dylib)
==10534== by 0x4836B: r_core_cmd_subst_i (in /Users/pancake/prg/radare2/libr/core/libr_core.dylib)
==10534== by 0x174CF: r_core_cmd_subst (in /Users/pancake/prg/radare2/libr/core/libr_core.dylib)
There's an overflow in strbuf_append, which is quite obvious by reading the code of the function. So I have fixed it :)
You can reproduce it this way:
Gdb says:
By reading the assembly this is this portion of the code:
This is query.c:88
This reflects the truth that the heap has been corrupted. So, running valgrind tells us the following:
There's an overflow in strbuf_append, which is quite obvious by reading the code of the function. So I have fixed it :)