diff --git a/xs/src/boost/nowide/cenv.hpp b/xs/src/boost/nowide/cenv.hpp index 5f6d084af..5b41b8e8d 100755 --- a/xs/src/boost/nowide/cenv.hpp +++ b/xs/src/boost/nowide/cenv.hpp @@ -99,9 +99,11 @@ namespace nowide { /// inline int putenv(char *string) { + if (string == nullptr) return -1; char const *key = string; char const *key_end = string; - while(*key_end!='=' && key_end!='\0') + + while(*key_end!='=' && *key_end!='\0') key_end++; if(*key_end == '\0') return -1;