mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
Many null pointer checks
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
static apr_table_t *collection_unpack(modsec_rec *msr, const unsigned char *blob, unsigned int blob_size,
|
||||
int log_vars)
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(blob != NULL);
|
||||
apr_table_t *col = NULL;
|
||||
unsigned int blob_offset;
|
||||
|
||||
@@ -90,6 +92,8 @@ static apr_table_t *collection_unpack(modsec_rec *msr, const unsigned char *blob
|
||||
static apr_table_t *collection_retrieve_ex(apr_sdbm_t *existing_dbm, modsec_rec *msr, const char *col_name,
|
||||
const char *col_key, int col_key_len)
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(col_name != NULL);
|
||||
char *dbm_filename = NULL;
|
||||
apr_status_t rc;
|
||||
apr_sdbm_datum_t key;
|
||||
@@ -346,6 +350,7 @@ cleanup:
|
||||
apr_table_t *collection_retrieve(modsec_rec *msr, const char *col_name,
|
||||
const char *col_key, int col_key_len)
|
||||
{
|
||||
assert(msr != NULL);
|
||||
apr_time_t time_before = apr_time_now();
|
||||
apr_table_t *rtable = NULL;
|
||||
|
||||
@@ -360,6 +365,7 @@ apr_table_t *collection_retrieve(modsec_rec *msr, const char *col_name,
|
||||
*
|
||||
*/
|
||||
int collection_store(modsec_rec *msr, apr_table_t *col) {
|
||||
assert(msr != NULL);
|
||||
char *dbm_filename = NULL;
|
||||
msc_string *var_name = NULL, *var_key = NULL;
|
||||
unsigned char *blob = NULL;
|
||||
@@ -647,6 +653,8 @@ error:
|
||||
*
|
||||
*/
|
||||
int collections_remove_stale(modsec_rec *msr, const char *col_name) {
|
||||
assert(msr != NULL);
|
||||
assert(col_name != NULL);
|
||||
char *dbm_filename = NULL;
|
||||
apr_sdbm_datum_t key, value;
|
||||
apr_sdbm_t *dbm = NULL;
|
||||
|
Reference in New Issue
Block a user