adding safeguard; if the structure is healthy this should never happen

IPS-2
Volker Birk 2 years ago
parent 7c6b80d774
commit 9f761a04ba

@ -523,6 +523,11 @@ bloblist_t *BlobList_to_bloblist(
bloblist_t *r = result;
for (int i=0; i<list->list.count; i++) {
// this should not happen
assert(list->list.array[i]);
if (!list->list.array[i])
goto enomem;
if (list->list.array[i]->value.size > rest_blob_size)
goto enomem;
rest_blob_size -= list->list.array[i]->value.size;

Loading…
Cancel
Save