summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormoritz <moritz@openbsd.org>2005-04-28 10:14:26 +0000
committermoritz <moritz@openbsd.org>2005-04-28 10:14:26 +0000
commitc30c8cb00a71f57392ff68622b9c04e0f3885d51 (patch)
tree46861e9db064f36e8a3c0298053f9e650c8baf66
parentmore vsnprintf checking. ok cloder@ (diff)
downloadwireguard-openbsd-c30c8cb00a71f57392ff68622b9c04e0f3885d51.tar.xz
wireguard-openbsd-c30c8cb00a71f57392ff68622b9c04e0f3885d51.zip
add vsnprintf error checking. ok cloder@ millert@
-rw-r--r--usr.sbin/lpr/lpd/printjob.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c
index 012400b2ff4..1a9c3221023 100644
--- a/usr.sbin/lpr/lpd/printjob.c
+++ b/usr.sbin/lpr/lpd/printjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printjob.c,v 1.39 2004/04/14 20:52:20 millert Exp $ */
+/* $OpenBSD: printjob.c,v 1.40 2005/04/28 10:14:26 moritz Exp $ */
/* $NetBSD: printjob.c,v 1.31 2002/01/21 14:42:30 wiz Exp $ */
/*
@@ -1637,6 +1637,8 @@ pstatus(const char *msg, ...)
ftruncate(fd, 0);
len = vsnprintf(buf, sizeof(buf), msg, ap);
va_end(ap);
+ if (len == -1)
+ return;
if (len >= sizeof(buf))
len = sizeof(buf) - 1;
buf[len++] = '\n'; /* replace NUL with newline */