Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#135 layer1/CGO.c at r4039 shows array overrun in clang

v1.6.2.0
closed-fixed
Thomas Holder
None
5
2013-08-27
2013-08-23
Jack Howarth
No

When compiling the current svn of pymol at r4039 using the clang 3.3 compilers, the following array overrun is exposed...

clang -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -fwrapv -O3 -Wall -Wstrict-prototypes -I/sw/include -D_PYMOL_VMD_PLUGINS -D_PYMOL_LIBPNG -D_PYMOL_FREETYPE -D_PYMOL_INLINE -D_PYMOL_OPENGL_SHADERS -DNO_MMLIBS -D_PYMOL_CGO_DRAWARRAYS -D_PYMOL_CGO_DRAWBUFFERS -D_CGO_DRAWARRAYS -D_PYMOL_GL_CALLLISTS -DOPENGL_ES_2 -D_PYMOL_NUMPY -Iov/src -Ilayer0 -Ilayer1 -Ilayer2 -Ilayer3 -Ilayer4 -Ilayer5 -Imodules/cealign/src -Imodules/cealign/src/tnt -Ibuild/generated -Icontrib/uiuc/plugins/include -Icontrib/uiuc/plugins/molfile_plugin/src -I/sw/lib/python2.7/site-packages/numpy/core/include -I/sw/include -I/sw/include/freetype2 -I/usr/include -I/usr/X11/include -I/usr/X11/include/freetype2 -I/sw/include/python2.7 -c layer1/CGO.c -o build/temp.macosx-10.9-x86_64-2.7/layer1/CGO.o -ffast-math -funroll-loops -O3 -fcommon
layer1/CGO.c:3036:62: warning: array index 3 is past the end of the array (which contains 3 elements) [-Warray-bounds]
colorVals[cpl+2] = cgo->color[2]; colorVals[cpl+3] = cgo->color[3];
^ ~
layer1/CGO.h:77:3: note: array 'color' declared here
float normal[3], color[3], texture[2];
^

Discussion

  • Thomas Holder
    Thomas Holder
    2013-08-24

    • assigned_to: Thomas Holder
    • Group: 1.4.2b1 --> v1.6.2.0
     
  • Thomas Holder
    Thomas Holder
    2013-08-27

    • status: open --> closed-fixed
     
  • Thomas Holder
    Thomas Holder
    2013-08-27

    Thanks Jack. Fixed in SVN r4040.