Bug 732990

Summary: Coverity defects added in RHEL6.2 - gdb
Product: Red Hat Enterprise Linux 6 Reporter: Pavel Raiskup <praiskup>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED WONTFIX QA Contact: qe-baseos-tools-bugs
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: sergiodj
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-24 13:31:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.