Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/syslogd CID 1132759: Abort on dehumanize_number err...



details:   https://anonhg.NetBSD.org/src/rev/a3884e4763ea
branches:  trunk
changeset: 791671:a3884e4763ea
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Nov 27 20:48:28 2013 +0000

description:
CID 1132759: Abort on dehumanize_number error on constant built-in string.

diffstat:

 usr.sbin/syslogd/syslogd.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r 16991eedca0d -r a3884e4763ea usr.sbin/syslogd/syslogd.c
--- a/usr.sbin/syslogd/syslogd.c        Wed Nov 27 20:45:33 2013 +0000
+++ b/usr.sbin/syslogd/syslogd.c        Wed Nov 27 20:48:28 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: syslogd.c,v 1.118 2013/11/11 16:39:21 christos Exp $   */
+/*     $NetBSD: syslogd.c,v 1.119 2013/11/27 20:48:28 christos Exp $   */
 
 /*
  * Copyright (c) 1983, 1988, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)syslogd.c  8.3 (Berkeley) 4/4/94";
 #else
-__RCSID("$NetBSD: syslogd.c,v 1.118 2013/11/11 16:39:21 christos Exp $");
+__RCSID("$NetBSD: syslogd.c,v 1.119 2013/11/27 20:48:28 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -3207,13 +3207,15 @@
                if (!TypeInfo[i].queue_length_string
                    || dehumanize_number(TypeInfo[i].queue_length_string,
                    &TypeInfo[i].queue_length) == -1)
-                       dehumanize_number(TypeInfo[i].default_length_string,
-                                         &TypeInfo[i].queue_length);
+                       if (dehumanize_number(TypeInfo[i].default_length_string,
+                           &TypeInfo[i].queue_length) == -1)
+                               abort();
                if (!TypeInfo[i].queue_size_string
                    || dehumanize_number(TypeInfo[i].queue_size_string,
                    &TypeInfo[i].queue_size) == -1)
-                       dehumanize_number(TypeInfo[i].default_size_string,
-                                         &TypeInfo[i].queue_size);
+                       if (dehumanize_number(TypeInfo[i].default_size_string,
+                           &TypeInfo[i].queue_size) == -1)
+                               abort();
        }
 
 #ifndef DISABLE_SIGN



Home | Main Index | Thread Index | Old Index