diff --git a/Source/bmalloc/bmalloc/Mutex.cpp b/Source/bmalloc/bmalloc/Mutex.cpp index 82d4ac9e4d16..639991c0fa98 100644 --- a/Source/bmalloc/bmalloc/Mutex.cpp +++ b/Source/bmalloc/bmalloc/Mutex.cpp @@ -31,6 +31,7 @@ #include #include #endif +#include #include #include @@ -46,7 +47,8 @@ static inline void yield() static std::once_flag onceFlag; std::call_once(onceFlag, [] { const char* env = getenv("WEBKIT_WPE_BMALLOC_MICROSECONDS_SLEEP"); - if (env) { + const auto envLen = strlen(env); + if (env && envLen <= 5 && env[envLen] == '\0') { int value; if (sscanf(env, "%d", &value) == 1 && value > 0) bmallocMicrosecondsSleep = value;