Bug 153276 - [patch] uudecode(1) error message is incorrect
Summary: [patch] uudecode(1) error message is incorrect
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2010-12-18 19:20 UTC by David Brennan
Modified: 2018-01-03 05:12 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description David Brennan 2010-12-18 19:20:08 UTC
I discovered this problem on my OS X machine, and I am just trying to pass the information upstream as I see it also exists in the FreeBSD source code.

When using uudecode, if an improper character is detected, the error message that is printed does not match the actual error. The problem is that the IS_DEC macro allows character 32-96 inclusive. But the error message says that the allowed characters are 33-96. This caused me some trouble in diagnosing a problem with an external uuencode system.

#define IS_DEC(c)	 ( (((c) - ' ') >= 0) && (((c) - ' ') <= 077 + 1) )

#define OUT_OF_RANGE do {						\
	warnx("%s: %s: character out of range: [%d-%d]",		\
	    infile, outfile, 1 + ' ', 077 + ' ' + 1);			\

As you can see, the error message includes a 1 + ' ', which this IS_DEC macro does not have.


#define OUT_OF_RANGE do {						\
	warnx("%s: %s: character out of range: [%d-%d]",		\
	    infile, outfile, ' ', 077 + ' ' + 1);			\
How-To-Repeat: This only occurs with an improperly formatted file. Here is a simple way to improperly format a file.
$ echo "This is a test" >temp.txt
$ uuencode -o temp.uu temp.txt temp.txt
$ cat temp.uu
begin 644 temp.txt

$ sed 's/^`$//' temp.uu | uudecode
    input file: stdin
    encoded file: temp.txt
    character out of range: [33-96]
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:10 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped