Bug 93273 - OrderEvents and OrderModifiers triggers undefined behavior
Summary: OrderEvents and OrderModifiers triggers undefined behavior
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xt (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-06 16:27 UTC by Yury Gribov
Modified: 2018-08-10 20:02 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Yury Gribov 2015-12-06 16:27:12 UTC
OrderEvents and OrderModifiers comparison functions (both from src/TMparse.c) return 1 for equal arguments. This violates requirements to qsort's comparison function (which must be a total ordering) and causes UB at runtime. In practice this may mean strange misbehaviors.

The issue can be easily fixed by adding one more check for equal signature fields.
Comment 1 GitLab Migration User 2018-08-10 20:02:04 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/xorg/lib/libxt/issues/9.


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.