How come they did not get a warning?
Posted Feb 3, 2012 12:42 UTC (Fri) by
jwakely (subscriber, #60262)
In reply to:
How come they did not get a warning? by rvfh
Parent article:
Format string vulnerabilities
Strangely enough, the sudo code wasn't doing a "hello world" toy example like the article and your one.
Try this, which is closer to the real code
#include <stdarg.h>
#include <stdio.h>
void
sudo_debug(const char* progname, const char *fmt, ...)
{
va_list ap;
char fmt2[200];
sprintf(fmt2, "%s: %s\n", progname, fmt);
va_start(ap, fmt);
vfprintf(stderr, fmt2, ap);
va_end(ap);
}
Still get a warning?
(
Log in to post comments)