diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-11-17 20:48:31 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-11-17 20:48:31 +0000 |
commit | 5409dacfb9b62964f95af8c693fa708baf60ecdd (patch) | |
tree | e5f72557eb76cddea6c0a542803f720ebc9f1405 | |
parent | a231ddc0b3e0c5ccb3fa1d24b18d4f0d35977e4e (diff) | |
download | gdb-5409dacfb9b62964f95af8c693fa708baf60ecdd.zip gdb-5409dacfb9b62964f95af8c693fa708baf60ecdd.tar.gz gdb-5409dacfb9b62964f95af8c693fa708baf60ecdd.tar.bz2 |
* dbxread.c (set_namestring): Remove cast to unsigned. Check N_STRX
overflow.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/dbxread.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index abfe2dd..f966e9d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2009-11-17 Jan Kratochvil <jan.kratochvil@redhat.com> + + * dbxread.c (set_namestring): Remove cast to unsigned. Check N_STRX + overflow. + 2009-11-17 Nathan Sidwell <nathan@codesourcery.com> * features/m68k-core.xml: New file. diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 54d8b51..6d4c893 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -965,8 +965,9 @@ set_namestring (struct objfile *objfile, const struct internal_nlist *nlist) { char *namestring; - if (((unsigned) nlist->n_strx + file_string_table_offset) - >= DBX_STRINGTAB_SIZE (objfile)) + if (nlist->n_strx + file_string_table_offset + >= DBX_STRINGTAB_SIZE (objfile) + || nlist->n_strx + file_string_table_offset < nlist->n_strx) { complaint (&symfile_complaints, _("bad string table offset in symbol %d"), symnum); |