[Bug 5876] New: Format string bug in procps/ps.c for non-Linux builds

bugzilla at busybox.net bugzilla at busybox.net
Mon Jan 21 23:47:41 UTC 2013


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

           Summary: Format string bug in procps/ps.c for non-Linux builds
           Product: Busybox
           Version: unspecified
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: minor
          Priority: P5
         Component: Other
        AssignedTo: unassigned at busybox.net
        ReportedBy: matthias.andree at gmx.de
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.5


Compiling this on FreeBSD yields:

  CC      procps/ps.o
procps/ps.c: In function 'get_uptime':
procps/ps.c:86: warning: conversion lacks type at end of format
procps/ps.c:86: warning: too many arguments for format

and indeed the format string is "%l" (ell) - this was probably meant to be
"%li", "%ld", "%lx", or "%lo" - please fix.


This would affect versions 1.20.2 and 1.21.0, and I have not checked older
versions.

It does not matter much because FreeBSD does not have /proc/uptime, so the
function errors out before reaching the bug.  On FreeBSD you get the uptime
like this (see src/usr.bin/w/w.c):

 struct timespec tp;
 if (-1 != clock_gettime(CLOCK_MONOTONIC, &tp)) {
   /* process tp here */
 }

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list