[Bug 9556] New: glob() in ash is overused

bugzilla at busybox.net bugzilla at busybox.net
Thu Jan 5 00:57:09 UTC 2017


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

            Bug ID: 9556
           Summary: glob() in ash is overused
           Product: Busybox
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: przemoc at gmail.com
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

In http://lists.busybox.net/pipermail/busybox/2017-January/085055.html Denys
wrote: "Okay, so by now that usage of glob() in ash uncovered glob() bugs in
both uclibc and musl.", but due to musl's inability to handle patterns longer
than PATH_MAX (which is 4096 in musl), other kind of bug has been uncovered in
busybox's ash itself.

glob() in ash is overused.  Example:

   $ busybox ash -c 'X=$(printf "%*s" 4096 "*"); echo "$X"'

I don't think there is any legitimate reason to call glob() here during echo,
yet it is called (and fails in current musl version, leading to GLOB_NOSPACE
and ash's "out of memory" error).

(Initially reported on #busybox freenode IRC channel two days ago.)

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


More information about the busybox-cvs mailing list