After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 165980 - g_key_file_remove_key appears broken
g_key_file_remove_key appears broken
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.6.x
Other All
: High critical
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2005-02-01 22:05 UTC by David Hoover
Modified: 2011-02-18 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sample program (381 bytes, text/plain)
2005-02-01 22:07 UTC, David Hoover
Details

Description David Hoover 2005-02-01 22:05:44 UTC
Steps to reproduce:
It appears that if I use g_key_file_remove_key and take a key off, I wind up
with an invalid GKeyFile, which will segfault with things such as
g_key_file_to_data.

I'm attaching a little test program that demonstrates it.

Stack trace:


Other information:
Comment 1 David Hoover 2005-02-01 22:07:05 UTC
Created attachment 36845 [details]
sample program

segfaults when calling g_key_file_to_data() after g_key_file_remove_key()
Comment 2 Matthias Clasen 2005-02-02 03:25:10 UTC
2005-02-01  Matthias Clasen  <mclasen@redhat.com>

	* tests/keyfile-test.c (test_key_remove): Add test case for
	key removal.

	* glib/gkeyfile.c (g_key_file_remove_key): Actually remove 
	the key from the list of pairs.  (#165980, David Hoover)