chris@wiley.UUCP (Chris Stassen) (10/14/87)
Reply-Path: I don't know if this has been mentioned before... we have found a bug in Ultrix 2.0 libc source that causes getdiskbyname(3x) to crash on the eighth invocation (or thereabouts). [line 13 of /usr/src/lib/libc/vax/gen/disktab.c:] < static char localbuf[100], *cp = localbuf; [should be:] > static char localbuf[100]; > char *cp = localbuf; cp gets incremented as various strings are stored in localbuf (within getdiskbyname()). When cp runs off the end of localbuf (8th call), the first value that gets wiped out is cp, and a core dump is caused. The problem is fixed by making cp "auto" (rather than "static"), which causes the initialization (cp = localbuf) to be performed on every call. [The strings stored in localbuf are pointed to from another static structure, which is overwritten with every call to getdiskbyname(), so re-initializing cp (and overwriting the strings from the last call) doesn't hurt.] -- Chris -- "Nothing succeeds like a parakeet | Chris Stassen with no teeth." -- Benny Hill | {trwrb|cit-vax}!wiley!chris