diff --git a/binding.gyp b/binding.gyp index 8967ab36..1cfe38ff 100644 --- a/binding.gyp +++ b/binding.gyp @@ -23,13 +23,14 @@ "VCCLCompilerTool": { "AdditionalOptions": [ "/guard:cf", - "/w34244", - "/we4267", + "/sdl", + "/W3", "/ZH:SHA_256" ] }, "VCLinkerTool": { "AdditionalOptions": [ + "/DYNAMICBASE", "/guard:cf" ] } diff --git a/src/statement.h b/src/statement.h index 94e93d2a..f58b50ae 100644 --- a/src/statement.h +++ b/src/statement.h @@ -52,7 +52,9 @@ namespace Values { template inline Blob(T _name, size_t len, const void* val) : Field(_name, SQLITE_BLOB), length(len) { value = (char*)malloc(len); - memcpy(value, val, len); + if (value) { + memcpy(value, val, len); + } } inline ~Blob() { free(value);