Small patch for xserver

Daniel Stone daniel at fooishbar.org
Sat Dec 2 14:22:34 PST 2006


On Sat, Dec 02, 2006 at 11:31:15AM -0800, Kean Johnston wrote:
> Attached is a small patch for the X server I would dearly like to see
> go in before 7.2. It checks for a NULL return before calling a function
> with the NULL list, which causes a SIGSEGV, which can leave the console
> truly hosed.

Hi,
Aside from the 0 != NULL bit and FORTRAN style, you appear to be looking
at quite an old codebase:

commit 354086d7e8e13fc7acbcc6603ca2a03c8cc806ee
Author: Jeremy C. Reed <reed at reedmedia.net>
Date:   Thu May 25 23:32:33 2006 +0000

    Don't do fixup_video_driver_list if no drivers. (I had signal 11 and core
        dump when drivers not installed yet.)
    TODO: fix fixup_video_driver_list to handle NULL argument.

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 78e6033..42e7d87 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -510,7 +510,7 @@ #ifdef XFree86LOADER
     ret = LoaderListDirs(subdirs, patlist);
     
     /* fix up the probe order for video drivers */
-    if (strstr(dirname, "drivers"))
+    if (strstr(dirname, "drivers") && ret != NULL)
         fixup_video_driver_list(ret);
 
     return ret;


Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20061203/7683a948/attachment.pgp>


More information about the xorg mailing list