diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-08-19 21:36:10 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-08-19 21:36:10 +0000 |
commit | 68f335b8d6e3f96c0e35d2b2021d5995e0f536e7 (patch) | |
tree | bfd7a4df2b6db57416fe4614ab819bb11534e131 /libs | |
parent | 47dc4ded767f863f03279bc099d28ba0f0661c2a (diff) |
libs/lmo: fix possible null pointer dereference in lmo_lookup() - thanks blogic
Diffstat (limited to 'libs')
-rw-r--r-- | libs/lmo/src/lmo_core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/lmo/src/lmo_core.c b/libs/lmo/src/lmo_core.c index 17467f21e6..ab2410f462 100644 --- a/libs/lmo/src/lmo_core.c +++ b/libs/lmo/src/lmo_core.c @@ -207,8 +207,12 @@ int lmo_lookup(lmo_archive_t *ar, const char *key, char *dest, int len) { uint32_t look_key = sfh_hash(key, strlen(key)); int copy_len = -1; + lmo_entry_t *entry; - lmo_entry_t *entry = ar->index; + if( !ar ) + return copy_len; + + entry = ar->index; while( entry != NULL ) { |