From: Shivani Bhardwaj Date: Wed, 18 Dec 2019 08:21:08 +0000 (+0530) Subject: Use appropriate ByteExtractString* functions X-Git-Tag: suricata-6.0.0-beta1~588 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c4c734541aed7dcf2d2fb7ebeeb503d39761159d;p=thirdparty%2Fsuricata.git Use appropriate ByteExtractString* functions --- diff --git a/src/detect-tos.c b/src/detect-tos.c index 0fd5d3c72a..06c638f4cf 100644 --- a/src/detect-tos.c +++ b/src/detect-tos.c @@ -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; } diff --git a/src/tests/fuzz/fuzz_applayerparserparse.c b/src/tests/fuzz/fuzz_applayerparserparse.c index bbd3d0fc1b..ebf33a0602 100644 --- a/src/tests/fuzz/fuzz_applayerparserparse.c +++ b/src/tests/fuzz/fuzz_applayerparserparse.c @@ -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"); }