Bug 91631

Summary: Clang static analysis of libtess shows undefined values and use of memory after free
Product: Mesa Reporter: Jonathan Liu <net147>
Component: GLUAssignee: mesa-dev
Status: RESOLVED MOVED QA Contact: mesa-dev
Severity: major    
Priority: medium CC: ajax, brianp, frederic.devernay
Version: git   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Jonathan Liu 2015-08-14 04:09:45 UTC
Using static analyzer included in clang 3.6.2:
$ ./autogen.sh 
$ ./configure
$ scan-build make
  CC       src/libtess/dict.lo
  CC       src/libtess/geom.lo
  CC       src/libtess/memalloc.lo
  CC       src/libtess/mesh.lo
  CC       src/libtess/normal.lo
src/libtess/normal.c:112:6: warning: Assigned value is garbage or undefined
  v1 = minVert[i];
     ^ ~~~~~~~~~~
src/libtess/normal.c:113:6: warning: Assigned value is garbage or undefined
  v2 = maxVert[i];
     ^ ~~~~~~~~~~
2 warnings generated.
  CC       src/libtess/priorityq.lo
  CC       src/libtess/render.lo
  CC       src/libtess/sweep.lo
src/libtess/sweep.c:779:11: warning: Use of memory after it is freed
    if( ! regUp->dirty ) {
          ^~~~~~~~~~~~
src/libtess/sweep.c:803:10: warning: Use of memory after it is freed
          eLo = regLo->eUp;
                ^~~~~~~~~~
src/libtess/sweep.c:808:10: warning: Use of memory after it is freed
          eUp = regUp->eUp;
                ^~~~~~~~~~
3 warnings generated.
Comment 1 GitLab Migration User 2019-05-13 16:11:39 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/glu/issues/3.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.