This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/22594] New: Possible access to unintended variable in "gdb/stabsread.c" line 1364


https://sourceware.org/bugzilla/show_bug.cgi?id=22594

            Bug ID: 22594
           Summary: Possible access to unintended variable in
                    "gdb/stabsread.c" line 1364
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: petrum at gmail dot com
  Target Milestone: ---

While experimenting with a CodeSonar plugin we develop, we noticed a
potential bug in file "gdb/stabsread.c" line 1364, function define_symbol 

1359           *typedef_sym = *sym;
1360           SYMBOL_ACLASS_INDEX (typedef_sym) = LOC_TYPEDEF;
1361           SYMBOL_VALUE (typedef_sym) = valu;
1362           SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
1363           if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
1364             TYPE_NAME (SYMBOL_TYPE (sym)) //HERE
1365               = obconcat (&objfile->objfile_obstack,
1366                           SYMBOL_LINKAGE_NAME (sym),
1367                           (char *) NULL);
1368           add_symbol_to_list (typedef_sym, &file_symbols);

Shouldn't typedef_sym be used instead of sym (and maybe also in the previous
line)? A similar issue might be in line 1320.

Regards,
Petru Florin Mihancea

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]