idtree: fix overflow for v. large ids on allocation and removal
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 6 Dec 2010 03:22:38 +0000 (13:52 +1030)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 7 Dec 2010 04:37:25 +0000 (15:37 +1100)
commit73764104356d3738d9d20a9d06ce51535f74f475
treee4081741a46f4f5220b28894033003f14ebe2dec
parenta8cc35191df1cd4b866897df71d317ce5f198cb5
idtree: fix overflow for v. large ids on allocation and removal

(Imported from SAMBA commit 09a6538969ac).

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.

(We unfairly blamed a shift of a signed var for this crash in commit
 2db1987f5a3a).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lib/util/idtree.c