Thread View: net.bugs
1 messages
1 total messages
Started by John Sambrook
Tue, 12 Aug 1986 03:53
Bug in "pathalias"
Author: John Sambrook
Date: Tue, 12 Aug 1986 03:53
Date: Tue, 12 Aug 1986 03:53
44 lines
1979 bytes
1979 bytes
The version of "pathalias" posted to mod.sources seems to contain a bug. From the "CHANGES" file it seems that we have the version distributed on or about 1/86. The bug concerns the function yylex() as contained in file "parse.y". Within the body of yylex() there is a declaration of the variable "buf" as follows: char buf[BUFSIZ], errbuf[128]; Unfortunately, the value contained in buf is used after the function has returned. For example, when a HOST token has been scanned the following code is executed: . . . yylval.y_name = buf; return(HOST); } Of course, as soon as the return statement is executed the value of buf is no longer guaranteed. On many implementations this "happens" to work, but it is not correct. While this was tedious to find, it is easy to fix. Simply change the old declaration to the following: #if 0 /* bug fix */ char buf[BUFSIZ], errbuf[128]; #else static char buf[BUFSIZ]; char errbuf[128]; #endif After fixing this one minor problem "pathalias" works like a champ. I should point out that very few programs have been as easy to port to our system. We have a DG MV/10000 and we find all the "dereference through NULL" bugs and then some :-) -- John Sambrook Work: (206) 545-2018 University of Washington WD-12 Home: (206) 487-0180 Seattle, Washington 98195 UUCP: uw-beaver!uw-nsr!john
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads