Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Format string vulnerability found in 'sudo'. Parent comment
The bug is when getprogname() also returns a string containing a format specifier (e.g. "%s"), which is not expected.
Clearly the fix is:
fprintf(stderr, "%s: ", getprogname()); va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, "\n");
There are no comments on this comment yet.
The bug is when getprogname() also returns a string containing a format specifier (e.g. "%s"), which is not expected.
Clearly the fix is:
(Edit for formatting, clarity)