mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-01 12:07:46 +03:00
Merge pull request #3228 from eduar-hte/asctime-multithread
Replace usage of std::ctime, which is not safe in multithread contexts
This commit is contained in:
@@ -65,12 +65,12 @@ MultipartPartTmpFile::~MultipartPartTmpFile() {
|
||||
}
|
||||
|
||||
void MultipartPartTmpFile::Open() {
|
||||
struct tm timeinfo;
|
||||
time_t tt = time(NULL);
|
||||
time_t tt = time(nullptr);
|
||||
|
||||
struct tm timeinfo;
|
||||
localtime_r(&tt, &timeinfo);
|
||||
|
||||
char tstr[17];
|
||||
char tstr[std::size("/yyyymmdd-hhmmss")];
|
||||
strftime(tstr, std::size(tstr), "/%Y%m%d-%H%M%S", &timeinfo);
|
||||
|
||||
std::string path = m_transaction->m_rules->m_uploadDirectory.m_value;
|
||||
|
Reference in New Issue
Block a user