libs/lmo: fix possible null pointer dereference in lmo_lookup() - thanks blogic

This commit is contained in:
Jo-Philipp Wich 2009-08-19 21:36:10 +00:00
parent 47dc4ded76
commit 68f335b8d6

View file

@ -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 )
{