commit deb88fd0e0b7205580899dfec5f50fdd059a106d
Author: Yoann Vandoorselaere <[email protected]>
Date: Tue May 19 10:55:47 2009 +0200
Return an error when string character are provided for a 8 bit integer.
Previously, using a string as value for an IDMEF path which type was
(u)int8 would not generate an error.
========================================
src/idmef-value-type.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
========================================
diff --git a/src/idmef-value-type.c b/src/idmef-value-type.c
index 8600aad..90c7f75 100644
--- a/src/idmef-value-type.c
+++ b/src/idmef-value-type.c
@@ -121,7 +121,7 @@ static int byte_read(idmef_value_type_t *dst, const char *buf, unsigned int min,
long int tmp;
tmp = strtol(buf, &endptr, 0);
- if ( tmp < min || tmp > max )
+ if ( buf == endptr || tmp < min || tmp > max )
return prelude_error_verbose(PRELUDE_ERROR_IDMEF_VALUE_TYPE_PARSE,
"Value out of range, required: [%u-%u], got %s",
min, max, buf);
_______________________________________________
Prelude-cvslog site list
[email protected]
http://lists.prelude-ids.org/mailman/listinfo/prelude-cvslog
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.