Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

va_start/end audit.

From: Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>
  • Loading branch information...
commit b56abb6acb12d5348368af8298f272bffb73e79b 1 parent e1e0811
itojun authored
Showing with 11 additions and 8 deletions.
  1. +8 −5 kame/kame/racoon/plog.c
  2. +3 −3 kame/kame/route6d/route6d.c
View
13 kame/kame/racoon/plog.c
@@ -1,4 +1,4 @@
-/* $KAME: plog.c,v 1.18 2001/08/20 06:46:28 itojun Exp $ */
+/* $KAME: plog.c,v 1.19 2001/09/23 12:40:32 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -130,13 +130,16 @@ plog(int pri, const char *func, struct sockaddr *sa, const char *fmt, ...)
newfmt = plog_common(pri, fmt, func);
- va_start(ap, fmt);
- if (f_foreground)
+ if (f_foreground) {
+ va_start(ap, fmt);
vprintf(newfmt, ap);
+ va_end(ap);
+ }
- if (logfile)
+ va_start(ap, fmt);
+ if (logfile) {
log_vaprint(logp, newfmt, ap);
- else {
+ } else {
if (pri < ARRAYLEN(ptab))
vsyslog(ptab[pri].priority, newfmt, ap);
else
View
6 kame/kame/route6d/route6d.c
@@ -1,4 +1,4 @@
-/* $KAME: route6d.c,v 1.73 2001/09/05 01:12:34 itojun Exp $ */
+/* $KAME: route6d.c,v 1.74 2001/09/23 12:40:33 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -30,7 +30,7 @@
*/
#ifndef lint
-static char _rcsid[] = "$KAME: route6d.c,v 1.73 2001/09/05 01:12:34 itojun Exp $";
+static char _rcsid[] = "$KAME: route6d.c,v 1.74 2001/09/23 12:40:33 itojun Exp $";
#endif
#include <stdio.h>
@@ -3332,10 +3332,10 @@ fatal(fmt, va_alist)
va_start(ap);
#endif
vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
perror(buf);
syslog(LOG_ERR, "%s: %s", buf, strerror(errno));
rtdexit();
- va_end(ap);
}
void
Please sign in to comment.
Something went wrong with that request. Please try again.