Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site hao.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!hao!pag From: pag@hao.UUCP (Peter Gross) Newsgroups: net.news,net.news.adm Subject: Path truncation bug discovered and fixed Message-ID: <1228@hao.UUCP> Date: Tue, 23-Oct-84 02:44:25 EDT Article-I.D.: hao.1228 Posted: Tue Oct 23 02:44:25 1984 Date-Received: Wed, 24-Oct-84 07:44:36 EDT References: <1218@utah-gr.UUCP> Organization: High Altitude Obs./NCAR, Boulder CO Lines: 34 If you are anything like me,, you hate to be accused of propagating a bug that infects the entire known USENET world. The infamous "path truncation" bug has been laid at the doorstep of my site, hao. Horrors. The sad truth is that, yes, we have spread the bubonic truncation plague hither and yon. Followups and replies are dying everywhere. Time is running out. Nerves are frayed. Well, fear not, friends. The bug has been found. The culprit was a change in header.c in news 2.10.2. It was subtle enough that it would only likely show up on PDP-11's. The offending line of code follows: strncpy(hpfield, ptr, BUFLEN); What happened is that every time a header field was copied, BUFLEN chars were copied no matter what the size of the field. Most header fields are strings of size BUFLEN, but some are longer (Path: and Control:). Others are shorter. In the case where the fields are longer, they were truncated to BUFLEN (128 on pdp11, 256 on other machines); in the case where they were shorter, other parts of the header were trashed. (This may be the source of the "0 Lines" bug -- I haven't checked that one yet). The solution? I added an argument to getfield(): the header type. getfield() now sets the copy size according to type. For a quick and dirty fix, just change the strncpy() to a strcpy(). I have posted the new version of header.c to net.sources. While I am convinced that this was a bug, I haven't yet received any articles with paths longer than 128 chars to check on the fix. The logic in getfield() was pretty obviously wrong though. yours for a bug-free USENET, --peter gross hao!pag