diff options
author | Mike Pechkin <mpech@cvs.openbsd.org> | 2002-11-25 11:08:19 +0000 |
---|---|---|
committer | Mike Pechkin <mpech@cvs.openbsd.org> | 2002-11-25 11:08:19 +0000 |
commit | a1b6d42f11bf4e0181762a6c592758f11de17525 (patch) | |
tree | 7b942a031fd3966a66518dd6d204f7edff746099 | |
parent | 6b0aea411db8688a421614752d2c739b66241824 (diff) |
Missing check around snprintf().
millert@ ok
-rw-r--r-- | libexec/identd/parse.c | 4 |
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)); |