Bug 10046 - uudecode does not handle spaces correctly
Summary: uudecode does not handle spaces correctly
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: 1.33.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-12 16:22 UTC by Henry Margies
Modified: 2017-07-14 15:25 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henry Margies 2017-07-12 16:22:53 UTC
Since version 1.24 (commit 2b48c38be60cf9033761365f40c05f2e6a41a1c4), uudecode strips trailing white spaces from the end of every line. However, as space is a valid character in uu-encoded data, this will lead to the error message "short file".

The Busybox version of uuencode uses "`" instead of space for encoding, however, many other implementations do use spaces (e.g. Python, Java).

Example:

echo '1234567890' > in
python -c 'import uu; uu.encode("in", "out", 0666)'

The "out" file has the following content (I added quotes):

"begin 644 438"
"+,3(S-#4V-S@Y, H "
" "
"end"

The Busybox uudecode variant will remove the trailing space after the "H" and then fail, as the line is then too short.
Comment 1 Denys Vlasenko 2017-07-14 15:25:57 UTC
Fixed in git, thanks.