aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-09-30 09:49:43 +0200
committerdec05eba <dec05eba@protonmail.com>2020-09-30 09:49:43 +0200
commit228e5f935b4f6d08b159c81fdfa10c63332036bf (patch)
tree5d09250eed9d47ab6fc02ca3e46f223593762488 /src
parentca778b3190e502efd3ee6b04105707b4aa1456fd (diff)
Fix out-of-bounds read when using --sanitize arg instead of --sanitize=
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp4
1 files 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) {