diff options
| author | Greg Hudson <ghudson@mit.edu> | 2015-01-14 13:10:39 -0500 |
|---|---|---|
| committer | Greg Hudson <ghudson@mit.edu> | 2015-01-15 11:47:43 -0500 |
| commit | 9a343200d305e7c8df6e556d63afaee42194175f (patch) | |
| tree | f97a10a10288845fca766e729b091ca235c7fd31 | |
| parent | 57dc24093015d292189ef23313ef8ff2a81431e4 (diff) | |
| download | krb5-9a343200d305e7c8df6e556d63afaee42194175f.tar.gz krb5-9a343200d305e7c8df6e556d63afaee42194175f.tar.xz krb5-9a343200d305e7c8df6e556d63afaee42194175f.zip | |
Check for null *iter_p in profile_iterator()
In profile_iterator(), return PROF_MAGIC_ITERATOR if *iter_p is NULL,
instead of dereferencing a null pointer, as we did prior to 1.10.
Correct calling code will not trigger this case, but incorrect code
has been reported in the field.
ticket: 8059 (new)
target_version: 1.13.1
tags: pullup
| -rw-r--r-- | src/util/profile/prof_get.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/profile/prof_get.c b/src/util/profile/prof_get.c index 3eba78722..16a1762df 100644 --- a/src/util/profile/prof_get.c +++ b/src/util/profile/prof_get.c @@ -579,7 +579,7 @@ profile_iterator(void **iter_p, char **ret_name, char **ret_value) *ret_name = NULL; if (ret_value) *ret_value = NULL; - if (iter->magic != PROF_MAGIC_ITERATOR) + if (iter == NULL || iter->magic != PROF_MAGIC_ITERATOR) return PROF_MAGIC_ITERATOR; profile = iter->profile; |
