[Toybox] Two bugs in tail toy

luckboy at vp.pl luckboy at vp.pl
Mon Oct 27 03:21:30 PDT 2014


I again write mail to you because I found two bugs in tail toy and wrote 
about these bugs to you and you didn't reply me.

These bugs:
First bug is that tail added random character to stdout end when it read 
from stdin.
Second bug is segmentation fault for 'tail -c 10' for big data from stdin.

Patch that fixes these bugs:
https://github.com/luckboy/toyroot/blob/master/patch/toybox-0.5.0-tail-n-c.patch 


You can check occurrence of first bug by invoke command in the toybox 
directory (toybox-0.5.0):

cat toys/posix/cp.c | ./toybox tail

Exemplary output:
...
00000140  69 6e 28 29 3b 0a 7d 0a  75 |in();.}.u|

Last character is 'u'!

Also, you can occurrence of second bug by invoke commands in toybox 
directory:

dd if=/dev/urandom of=test.bin bs=1024 count=8
hexdump test.bin | ./toybox tail -c 10
Segmentation fault

Łukasz Szpakowski.



More information about the Toybox mailing list