RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 732754 - Coverity scan revealed defects
Summary: Coverity scan revealed defects
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: xorg-x11-drv-intel
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Adam Jackson
QA Contact: desktop-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-23 13:54 UTC by Michal Luscon
Modified: 2011-09-26 20:26 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-26 18:50:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Michal Luscon 2011-08-23 13:54:00 UTC
Description of problem:

/intel-gpu-tools-20110628/tests/gem_stress_gen6.c:506 - This greater-than-or-equal-to-zero comparison of an unsigned value is always true.

/intel-gpu-tools-20110628/tests/gem_stress.c:503 - Dereferencing "tiling" (line #502) before a null check.

/xf86-video-intel-2.16.0/src/i965_render.c:1240 - Overrunning static array "i965_tex_formats", with 13 elements, at position 13 with index variable "i".

/xf86-video-intel-2.16.0/src/intel_dri.c:885 - Dereferencing "drawable" (line #877) before a null check.


Version-Release number of selected component (if applicable):
xorg-x11-drv-intel-2.16.0-1.el6

Additional info:
These defects were not present in the previous version of package.

Comment 2 Adam Jackson 2011-09-26 18:50:02 UTC
(In reply to comment #0)
> Description of problem:
> 
> /intel-gpu-tools-20110628/tests/gem_stress_gen6.c:506 - This
> greater-than-or-equal-to-zero comparison of an unsigned value is always true.

Yeah, that's macro abuse for you.  Learn about assert() please.

> /intel-gpu-tools-20110628/tests/gem_stress.c:503 - Dereferencing "tiling" (line
> #502) before a null check.

Technically true but harmless, tiling argument is always &foo in the callers.

> /xf86-video-intel-2.16.0/src/i965_render.c:1240 - Overrunning static array
> "i965_tex_formats", with 13 elements, at position 13 with index variable "i".

Coverity bug, this path is guarded by an assert() which makes that value a can't-happen.

> /xf86-video-intel-2.16.0/src/intel_dri.c:885 - Dereferencing "drawable" (line
> #877) before a null check.

Technically true but harmless, the 'drawable' argument will be non-zero here because dixLookupDrawable() in the caller will have filled it in.

Comment 3 Kamil Dudka 2011-09-26 20:26:21 UTC
(In reply to comment #2)
> > /xf86-video-intel-2.16.0/src/i965_render.c:1240 - Overrunning static array
> > "i965_tex_formats", with 13 elements, at position 13 with index variable "i".
> 
> Coverity bug, this path is guarded by an assert() which makes that value a
> can't-happen.

True, but only for _debug_ build.  When building for production, the preprocessed code looks like this:

static uint32_t i965_get_card_format(PicturePtr picture)
{
    int i;

    for (i = 0; i < sizeof(i965_tex_formats) / sizeof(i965_tex_formats[0]);
            i++) {
        if (i965_tex_formats[i].fmt == picture->format)
            break;
    }
    ((void) (0));

    return i965_tex_formats[i].card_fmt;
}

> > /xf86-video-intel-2.16.0/src/intel_dri.c:885 - Dereferencing "drawable" (line
> > #877) before a null check.
> 
> Technically true but harmless, the 'drawable' argument will be non-zero here
> because dixLookupDrawable() in the caller will have filled it in.

Does it mean the NULL checks are there by mistake?  The NULL checks as they are now can never ever be fired...


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