From 228e5f935b4f6d08b159c81fdfa10c63332036bf Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 30 Sep 2020 09:49:43 +0200 Subject: Fix out-of-bounds read when using --sanitize arg instead of --sanitize= --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0cb55e5..0a70d36 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -491,7 +491,7 @@ static int buildProject(int argc, const _tinydir_char_t **argv) } optimizationLevel = OPT_LEV_RELEASE; } - else if(_tinydir_strncmp(arg, TINYDIR_STRING("--sanitize="), 10) == 0) + else if(_tinydir_strncmp(arg, TINYDIR_STRING("--sanitize="), 11) == 0) { sanitize = sanitize_string_to_type(arg + 11); if(sanitize == SANITIZE_INVALID) { @@ -609,7 +609,7 @@ static int testProject(int argc, const _tinydir_char_t **argv) for(int i = 0; i < argc; ++i) { const _tinydir_char_t *arg = argv[i]; - if(_tinydir_strncmp(arg, TINYDIR_STRING("--sanitize="), 10) == 0) + if(_tinydir_strncmp(arg, TINYDIR_STRING("--sanitize="), 11) == 0) { sanitize = sanitize_string_to_type(arg + 11); if(sanitize == SANITIZE_INVALID) { -- cgit v1.2.3