Commit c5074939 authored by Rusty Russell's avatar Rusty Russell

idtree: fix overflow for v. large ids on allocation and removal

Chris Cowan tracked down a SEGV in sub_alloc: idp->level can actually
be equal to 7 (MAX_LEVEL) there, as it can be in sub_remove.
parent 9ad912e2
......@@ -99,7 +99,7 @@ static int sub_alloc(struct idtree *idp, const void *ptr, int *starting_id)
{
int n, m, sh;
struct idtree_layer *p, *pn;
struct idtree_layer *pa[MAX_LEVEL];
struct idtree_layer *pa[MAX_LEVEL+1];
unsigned int l, id, oid;
uint32_t bm;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment