Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!princeton!allegra!ulysses!mhuxr!mhuxt!houxm!ihnp4!chinet!lee From: lee@chinet.UUCP (Lee Morehead) Newsgroups: net.bugs.usg Subject: Re: bugs in /bin/mail Message-ID: <653@chinet.UUCP> Date: Wed, 22-Oct-86 00:42:06 EDT Article-I.D.: chinet.653 Posted: Wed Oct 22 00:42:06 1986 Date-Received: Thu, 23-Oct-86 02:43:03 EDT References: <1196@ncr-sd.UUCP> Reply-To: lee@chinet.UUCP (Lee Morehead) Distribution: world Organization: chi-net, Public Access UN*X, Chicago IL Lines: 44 In article <1196@ncr-sd.UUCP> matt@ncr-sd.UUCP (Matt Costello) writes: >I've found two bugs in the mail program recently, and thought >I'd share them. >[....] Description of first bug not being addressed here. > >The second (and more serious) bug comes about because of the trouble >mail goes through to preserve null characters in mail. Since it cannot >use strlen to find the length of an input line it searches for the >terminating newline that terminates the fgets function. If the last >character of the mail input is not a newline, then the last line will >not have a newline to find. In this case one or more bogus characters >will be written out. The code fragments in question are: > >[....] Examples of C code. > >Now for the questions. Why does mail go to so much trouble to preserve >nulls in a mail file? Mailx aborts if it detects a null and vi strips nulls. >Does anybody know why mail does not remove them? Does anyone see any >reason why stripping nulls would have a detrimental effect? >-- >Matt Costello, matt@ncr-sd.SanDiego.NCR.com (not registered yet) > {sdcsvax,dcdwest,ihnp4}!ncr-sd!matt Yes. Certain commercial programs such as Qoffice can create an internal document format which will contain null characters. If these null characters are removed then the document format will be corrupted and the resulting document may no longer be readable at the receiving end. I have mucho problems with my people trying to read Qoffice documents with mail. It will always leave the mail file with a length of one character. This one character happens to be a null. The existance of this null character will usually cause the next mail message to be eaten because mail gets confused. That is one of the main reasons that I converted to mailx; it aborts on NULL characters. Qoffice can, of course, read it's own document format and a pure ASCII file. I tell most people to use Qoffice only to read mail to avoid confusion. -- Lee Morehead ...!ihnp4!chinet!lee "One size fits all." Just who is this "all" person anyway, and why is he wearing my clothes?