FYI: fix possible crash in find_charset_names
Tom Tromey
tromey@redhat.com
Tue Feb 7 15:41:00 GMT 2012
We got a report in Red Hat bugzilla about a crash in find_charset_names:
https://bugzilla.redhat.com/show_bug.cgi?id=786091
I don't have a test case but the fix is obvious enough to go in without
one.
Tom
2012-02-07 Tom Tromey <tromey@redhat.com>
* charset.c (find_charset_names): Check 'in' against NULL.
diff --git a/gdb/charset.c b/gdb/charset.c
index 62977d1..16dab6b 100644
--- a/gdb/charset.c
+++ b/gdb/charset.c
@@ -839,7 +839,7 @@ find_charset_names (void)
parse the glibc and libiconv formats; feel free to add others
as needed. */
- while (!feof (in))
+ while (in != NULL && !feof (in))
{
/* The size of buf is chosen arbitrarily. */
char buf[1024];
More information about the Gdb-patches
mailing list