🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #25145

bug in xwd

#25145
From: ken
Date: Tue, 17 Feb 1987 03:52
47 lines
2118 bytes
There is a nil deref bug in xwd.c which shows up on Suns. Fix follows.
Also I have a version of xpr for Imagens for people who are willing to
be guinea pigs.

	Ken

*** xwd.c.orig	Mon Dec  1 20:17:54 1986
--- xwd.c	Mon Feb 16 21:37:38 1987
***************
*** 26,31
   *      V5 padding at the end. Up to 16-bit displays are supported. I
   *      don't yet know how 24- to 32-bit displays will be handled under
   *      the Version 11 protocol.
   */
  
  #ifndef lint

--- 26,36 -----
   *      V5 padding at the end. Up to 16-bit displays are supported. I
   *      don't yet know how 24- to 32-bit displays will be handled under
   *      the Version 11 protocol.
+  *
+  *  2/16/87 Ken Yap
+  *    - Bug if window has no name. Cannot defererence win_name on Suns
+  *	because it holds a nil pointer. Fixed by assigning pointer to
+  *	empty string to win_name.
   */
  
  #ifndef lint
***************
*** 195,200
       Error("Can't query target window.");
      if(XFetchName(target_win, &win_name) == FAILURE)
       Error("Can't fetch target window name.");
  
      /* sizeof(char) is included for the null string terminator. */
      win_name_size = strlen(win_name) + sizeof(char);

--- 200,207 -----
       Error("Can't query target window.");
      if(XFetchName(target_win, &win_name) == FAILURE)
       Error("Can't fetch target window name.");
+     if(win_name == NULL)
+      win_name = "";
  
      /* sizeof(char) is included for the null string terminator. */
      win_name_size = strlen(win_name) + sizeof(char);
Technical Details
Message-ID: <8702170259.11740@ur-seneca.arpa>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!mit-eddie!bacchus!husc6!seismo!lll-lcc!ames!ucbcad!ucbvax!CS.ROCHESTER.EDU!ken

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!mit-eddie!bacchus!husc6!seismo!lll-lcc!ames!ucbcad!ucbvax!CS.ROCHESTER.EDU!ken
From: ken@CS.ROCHESTER.EDU.UUCP
Newsgroups: comp.windows.x
Subject: bug in xwd
Message-ID: <8702170259.11740@ur-seneca.arpa>
Date: Mon, 16-Feb-87 22:52:45 EST
Article-I.D.: ur-senec.8702170259.11740
Posted: Mon Feb 16 22:52:45 1987
Date-Received: Tue, 17-Feb-87 18:47:36 EST
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The ARPA Internet
Lines: 47