[hackers] [sbase] Check argv0 in xvprintf() || FRIGN
commit e40fc2b17676145087f62e66940d8aceccb793b5
Author: FRIGN <dev_AT_frign.de>
AuthorDate: Mon Dec 21 13:57:10 2015 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Mon Dec 21 14:13:36 2015 +0000
Check argv0 in xvprintf()
You never know, given printf'ing NULL-strings might crash the
program, we shouldn't just pass argv0 blindly to it.
diff --git a/libutil/eprintf.c b/libutil/eprintf.c
index 6230c66..673523e 100644
--- a/libutil/eprintf.c
+++ b/libutil/eprintf.c
_AT_@ -47,7 +47,7 @@ weprintf(const char *fmt, ...)
void
xvprintf(const char *fmt, va_list ap)
{
- if (strncmp(fmt, "usage", strlen("usage")))
+ if (argv0 && strncmp(fmt, "usage", strlen("usage")))
fprintf(stderr, "%s: ", argv0);
vfprintf(stderr, fmt, ap);
Received on Mon Dec 21 2015 - 15:13:41 CET
This archive was generated by hypermail 2.3.0
: Mon Dec 21 2015 - 15:24:12 CET