X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fantithread%2Falloc%2Ftiny.c;h=d84974ee02cd3ce0f4c967c239e30e6b466f3241;hp=ffd17c65734f881f1ca355ed9e1a5b705dd3ff46;hb=1d14555d3a4501adae909884bcb8f8a0b142c89c;hpb=07dec048cb950abeb82c1447e523a2d22404b42a diff --git a/ccan/antithread/alloc/tiny.c b/ccan/antithread/alloc/tiny.c index ffd17c65..d84974ee 100644 --- a/ccan/antithread/alloc/tiny.c +++ b/ccan/antithread/alloc/tiny.c @@ -353,7 +353,8 @@ bool tiny_alloc_check(void *pool, unsigned long poolsize) unsigned long arrsize = free_array_size(poolsize); unsigned char *arr = pool; unsigned long len, off, hdrlen; - unsigned long i, freearr[arrsize], num_freearr = 0; + /* Don't have sanitizer complain here if arrsize is 0! */ + unsigned long i, freearr[arrsize ? arrsize : 1], num_freearr = 0; bool free; if (poolsize < MIN_BLOCK_SIZE)