mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Fixed: SDBM deadlock
This commit is contained in:
@@ -490,7 +490,12 @@ int collection_store(modsec_rec *msr, apr_table_t *col) {
|
|||||||
/* Now generate the binary object. */
|
/* Now generate the binary object. */
|
||||||
blob = apr_pcalloc(msr->mp, blob_size);
|
blob = apr_pcalloc(msr->mp, blob_size);
|
||||||
if (blob == NULL) {
|
if (blob == NULL) {
|
||||||
goto error;
|
if (dbm != NULL) {
|
||||||
|
apr_sdbm_unlock(dbm);
|
||||||
|
apr_sdbm_close(dbm);
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
blob[0] = 0x49;
|
blob[0] = 0x49;
|
||||||
@@ -543,9 +548,15 @@ int collection_store(modsec_rec *msr, apr_table_t *col) {
|
|||||||
if (rc != APR_SUCCESS) {
|
if (rc != APR_SUCCESS) {
|
||||||
msr_log(msr, 1, "collection_store: Failed to write to DBM file \"%s\": %s", dbm_filename,
|
msr_log(msr, 1, "collection_store: Failed to write to DBM file \"%s\": %s", dbm_filename,
|
||||||
get_apr_error(msr->mp, rc));
|
get_apr_error(msr->mp, rc));
|
||||||
goto error;
|
if (dbm != NULL) {
|
||||||
|
apr_sdbm_unlock(dbm);
|
||||||
|
apr_sdbm_close(dbm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
apr_sdbm_unlock(dbm);
|
||||||
apr_sdbm_close(dbm);
|
apr_sdbm_close(dbm);
|
||||||
|
|
||||||
if (msr->txcfg->debuglog_level >= 4) {
|
if (msr->txcfg->debuglog_level >= 4) {
|
||||||
@@ -557,11 +568,6 @@ int collection_store(modsec_rec *msr, apr_table_t *col) {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
|
||||||
if (dbm) {
|
|
||||||
apr_sdbm_close(dbm);
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user