Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/net use sizeof, avoid duplicated use of MAXDNAME



details:   https://anonhg.NetBSD.org/src/rev/9ab8b4339af5
branches:  trunk
changeset: 535372:9ab8b4339af5
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri Aug 16 13:59:39 2002 +0000

description:
use sizeof, avoid duplicated use of MAXDNAME

diffstat:

 lib/libc/net/res_query.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r d31d34fda92c -r 9ab8b4339af5 lib/libc/net/res_query.c
--- a/lib/libc/net/res_query.c  Fri Aug 16 12:23:20 2002 +0000
+++ b/lib/libc/net/res_query.c  Fri Aug 16 13:59:39 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: res_query.c,v 1.35 2002/08/16 11:53:19 itojun Exp $    */
+/*     $NetBSD: res_query.c,v 1.36 2002/08/16 13:59:39 itojun Exp $    */
 
 /*-
  * Copyright (c) 1988, 1993
@@ -59,7 +59,7 @@
 static char sccsid[] = "@(#)res_query.c        8.1 (Berkeley) 6/4/93";
 static char rcsid[] = "Id: res_query.c,v 8.10 1997/06/01 20:34:37 vixie Exp ";
 #else
-__RCSID("$NetBSD: res_query.c,v 1.35 2002/08/16 11:53:19 itojun Exp $");
+__RCSID("$NetBSD: res_query.c,v 1.36 2002/08/16 13:59:39 itojun Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -362,7 +362,7 @@
                 * copy without '.' if present.
                 */
                n = strlen(name);
-               if (n >= MAXDNAME) {
+               if (n + 1 > sizeof(nbuf)) {
                        h_errno = NO_RECOVERY;
                        return (-1);
                }



Home | Main Index | Thread Index | Old Index