cut: transforms 0x00 to 0x0a and incorrect length

ValdikSS iam at valdikss.org.ru
Thu Jun 15 20:34:42 UTC 2023


Hi there,

Just sending the bug to the mail list in case it got lost in the bug 
tracker.

Cut utility incorrectly replaces null-byte (0x00) with \n (0x0a).

Tested with Busybox 1.36.0 and Busybox 1.20.0 ("Busybox in VM" link on 
the website).

Busybox:
$ echo -ne "\x00\x01\x02\x03\x04\x05\x06" | ./busybox cut -b 1-3 | 
hexdump -C
00000000  0a 01 02 03 0a                                    |.....|
00000005

GNU coreutils:
$ echo -ne "\x00\x01\x02\x03\x04\x05\x06" | cut -b 1-3 | hexdump -C
00000000  00 01 02 0a                                       |....|
00000004

https://bugs.busybox.net/show_bug.cgi?id=15276
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20230615/fdfa9956/attachment-0001.asc>


More information about the busybox mailing list