[Bug 12926] New: embedded "wc" command has overflow issues

bugzilla at busybox.net bugzilla at busybox.net
Wed May 20 11:47:38 UTC 2020


https://bugs.busybox.net/show_bug.cgi?id=12926

            Bug ID: 12926
           Summary: embedded "wc" command has overflow issues
           Product: Busybox
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: benjamin.bauer at kps.com
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

We use BusyBox within Alpine Linux 3.10 in a docker container.
Today we found out, that the "wc" utility is counting wrong above a certain
size.
It looks to me like a overflow issue.


Example on Ubuntu Linux (ok):
# 1000 Byte (ok)
cat /dev/zero | pv --stop-at-size -s 1000 | wc -c
>> 1000

# 4 Gib (ok)
cat /dev/zero | pv --stop-at-size -s 4294967296 | wc -c
>> 4294967296


Example on Busybox (overflow at ~4 Gib):

#  4 Gib minus 1 Byte (ok)
cat /dev/zero | pv --stop-at-size -s 4294967295 | wc -c
>> 4294967295

# 4 Gib (overflow)
cat /dev/zero | pv --stop-at-size -s 4294967296 | wc -c
>> 0

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list