summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin.dahyabhai@pobox.com>2009-04-27 16:32:00 -0400
committerNalin Dahyabhai <nalin.dahyabhai@pobox.com>2009-04-27 16:32:00 -0400
commit33f0a1eccb17a79368a80c40ee2bd53b34c44adc (patch)
tree5c553e763391cdbf4112ad70f42a4c8db5897376 /src
parentd96208324e2bb67dcd65d90a88c38e59c6895a52 (diff)
- fix some crashes by dereferencing uninitialized pointers when
retrieving information from a map fails
Diffstat (limited to 'src')
-rw-r--r--src/map.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/map.c b/src/map.c
index c5f0e5f..c86aa1b 100644
--- a/src/map.c
+++ b/src/map.c
@@ -436,6 +436,10 @@ map_match(struct plugin_state *state,
struct map *map;
struct map_entry *entry;
unsigned int key_index;
+ *value_len = 0;
+ *value = NULL;
+ *id = NULL;
+ *backend_data = NULL;
map = map_data_find_map(state, domain_name, map_name);
if (map == NULL) {
return FALSE;
@@ -465,6 +469,12 @@ map_match_id(struct plugin_state *state,
{
struct map *map;
struct map_entry *entry;
+ *key_len = 0;
+ *key = NULL;
+ *value_len = 0;
+ *value = NULL;
+ *id = NULL;
+ *backend_data = NULL;
map = map_data_find_map(state, domain_name, map_name);
if (map == NULL) {
return FALSE;
@@ -503,6 +513,12 @@ map_first(struct plugin_state *state,
{
struct map *map;
struct map_entry *entry;
+ *first_key_len = 0;
+ *first_key = NULL;
+ *first_value_len = 0;
+ *first_value = NULL;
+ *first_id = NULL;
+ *first_key_index = 0;
map = map_data_find_map(state, domain_name, map_name);
if (map == NULL) {
return FALSE;
@@ -534,6 +550,10 @@ map_next(struct plugin_state *state,
struct map *map;
struct map_entry *entry;
unsigned int key_index;
+ *next_key_len = 0;
+ *next_key = NULL;
+ *next_value_len = 0;
+ *next_value = NULL;
map = map_data_find_map(state, domain_name, map_name);
if (map == NULL) {
return FALSE;
@@ -570,6 +590,12 @@ map_next_id(struct plugin_state *state,
{
struct map *map;
struct map_entry *entry;
+ *next_key_len = 0;
+ *next_key = NULL;
+ *next_value_len = 0;
+ *next_value = NULL;
+ *next_id = NULL;
+ *next_key_index = 0;
map = map_data_find_map(state, domain_name, map_name);
if (map == NULL) {
return FALSE;