Implement proper bounds checks across the codebase (#681)

* Implement proper bounds checks across the codebase

* Implement strnlen_s for cross platform
This commit is contained in:
Jett
2022-07-27 02:52:04 +01:00
committed by GitHub
parent 9813c3ed2c
commit 9e08bb20d2
3 changed files with 18 additions and 8 deletions

View File

@@ -26,6 +26,13 @@ dLogger::~dLogger() {
}
void dLogger::vLog(const char* format, va_list args) {
const char* tempPtr = format; // strlen_s implementation for Linux and Windows
for (; *tempPtr != '\0'; ++tempPtr) {
size_t size = tempPtr - format;
if (size > 600) {
return;
}
}
#ifdef _WIN32
time_t t = time(NULL);
struct tm time;