Summary: | XvQueryPortAttributes (libXv) does not guarantee nil-terminated names and can return uninitialized memory | ||||||
---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | Daphne Pfister <daphnediane> | ||||
Component: | Lib/other | Assignee: | Alan Coopersmith <alan.coopersmith> | ||||
Status: | RESOLVED FIXED | QA Contact: | Xorg Project Team <xorg-team> | ||||
Severity: | normal | ||||||
Priority: | medium | ||||||
Version: | git | ||||||
Hardware: | Other | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
i915 platform: | i915 features: | ||||||
Attachments: |
|
Description
Daphne Pfister
2013-06-02 02:09:07 UTC
Created attachment 80145 [details] [review] Patch to fix This patch attempts to fix this bug by ensuring that there is at least one nil byte at the end of all the name strings. This should prevent reading past the end of the allocation as well as exposing uninitialized memory. The (INT_MAX/2) - 1 change isn't necessary because of rounding adding 1 will not overflow, but seems pointless to require the mental arithmetic every time the code was read. ( Proof: 2*(INT_MAX/2) == INT_MAX - 1 assuming integer math and that INT_MAX is always odd. ) Fix pushed to git master: To ssh://git.freedesktop.org/git/xorg/lib/libXv 179ed25..22cc0c8 master -> master http://cgit.freedesktop.org/xorg/lib/libXv/commit/?id=22cc0c897a28a41d49fe68277bb3c002f54bbb48 Thanks for finding & fixing this! |
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.