Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site teltone.UUCP Path: utzoo!linus!decvax!microsoft!uw-beaver!teltone!stan From: stan@teltone.UUCP () Newsgroups: net.bugs.uucp Subject: Re: BUG in System III UUCP (FLAME) Message-ID: <226@teltone.UUCP> Date: Tue, 3-Jan-84 21:21:44 EST Article-I.D.: teltone.226 Posted: Tue Jan 3 21:21:44 1984 Date-Received: Thu, 5-Jan-84 01:13:52 EST References: <205@dual.UUCP> Organization: Teltone Corp., Kirkland, WA Lines: 52 We discovered that bug a couple months ago. Here's what I did to fix it. The bad part of the code is in gio.c/grddata(), at the fwrite() call. The return value of the fwrite() isn't checked. Here's the appropriate code section and changes in grddata(): for (;;) { int len2; . . . old line>> /* fwrite(bufr, sizeof (char), len, fp2); */ len2 = fwrite(bufr, sizeof (char), len, fp2); /* need to check if the fwrite was successful. /* if the filesystem is too full then the write will /* fail. 'if' statement below is new. /* (FAIL-1) = -2 will indicate a write failure; cntrl() /* in cntrl.c will now unlink the temp file if the return /* code is (FAIL-1) --StanT 10/27/83 */ if (ferror(fp2) || (len2 != len)) return(FAIL - 1); . . . In cntrl.c/cntrl(), about midway through the file, is the code: WMESG(SNDFILE, YES); ret = (*Rddata)(Ifn, fp); fclose(fp); if (ret != 0) { (*Turnoff)(); return(FAIL); } /* copy to user directory */ which could be changed to: WMESG(SNDFILE, YES); ret = (*Rddata)(Ifn, fp); fclose(fp); if (ret != 0) { (*Turnoff)(); /* If return is (FAIL-1) then there was a failure /* writing to the TM. file; maybe the disk was full /* so the TM. file should then be removed. /* if(..) statement below does the trick; grddata() /* in gio.c was modified to return FAIL-1 /* --StanT--10/27/83 */ only change>> if (ret == (FAIL-1)) unlink(Dfile); return(FAIL); } /* copy to user directory */