artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
665769d
)
Print_host is used mainly in printf style functions. So do not return NULL
author
claudio
<claudio@openbsd.org>
Wed, 29 Nov 2017 01:25:11 +0000
(
01:25
+0000)
committer
claudio
<claudio@openbsd.org>
Wed, 29 Nov 2017 01:25:11 +0000
(
01:25
+0000)
instead return "unknown".
OK beck@
sbin/iked/util.c
patch
|
blob
|
history
diff --git
a/sbin/iked/util.c
b/sbin/iked/util.c
index
5f232a3
..
1d4cee2
100644
(file)
--- a/
sbin/iked/util.c
+++ b/
sbin/iked/util.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: util.c,v 1.3
3 2017/01/09 14:49:21 reyk Exp $
*/
+/* $OpenBSD: util.c,v 1.3
4 2017/11/29 01:25:11 claudio Exp $
*/
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@
-654,8
+654,8
@@
print_host(struct sockaddr *sa, char *buf, size_t len)
if (getnameinfo(sa, sa->sa_len,
buf, len, NULL, 0, NI_NUMERICHOST) != 0) {
-
buf[0] = '\0'
;
- return (
NULL
);
+
strlcpy(buf, "unknown", len)
;
+ return (
buf
);
}
if ((port = socket_getport(sa)) != 0) {