Use appropriate ByteExtractString* functions

pull/4739/head
Shivani Bhardwaj 5 years ago
parent 6b2c7d5be8
commit c4c734541a

@ -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;
}

@ -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");
}

Loading…
Cancel
Save