public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/22594] Possible access to unintended variable in "gdb/stabsread.c" line 1364
       [not found] <bug-22594-4717@http.sourceware.org/bugzilla/>
@ 2020-04-07 17:10 ` ssbssa at sourceware dot org
  2020-04-07 18:24 ` tromey at sourceware dot org
  1 sibling, 0 replies; 2+ messages in thread
From: ssbssa at sourceware dot org @ 2020-04-07 17:10 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

--- Comment #2 from Hannes Domani <ssbssa at sourceware dot org> ---
(In reply to Petru-Florin Mihancea from comment #0)
> 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

Because of:
          *typedef_sym = *sym;

TYPE_NAME (SYMBOL_TYPE (sym)) and TYPE_NAME (SYMBOL_TYPE (typedef_sym)) are
equivalent, so it doesn't make a difference which one is used here.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug gdb/22594] Possible access to unintended variable in "gdb/stabsread.c" line 1364
       [not found] <bug-22594-4717@http.sourceware.org/bugzilla/>
  2020-04-07 17:10 ` [Bug gdb/22594] Possible access to unintended variable in "gdb/stabsread.c" line 1364 ssbssa at sourceware dot org
@ 2020-04-07 18:24 ` tromey at sourceware dot org
  1 sibling, 0 replies; 2+ messages in thread
From: tromey at sourceware dot org @ 2020-04-07 18:24 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
Right you are.  I'm closing this.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-07 18:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-22594-4717@http.sourceware.org/bugzilla/>
2020-04-07 17:10 ` [Bug gdb/22594] Possible access to unintended variable in "gdb/stabsread.c" line 1364 ssbssa at sourceware dot org
2020-04-07 18:24 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).