]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Use appropriate ByteExtractString* functions
authorShivani Bhardwaj <shivanib134@gmail.com>
Wed, 18 Dec 2019 08:21:08 +0000 (13:51 +0530)
committerShivani Bhardwaj <shivanib134@gmail.com>
Fri, 27 Mar 2020 21:44:51 +0000 (03:14 +0530)
src/detect-tos.c
src/tests/fuzz/fuzz_applayerparserparse.c

index 0fd5d3c72a7fa8e7e53f12f208f01dde54e7b3d1..06c638f4cfa6a6707864954748555b9aa6a4052a 100644 (file)
@@ -130,12 +130,12 @@ static DetectTosData *DetectTosParse(const char *arg, bool negate)
     int64_t tos = 0;
 
     if (tosbytes_str[0] == 'x' || tosbytes_str[0] == 'X') {
-        int r = ByteExtractStringSigned(&tos, 16, 0, &tosbytes_str[1]);
+        int r = ByteExtractStringInt64(&tos, 16, 0, &tosbytes_str[1]);
         if (r < 0) {
             goto error;
         }
     } else {
-        int r = ByteExtractStringSigned(&tos, 10, 0, &tosbytes_str[0]);
+        int r = ByteExtractStringInt64(&tos, 10, 0, &tosbytes_str[0]);
         if (r < 0) {
             goto error;
         }
index bbd3d0fc1b03436b89dbcd4f85363470e1347cca..ebf33a0602e313e49ec73582e020a7561e12c65b 100644 (file)
@@ -63,7 +63,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
         alp_tctx = AppLayerParserThreadCtxAlloc();
         const char* forceLayerStr = getenv("FUZZ_APPLAYER");
         if (forceLayerStr) {
-            if (ByteExtractString(&forceLayer, 10, 0, forceLayerStr) < 0) {
+            if (ByteExtractStringUint64(&forceLayer, 10, 0, forceLayerStr) < 0) {
                 forceLayer = 0;
                 printf("Invalid numeric value for FUZZ_APPLAYER environment variable");
             }