[Bug 12296] New: pidof fails to find tasks with names 15 characters long

bugzilla at busybox.net bugzilla at busybox.net
Wed Oct 30 12:17:40 UTC 2019


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

            Bug ID: 12296
           Summary: pidof fails to find tasks with names 15 characters
                    long
           Product: Busybox
           Version: 1.31.x
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: alin.nastac at gmail.com
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

Created attachment 8276
  --> https://bugs.busybox.net/attachment.cgi?id=8276&action=edit
find_pid_by_name() fix

find_pid_by_name() first compare procName with p->comm and returns true when
they're matched, but only when both following conditions are met:
  strncmp(p->comm, procName, 15) == 0
  strlen(p->comm) <= 14

However when strlen(p->comm) is 15, this function will compare procName with
p->argv0 and return false when p->argv0 is NULL.

When argv0 support is not compiled in, find_pid_by_name() should assume that
p->comm name has not been truncated.

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


More information about the busybox-cvs mailing list