Summary: | libicccm: xcb_get_wm_class_from_reply() causes reads beyond end of buffer | ||
---|---|---|---|
Product: | XCB | Reporter: | Uli Schlachter <psychon> |
Component: | Utils | Assignee: | xcb mailing list dummy <xcb> |
Status: | RESOLVED FIXED | QA Contact: | xcb mailing list dummy <xcb> |
Severity: | minor | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Sample app setting an invalid WM_CLASS to trigger the bug in xcb_get_wm_class_from_reply()
Proposed bug fix |
Description
Uli Schlachter
2010-08-03 01:58:31 UTC
Created attachment 37537 [details] [review] Proposed bug fix Could you please try the attached patch and let me know if it works for you? Thanks. Patch works as expected. I can't say that I like this since it will mean lots of new bug reports for broken apps, but it fixes this issue. Thanks. As a side-note: I took a look at libx11's XGetClassHint() and it's affected, too (It uses strlen()). Pushed. Thanks for the report, and thanks for testing. BTW, I reported the Java bug (failure to NULL terminate WM_CLASS) to the Java team when I hit this during the xwininfo port to xcb: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6961123 (In reply to comment #2) > As a side-note: I took a look at libx11's XGetClassHint() and it's affected, > too (It uses strlen()). It works because it calls XGetWindowProperty to get the string, and Xlib always appends a trailing NULL to the string it returns from XGetWindowProperty. |
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.