summaryrefslogtreecommitdiff
path: root/libexec/identd
diff options
context:
space:
mode:
authorMike Pechkin <mpech@cvs.openbsd.org>2002-11-25 11:08:19 +0000
committerMike Pechkin <mpech@cvs.openbsd.org>2002-11-25 11:08:19 +0000
commita1b6d42f11bf4e0181762a6c592758f11de17525 (patch)
tree7b942a031fd3966a66518dd6d204f7edff746099 /libexec/identd
parent6b0aea411db8688a421614752d2c739b66241824 (diff)
Missing check around snprintf().
millert@ ok
Diffstat (limited to 'libexec/identd')
-rw-r--r--libexec/identd/parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/identd/parse.c b/libexec/identd/parse.c
index c9ab00fa59d..f205cc05d52 100644
--- a/libexec/identd/parse.c
+++ b/libexec/identd/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.35 2002/09/13 01:31:39 djm Exp $ */
+/* $OpenBSD: parse.c,v 1.36 2002/11/25 11:08:18 mpech Exp $ */
/*
* This program is in the public domain and may be used freely by anyone
@@ -534,7 +534,7 @@ parse6(int fd, struct sockaddr_in6 *laddr, struct sockaddr_in6 *faddr)
if ((n = snprintf(buf, sizeof(buf),
"%d , %d : USERID : %s%s%s :%s\r\n", lport, fport,
opsys_name, charset_sep, charset_name, token))
- >= sizeof(buf))
+ >= sizeof(buf) || n < 0)
n = strlen(buf);
if (timed_write(fd, buf, n, IO_TIMEOUT) != n && syslog_flag) {
syslog(LOG_NOTICE, "write to %s: %m", gethost6(faddr));