]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/bytetest: don't print errors at runtime
authorVictor Julien <victor@inliniac.net>
Fri, 25 Jan 2019 10:48:50 +0000 (11:48 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 16 Feb 2019 13:58:18 +0000 (14:58 +0100)
src/detect-bytetest.c
src/util-byte.c

index 8ca14e66b38854410733b6ed8056001b8522a8b0..407ef06a00a083afd870c93545e258cb045fb513 100644 (file)
@@ -157,7 +157,7 @@ int DetectBytetestDoMatch(DetectEngineThreadCtx *det_ctx,
                 SCLogDebug("No Numeric value");
                 SCReturnInt(0);
             } else {
-                SCLogError(SC_ERR_INVALID_NUM_BYTES, "Error extracting %d "
+                SCLogDebug("error extracting %d "
                         "bytes of string data: %d", data->nbytes, extbytes);
                 SCReturnInt(-1);
             }
@@ -171,8 +171,8 @@ int DetectBytetestDoMatch(DetectEngineThreadCtx *det_ctx,
                           BYTE_LITTLE_ENDIAN : BYTE_BIG_ENDIAN;
         extbytes = ByteExtractUint64(&val, endianness, data->nbytes, ptr);
         if (extbytes != data->nbytes) {
-            SCLogError(SC_ERR_INVALID_NUM_BYTES, "Error extracting %d bytes "
-                   "of numeric data: %d\n", data->nbytes, extbytes);
+            SCLogDebug("error extracting %d bytes "
+                   "of numeric data: %d", data->nbytes, extbytes);
             SCReturnInt(-1);
         }
 
index 30a5fdbbbca7709e3dff6f7bbf6c0eb749ba2af7..81efe1973cc33c8b88adf2e3395e590840bad8d5 100644 (file)
@@ -149,7 +149,7 @@ int ByteExtractString(uint64_t *res, int base, uint16_t len, const char *str)
     char strbuf[24];
 
     if (len > 23) {
-        SCLogError(SC_ERR_ARG_LEN_LONG, "len too large (23 max)");
+        SCLogDebug("len too large (23 max)");
         return -1;
     }
 
@@ -164,15 +164,15 @@ int ByteExtractString(uint64_t *res, int base, uint16_t len, const char *str)
     *res = strtoull(ptr, &endptr, base);
 
     if (errno == ERANGE) {
-        SCLogError(SC_ERR_NUMERIC_VALUE_ERANGE, "Numeric value out of range");
+        SCLogDebug("numeric value out of range");
         return -1;
         /* If there is no numeric value in the given string then strtoull(), makes
         endptr equals to ptr and return 0 as result */
     } else if (endptr == ptr && *res == 0) {
-        SCLogDebug("No numeric value");
+        SCLogDebug("no numeric value");
         return -1;
     } else if (endptr == ptr) {
-        SCLogError(SC_ERR_INVALID_NUMERIC_VALUE, "Invalid numeric value");
+        SCLogDebug("invalid numeric value");
         return -1;
     }
     /* This will interfere with some rules that do not know the length