Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/timeout Fix overflow check. From Kamil Rytarowski.



details:   https://anonhg.NetBSD.org/src/rev/f257656eb397
branches:  trunk
changeset: 797955:f257656eb397
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Aug 05 08:20:02 2014 +0000

description:
Fix overflow check. From Kamil Rytarowski.

diffstat:

 usr.bin/timeout/timeout.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 765b25c8c97a -r f257656eb397 usr.bin/timeout/timeout.c
--- a/usr.bin/timeout/timeout.c Tue Aug 05 07:55:31 2014 +0000
+++ b/usr.bin/timeout/timeout.c Tue Aug 05 08:20:02 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: timeout.c,v 1.3 2014/08/02 09:16:22 martin Exp $ */
+/* $NetBSD: timeout.c,v 1.4 2014/08/05 08:20:02 christos Exp $ */
 
 /*-
  * Copyright (c) 2014 Baptiste Daroussin <bapt%FreeBSD.org@localhost>
@@ -32,7 +32,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/usr.bin/timeout/timeout.c 268763 2014-07-16 13:52:05Z bapt $");
 #else
-__RCSID("$NetBSD: timeout.c,v 1.3 2014/08/02 09:16:22 martin Exp $");
+__RCSID("$NetBSD: timeout.c,v 1.4 2014/08/05 08:20:02 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -130,7 +130,7 @@
 
        if (str[0] == '\0' || *ep != '\0')
                goto err;
-       if (errno == ERANGE && (sig == INT_MAX || sig == INT_MIN))
+       if (errno == ERANGE && (sig == LONG_MAX || sig == LONG_MIN))
                goto err;
        if (sig >= sys_nsig || sig < 0)
                goto err;



Home | Main Index | Thread Index | Old Index