Bug 732990 - Coverity defects added in RHEL6.2 - gdb
Summary: Coverity defects added in RHEL6.2 - gdb
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: gdb
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jan Kratochvil
QA Contact: qe-baseos-tools
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-24 12:02 UTC by Pavel Raiskup
Modified: 2011-08-24 13:31 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-24 13:31:00 UTC


Attachments (Terms of Use)

Description Pavel Raiskup 2011-08-24 12:02:06 UTC
suspicious check for NULL

=> gdb/elfread.c:2351

if (ret->args++ != NULL
    || memchr (ret->args, ...) {
}

shouldn't there be:

if (++ret->args != NULL
    && memchr (ret->args, ...) {
}

?

This error was added by gdb-stap-6of6.patch.

Comment 2 Jan Kratochvil 2011-08-24 13:31:00 UTC
Thanks for finding it, fortunately upstream archer-sergiodj-stap-patch-split has it already fixed:

+      if (ret->args != NULL)
+       ++ret->args;
+      if (ret->args == NULL
+         || (memchr (ret->args, '\0', (unsigned long *) el->data
+                     + el->size - (unsigned long *) ret->name)
+             != el->data + el->size - 1))

It PASSes testsuite in RHEL-6.2, I guess it got compiled right.


Note You need to log in before you can comment on or make changes to this bug.