Bug 15305 - (patch):prevent crash in libX11 when reading broken Xcms.txt
Summary: (patch):prevent crash in libX11 when reading broken Xcms.txt
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xlib (show other bugs)
Version: unspecified
Hardware: Other All
: high normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2008-04-01 09:39 UTC by walter
Modified: 2008-04-07 22:06 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
patch for libX11-1.1.4/src/xcms/cmsColNm.c (971 bytes, patch)
2008-04-01 09:39 UTC, walter
no flags Details | Splinter Review
Add error checking to getSectionSize() call in LoadColornameDB() (805 bytes, patch)
2008-04-03 15:14 UTC, Bart Massey
no flags Details | Splinter Review

Description walter 2008-04-01 09:39:26 UTC
Created attachment 15606 [details] [review]
patch for libX11-1.1.4/src/xcms/cmsColNm.c

when reading Xcms.txt error may occur but they will never evaluated. The wrong data will cause crashes. This patch adds error checking.


:~> export XCMSDB=~/cms.txt
:~> xterm -bg TEST1
Warning: Color name "TEST1" is not defined
Speicherzugriffsfehler

/* after fix (Ignore the additional warnings */
:~> xterm -bg TEST1
Warning: locale not supported by Xlib, locale set to C
Warning: X locale modifiers not supported, using default
Warning: Color name "TEST1" is not defined
Failed to open input method
Comment 1 Bart Massey 2008-04-03 15:14:27 UTC
Created attachment 15668 [details] [review]
Add error checking to getSectionSize() call in LoadColornameDB() 

I tried to do a minimal clean patch to achieve the same objective as patch #15606.
Comment 2 Bart Massey 2008-04-07 22:06:32 UTC
Committed my version of the patch and am marking the bug closed.  Apparently the original reporter has a more complete patch containing a rewritten file parser; this should probably be handled as a second bug.


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.