mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 21:36:00 +03:00
Return false in SharedFiles::open() when an error happens
This commit is contained in:
parent
a02bd3a3b9
commit
45e531236a
@ -127,6 +127,7 @@ err_fh:
|
||||
|
||||
bool SharedFiles::open(const std::string& fileName, std::string *error) {
|
||||
std::pair<msc_file_handler *, FILE *> a;
|
||||
bool ret = true;
|
||||
|
||||
#if MODSEC_USE_GENERAL_LOCK
|
||||
pthread_mutex_lock(m_generalLock);
|
||||
@ -136,11 +137,13 @@ bool SharedFiles::open(const std::string& fileName, std::string *error) {
|
||||
if (a.first == NULL) {
|
||||
a = add_new_handler(fileName, error);
|
||||
if (error->size() > 0) {
|
||||
ret = false;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
if (a.first == NULL) {
|
||||
error->assign("Not able to open: " + fileName);
|
||||
ret = false;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -149,7 +152,7 @@ out:
|
||||
pthread_mutex_unlock(m_generalLock);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user