summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authormmcc <mmcc@cvs.openbsd.org>2015-11-07 21:58:06 +0000
committermmcc <mmcc@cvs.openbsd.org>2015-11-07 21:58:06 +0000
commitbf3b02d3b1560256e1d878e870aaacd3a5cd0ca4 (patch)
tree833b82932938f42277254a65d2a2bd93a00e97ab /usr.sbin
parentdeae871343abd4c0f5eb217748c70f1f0f52e194 (diff)
Ensure the safety of isprint()'s argument. Suggested by guenther@ a few
weeks ago.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/tcpdump/print-decnet.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/print-decnet.c b/usr.sbin/tcpdump/print-decnet.c
index fc60d53f63f..ae3a856de6f 100644
--- a/usr.sbin/tcpdump/print-decnet.c
+++ b/usr.sbin/tcpdump/print-decnet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-decnet.c,v 1.15 2015/10/24 16:32:52 sthen Exp $ */
+/* $OpenBSD: print-decnet.c,v 1.16 2015/11/07 21:58:05 mmcc Exp $ */
/*
* Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997
@@ -888,11 +888,11 @@ dnname_string(u_short dnaddr)
static void
pdata(u_char *dp, u_int maxlen)
{
- char c;
+ int c;
u_int x = maxlen;
while (x-- > 0) {
- c = *dp++;
+ c = (unsigned char)*dp++;
if (isprint(c))
putchar(c);
else