Bug 90616 - libICE build fails on array bounds check
Summary: libICE build fails on array bounds check
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/ICE (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-24 12:06 UTC by Remko van der Vossen
Modified: 2015-07-19 15:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch to change _IceVersion* globals to const variables (2.59 KB, text/plain)
2015-05-24 12:06 UTC, Remko van der Vossen
no flags Details

Description Remko van der Vossen 2015-05-24 12:06:58 UTC
Created attachment 116007 [details]
Patch to change _IceVersion* globals to const variables

Recent versions of gcc have array bounds checking turned on by default, this leads to build failures of libICE. As the _IceVersionCount variable in ICElibint.h is not declared const the compiler cannot assume that the nested for loop in ProcessConnectionSetup stays within bounds.

The simple fix is of course to change the declarations of _IceVersionCount, _IceVersions, and the local variable myVersionCount to const declarations, a patch for which is attached to this bug report. I am however not certain that this does not have any ABI impact. The name of file ICElibint.h suggests there is no ABI impact, but I don't know enough of the library to say with certainty.
Comment 1 Alan Coopersmith 2015-07-19 15:38:36 UTC
Correct, the ABI we intend to export is covered in the header files in the
include/X11/ICE/ subdirectory - src/ICElibint.h is considered internal
implementation details of the library.

This looks reasonable and since no one else has suggested an alternative,
nor commented on this, I've gone ahead and pushed to git master so it
starts getting a little testing.

To ssh://git.freedesktop.org/git/xorg/lib/libICE
   8a511da..b1720ed  master -> master


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.