GNOME Bugzilla – Bug 328390
gconf_unescape_key causes a segmentation fault
Last modified: 2006-01-24 08:50:16 UTC
Steps to reproduce: 1. Include the line "printf( "%s\n", gconf_unescape_key( "MKIS@32@Library/timestamp", -1 ) );" in a program. 2. Run the program. 3. Watch it segfault Stack trace: (gdb) run Starting program: /usr/bin/nm-applet [Thread debugging using libthread_db enabled] [New Thread -1224325440 (LWP 19442)] Program received signal SIGSEGV, Segmentation fault.
+ Trace 65547
Thread NaN (LWP 19442)
Other information: The problem is caused by the function gconf_unescape_key in gconf/gconf.c calling strtoul with the second parameter as &end, rather than &p. This moves p past end, quickly ending in a segfault. Patch to fix this (it's a one-liner) will be attached.
Created attachment 57993 [details] [review] Patch to fix gconf_unescape_key()
This crash has already been fixed in CVS: 2005-12-08 Dan Williams <dcbw@redhat.com> * gconf/gconf.c: (gconf_unescape_string): Don't stomp on the function-level scoped 'end' from deep in the function. Fixes a segfault.