Source-Changes-HG archive

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

[src/trunk]: src/lib/libwrap remove the new check for tlen >= PTRDIFF_MAX. t...



details:   https://anonhg.NetBSD.org/src/rev/71910ef3efdc
branches:  trunk
changeset: 447823:71910ef3efdc
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Jan 24 22:07:14 2019 +0000

description:
remove the new check for tlen >= PTRDIFF_MAX.  the prior
checks assure the condition is met and GCC7 is happy.

suggested by kre.

diffstat:

 lib/libwrap/expandm.c |  11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diffs (32 lines):

diff -r d8d0e0b41d96 -r 71910ef3efdc lib/libwrap/expandm.c
--- a/lib/libwrap/expandm.c     Thu Jan 24 22:00:28 2019 +0000
+++ b/lib/libwrap/expandm.c     Thu Jan 24 22:07:14 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: expandm.c,v 1.11 2019/01/23 02:48:48 kre Exp $ */
+/*     $NetBSD: expandm.c,v 1.12 2019/01/24 22:07:14 mrg Exp $ */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: expandm.c,v 1.11 2019/01/23 02:48:48 kre Exp $");
+__RCSID("$NetBSD: expandm.c,v 1.12 2019/01/24 22:07:14 mrg Exp $");
 
 #include <limits.h>
 #include <stdio.h>
@@ -82,13 +82,6 @@
 
                        tlen = nlen + blen;
 
-                       /*
-                        * We can't exceed PTRDIFF_MAX because we would
-                        * not be able to address the pointers
-                        */
-                       if (tlen >= PTRDIFF_MAX)
-                               goto out;
-
                        nbuf = realloc(buf, tlen + 1);
                        if (nbuf == NULL)
                                goto out;



Home | Main Index | Thread Index | Old Index