News for hackers. Stuff that matters.
Re:Format string vulnerability found in 'sudo' by Karellen on Monday January 30, 2012 @05:10PM (#3530849)
"fmt2" is supposed to contain a format string. It's supposed to contain the format string from "fmt". That's how it prints the args from "ap".

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");
(Edit for formatting, clarity)

There are no comments on this comment yet.