From: reyk Date: Fri, 18 Jul 2008 12:26:52 +0000 (+0000) Subject: terminate the input buffer on failure in print_host() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=47a88e5dc91c523d4ffebf282f3bd26718c628f2;p=openbsd terminate the input buffer on failure in print_host() --- diff --git a/usr.sbin/relayd/log.c b/usr.sbin/relayd/log.c index e9cd8cf202b..b5cf7e80cfc 100644 --- a/usr.sbin/relayd/log.c +++ b/usr.sbin/relayd/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.12 2008/07/17 15:10:14 reyk Exp $ */ +/* $OpenBSD: log.c,v 1.13 2008/07/18 12:26:52 reyk Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -220,8 +220,10 @@ const char * print_host(struct sockaddr_storage *ss, char *buf, size_t len) { if (getnameinfo((struct sockaddr *)ss, ss->ss_len, - buf, len, NULL, 0, NI_NUMERICHOST) != 0) + buf, len, NULL, 0, NI_NUMERICHOST) != 0) { + buf[0] = '\0'; return (NULL); + } return (buf); }