Bug 15305

Summary: (patch):prevent crash in libX11 when reading broken Xcms.txt
Product: xorg Reporter: walter <wharms>
Component: Lib/XlibAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: high CC: x
Version: unspecifiedKeywords: patch
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
patch for libX11-1.1.4/src/xcms/cmsColNm.c
none
Add error checking to getSectionSize() call in LoadColornameDB() none

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.