From d6f76b4a7b0c6d14dd5e3b0a0be2ec62edff7397 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Wed, 12 Jan 2011 15:30:40 +0000 Subject: [PATCH] Fix off by one in ether_aton_r(). Noticed by "arp info overwritten" warning. (how could it be missed for months?) --- sys/net/if_ethersubr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 6e53ce297cec..e470e30b8688 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ethersubr.c,v 1.184 2010/11/17 00:20:49 dyoung Exp $ */ +/* $NetBSD: if_ethersubr.c,v 1.185 2011/01/12 15:30:40 tsutsui Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.184 2010/11/17 00:20:49 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.185 2011/01/12 15:30:40 tsutsui Exp $"); #include "opt_inet.h" #include "opt_atalk.h" @@ -1250,7 +1250,7 @@ ether_aton_r(u_char *dest, size_t len, const char *str) const u_char *cp = (const void *)str; u_char *ep; -#define atox(c) (((c) < '9') ? ((c) - '0') : ((toupper(c) - 'A') + 10)) +#define atox(c) (((c) <= '9') ? ((c) - '0') : ((toupper(c) - 'A') + 10)) if (len < ETHER_ADDR_LEN) return ENOSPC;