Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/common/lib/libprop Now that _PROP_ISSPACE does not include t...
details: https://anonhg.NetBSD.org/src/rev/78bd83c0dc07
branches: trunk
changeset: 338147:78bd83c0dc07
user: christos <christos%NetBSD.org@localhost>
date: Tue May 12 14:59:35 2015 +0000
description:
Now that _PROP_ISSPACE does not include the EOF check, put the check for
EOF inside the loop. Also fix another unbounded loop that did not check for
EOF. From Mateusz Kocielski
XXX: pullup-7
diffstat:
common/lib/libprop/prop_object.c | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diffs (54 lines):
diff -r 1f6cacc8f9e1 -r 78bd83c0dc07 common/lib/libprop/prop_object.c
--- a/common/lib/libprop/prop_object.c Tue May 12 14:05:29 2015 +0000
+++ b/common/lib/libprop/prop_object.c Tue May 12 14:59:35 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prop_object.c,v 1.29 2013/10/18 18:26:20 martin Exp $ */
+/* $NetBSD: prop_object.c,v 1.30 2015/05/12 14:59:35 christos Exp $ */
/*-
* Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -416,10 +416,11 @@
ctx->poic_tagname = cp;
- while (!_PROP_ISSPACE(*cp) && *cp != '/' && *cp != '>')
+ while (!_PROP_ISSPACE(*cp) && *cp != '/' && *cp != '>') {
+ if (_PROP_EOF(*cp))
+ return (false);
cp++;
- if (_PROP_EOF(*cp))
- return (false);
+ }
ctx->poic_tagname_len = cp - ctx->poic_tagname;
@@ -462,10 +463,11 @@
ctx->poic_tagattr = cp;
- while (!_PROP_ISSPACE(*cp) && *cp != '=')
+ while (!_PROP_ISSPACE(*cp) && *cp != '=') {
+ if (_PROP_EOF(*cp))
+ return (false);
cp++;
- if (_PROP_EOF(*cp))
- return (false);
+ }
ctx->poic_tagattr_len = cp - ctx->poic_tagattr;
@@ -477,10 +479,11 @@
return (false);
ctx->poic_tagattrval = cp;
- while (*cp != '\"')
+ while (*cp != '\"') {
+ if (_PROP_EOF(*cp))
+ return (false);
cp++;
- if (_PROP_EOF(*cp))
- return (false);
+ }
ctx->poic_tagattrval_len = cp - ctx->poic_tagattrval;
cp++;
Home |
Main Index |
Thread Index |
Old Index