1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

lib: Fix an array subscript is above array bounds error

gcc 5.1.1 complains with:
lib/util/idtree.c:184:15: error: array subscript is above array bounds

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Andreas Schneider 2015-11-25 12:20:23 +01:00 committed by Jeremy Allison
parent c2de8425d9
commit 87f8bddffe

View File

@ -181,8 +181,13 @@ restart:
*/
n = id;
while (p->bitmap == IDR_FULL) {
if (!(p = pa[++l]))
if (l >= MAX_LEVEL) {
break;
}
p = pa[++l];
if (p == NULL) {
break;
}
n = n >> IDR_BITS;
set_bit((n & IDR_MASK), p->bitmap);
}