From fd9f64d00f95f619cfe81257501fc0c9dd6ea205 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 9 Apr 2019 12:22:21 +0200 Subject: [PATCH] byte: suppress errors in byte extraction utils --- src/util-byte.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/util-byte.c b/src/util-byte.c index db33a4ba5d..a57fecaf27 100644 --- a/src/util-byte.c +++ b/src/util-byte.c @@ -244,9 +244,8 @@ int ByteExtractStringUint64(uint64_t *res, int base, uint16_t len, const char *s int ByteExtractStringUint32(uint32_t *res, int base, uint16_t len, const char *str) { uint64_t i64; - int ret; - ret = ByteExtractString(&i64, base, len, str); + int ret = ByteExtractString(&i64, base, len, str); if (ret <= 0) { return ret; } @@ -254,8 +253,8 @@ int ByteExtractStringUint32(uint32_t *res, int base, uint16_t len, const char *s *res = (uint32_t)i64; if ((uint64_t)(*res) != i64) { - SCLogError(SC_ERR_NUMERIC_VALUE_ERANGE, "Numeric value out of range " - "(%" PRIu64 " > %" PRIuMAX ")", i64, (uintmax_t)UINT_MAX); + SCLogDebug("Numeric value out of range (%" PRIu64 " > %" PRIuMAX ")", + i64, (uintmax_t)UINT_MAX); return -1; } @@ -265,9 +264,8 @@ int ByteExtractStringUint32(uint32_t *res, int base, uint16_t len, const char *s int ByteExtractStringUint16(uint16_t *res, int base, uint16_t len, const char *str) { uint64_t i64; - int ret; - ret = ByteExtractString(&i64, base, len, str); + int ret = ByteExtractString(&i64, base, len, str); if (ret <= 0) { return ret; } @@ -275,8 +273,8 @@ int ByteExtractStringUint16(uint16_t *res, int base, uint16_t len, const char *s *res = (uint16_t)i64; if ((uint64_t)(*res) != i64) { - SCLogError(SC_ERR_NUMERIC_VALUE_ERANGE, "Numeric value out of range " - "(%" PRIu64 " > %" PRIuMAX ")", i64, (uintmax_t)USHRT_MAX); + SCLogDebug("Numeric value out of range (%" PRIu64 " > %" PRIuMAX ")", + i64, (uintmax_t)USHRT_MAX); return -1; } @@ -286,9 +284,8 @@ int ByteExtractStringUint16(uint16_t *res, int base, uint16_t len, const char *s int ByteExtractStringUint8(uint8_t *res, int base, uint16_t len, const char *str) { uint64_t i64; - int ret; - ret = ByteExtractString(&i64, base, len, str); + int ret = ByteExtractString(&i64, base, len, str); if (ret <= 0) { return ret; } @@ -296,8 +293,8 @@ int ByteExtractStringUint8(uint8_t *res, int base, uint16_t len, const char *str *res = (uint8_t)i64; if ((uint64_t)(*res) != i64) { - SCLogError(SC_ERR_NUMERIC_VALUE_ERANGE, "Numeric value out of range " - "(%" PRIu64 " > %" PRIuMAX ")", i64, (uintmax_t)UCHAR_MAX); + SCLogDebug("Numeric value out of range (%" PRIu64 " > %" PRIuMAX ")", + i64, (uintmax_t)UCHAR_MAX); return -1; }