bugs in /bin/mail

Lee Morehead lee at chinet.UUCP
Wed Oct 22 14:42:06 AEST 1986


In article <1196 at ncr-sd.UUCP> matt at 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 at 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?



More information about the Net.bugs.usg mailing list