mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Fixes a bug with an unitialized variable.
new_debug_log was unitialized during an error code path. Fixed this by explicit initializing it to NULL and fixing the order of the error labels. They now present the correct (reverse) order of the goto statements.
This commit is contained in:
committed by
Felipe Zimmerle
parent
3a048ee2db
commit
43e3ff91e8
@@ -52,7 +52,7 @@ std::pair<msc_file_handler *, FILE *> SharedFiles::add_new_handler(
|
|||||||
int shm_id;
|
int shm_id;
|
||||||
int ret;
|
int ret;
|
||||||
key_t mem_key_structure;
|
key_t mem_key_structure;
|
||||||
msc_file_handler_t *new_debug_log;
|
msc_file_handler_t *new_debug_log = NULL;
|
||||||
struct shmid_ds shared_mem_info;
|
struct shmid_ds shared_mem_info;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
bool toBeCreated = true;
|
bool toBeCreated = true;
|
||||||
@@ -113,10 +113,10 @@ std::pair<msc_file_handler *, FILE *> SharedFiles::add_new_handler(
|
|||||||
std::make_pair(new_debug_log, fp)));
|
std::make_pair(new_debug_log, fp)));
|
||||||
|
|
||||||
return std::make_pair(new_debug_log, fp);
|
return std::make_pair(new_debug_log, fp);
|
||||||
err_shmget1:
|
|
||||||
err_shmctl1:
|
|
||||||
err_shmat1:
|
err_shmat1:
|
||||||
shmdt(new_debug_log);
|
shmdt(new_debug_log);
|
||||||
|
err_shmctl1:
|
||||||
|
err_shmget1:
|
||||||
err_mem_key:
|
err_mem_key:
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
err_fh:
|
err_fh:
|
||||||
|
Reference in New Issue
Block a user