Bug in calls(1) [public domain cflow(1) clone] fixed: scan.c

Dennis P. Bednar dennis at virtech.uucp
Fri Jan 12 18:30:22 AEST 1990


Hi:

Recently I ported the calls(1) program to iRMX286. During that
port, I found a bug where there was an unitialized pointer in a
structure. That pointer was supposed to point to a filename
string, but didn't, and so when strcmp() was later called with
that random pointer, the program would crash with a GP (General
Protection) fault 13. I don't know if this bug has been reported
before, but here is the diffc output for the file scan.c:

*** scan.c.orig			Sun Dec 31 03:19:45 1989
--- /tmp/dennis/irmx.scan.c	Fri Jan 12 02:22:14 1990
***************
*** 78,83 ****
--- 89,97 ----
  		pHT->calledp = 0;
  		pHT->pINcalls = nilINST;
  #endif BADCALLOC
+ 		/* iRMX286 bug fix on next line	*/
+ 		pHT->pchfile = strsave(pchFile);
+ 
  		pHT->localp = Localp;
  		pHT->pHTnext = *ppHT;
  		*ppHT = pHT;
-- 
Dennis Bednar	uunet!virtech!dennis	(703)760-3357(w)   (703)437-4384(h)
Cable & Wireless,	Tysons Corner VA



More information about the Comp.sources.bugs mailing list