Bug 6026 - XDM: Segfault in netaddr.c:ConvertAddr
Summary: XDM: Segfault in netaddr.c:ConvertAddr
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: App/xdm (show other bugs)
Version: 7.0.0
Hardware: x86 (IA32) Linux (All)
: high major
Assignee: Xorg Project Team
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-24 16:58 UTC by Loser Mcloser
Modified: 2006-02-24 17:01 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Loser Mcloser 2006-02-24 16:58:40 UTC
It is possible for the ifa_addr field of an ifaddrs struct to be NULL (for
example, in the case that the ifaddrs struct corresponds to a pppX interface).

This causes a segfault in the child process forked by session.c:StartClient. The
result is that after a user attempts to login, the screen goes black, and then
goes back to the XDM login screen because the segfault only takes down the child
process that would have started the user's session.

Below is a patch against xdm-X11R7.0-1.0.1 to fix the segfault.

diff -Naur xdm-X11R7.0-1.0.1/netaddr.c xdm-X11R7.0-1.0.1-edit/netaddr.c
--- xdm-X11R7.0-1.0.1/netaddr.c 2004-04-23 15:54:42.000000000 -0400
+++ xdm-X11R7.0-1.0.1-edit/netaddr.c    2006-02-24 00:45:00.000000000 -0500
@@ -155,7 +155,7 @@
 {
     int retval;

-    if (len == NULL)
+    if ((len == NULL) || (saddr == NULL))
         return -1;
     *addr = NetaddrAddress(saddr, len);
 #ifdef STREAMSCONN
Comment 1 Alan Coopersmith 2006-02-25 12:01:28 UTC
Thanks for the fix - committed to CVS HEAD:

CVSROOT:	/cvs/xorg
Module name:	app
Changes by:	alanc@kemper.freedesktop.org	06/02/25 00:58:51

Log message:
  2006-02-24  Alan Coopersmith  <alan.coopersmith@sun.com>
  
  	* netaddr.c:
  	Bug #6026 <https://bugs.freedesktop.org/show_bug.cgi?id=6026>
  	Segfault in netaddr.c:ConvertAddr if ifa_addr is NULL
  	(Loser Mcloser <reebydobalina@yahoo.ca>)

Modified files:
      app/xdm/:
        ChangeLog netaddr.c 
  
  Revision      Changes    Path
  1.29          +7 -0      app/xdm/ChangeLog
  http://cvs.freedesktop.org/xorg/app/xdm/ChangeLog
  1.3           +1 -1      app/xdm/netaddr.c
  http://cvs.freedesktop.org/xorg/app/xdm/netaddr.c


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.