Bug 13357 - xcmsdb segfaults on xcms.txt (patch included)
Summary: xcmsdb segfaults on xcms.txt (patch included)
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: App/other (show other bugs)
Version: 7.2 (2007.02)
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2007-11-22 08:44 UTC by walter
Modified: 2007-11-28 10:24 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description walter 2007-11-22 08:44:58 UTC
xcmsdb colors
Speicherzugriffsfehler

offendig file colors:
SCREENDATA_BEGIN
XCMS_COLORDB_BEGIN 0.1

reason:
strcmp() withput checking if we have realy a string.



--- loadData.c.org      2007-11-22 17:35:13.000000000 +0100
+++ loadData.c  2007-11-22 17:37:09.000000000 +0100
@@ -1479,7 +1479,7 @@
     }
 
     token1 = strtok((char*)NULL, DATA_DELIMS);
-    if ((strcmp(token1, TXT_FORMAT_VERSION) != 0) &&
+    if ( token1 && (strcmp(token1, TXT_FORMAT_VERSION) != 0) &&
            (strcmp(token1, "0.3") != 0)) {
        fprintf(stderr,
     "Screen data format version mismatch in file %s-- expected %s, found %s\n",
Comment 1 Alan Coopersmith 2007-11-28 10:24:54 UTC
Fix committed to git master - thanks for the report/patch:

commit be13ab935be74f19c4f98c3b51b61154f7da9dcc
Author: walter <wharms@bfs.de>
Date:   Thu Nov 22 17:37:09 2007 -0800

    X.Org Bug #13357: xcmsdb segfaults on xcms.txt
    
    <http://bugs.freedesktop.org/show_bug.cgi?id=13357>


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.