This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: fix possible crash in find_charset_names
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 07 Feb 2012 08:41:25 -0700
- Subject: FYI: fix possible crash in find_charset_names
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];