diff options
author | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2009-04-27 16:32:00 -0400 |
---|---|---|
committer | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2009-04-27 16:32:00 -0400 |
commit | 33f0a1eccb17a79368a80c40ee2bd53b34c44adc (patch) | |
tree | 5c553e763391cdbf4112ad70f42a4c8db5897376 | |
parent | d96208324e2bb67dcd65d90a88c38e59c6895a52 (diff) | |
download | slapi-nis-33f0a1eccb17a79368a80c40ee2bd53b34c44adc.tar.gz slapi-nis-33f0a1eccb17a79368a80c40ee2bd53b34c44adc.tar.xz slapi-nis-33f0a1eccb17a79368a80c40ee2bd53b34c44adc.zip |
- fix some crashes by dereferencing uninitialized pointers when
retrieving information from a map fails
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/map.c | 26 |
2 files changed, 27 insertions, 0 deletions
@@ -1,3 +1,4 @@ +0.11 * Fix a crash while reading NIS maps with no entries. 0.10 * IPv6 support for the NIS server plugin. * Make the NIS server reject client requests which are too big. * Make the NIS defaults use recursive attribute functions. @@ -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; |