Bug 10046

Summary: uudecode does not handle spaces correctly
Product: Busybox Reporter: Henry Margies <henry.margies>
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.33.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

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.