Branch: Tag:

2015-09-18

2015-09-18 11:43:30 by Henrik Grubbström (Grubba) <grubba@grubba.org>

ADT.Heap: Fixed NULL-deref.

Fixes "Indexing the NULL value with "value".".

128:    if (objectp(value) && value->is_adt_heap_element) {    pos = value->pos;    } else { -  pos = search(values->value, value); +  pos = search(values && values->value, value);    }    Element ret;    if(pos>=0) {
198:    if (objectp(value) && value->is_adt_heap_element) {    pos = value->pos;    } else { -  pos = search(values->value, value); +  pos = search(values && values->value, value);    }    if ((pos < 0) || (pos >= num_values)) return;