From: Denis Vlasenko Date: Tue, 5 Aug 2008 21:12:00 +0000 (-0000) Subject: libbb: fix thinko in latest xrealloc_vector change X-Git-Tag: 1_12_0~33 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=db29f5e73e1c44e9f30aa6e78c9eee159b901892;p=oweals%2Fbusybox.git libbb: fix thinko in latest xrealloc_vector change --- diff --git a/libbb/xrealloc_vector.c b/libbb/xrealloc_vector.c index 342ae536e..43c34b720 100644 --- a/libbb/xrealloc_vector.c +++ b/libbb/xrealloc_vector.c @@ -39,7 +39,7 @@ void* FAST_FUNC xrealloc_vector_helper(void *vector, unsigned sizeof_and_shift, if (!(idx & (mask - 1))) { sizeof_and_shift >>= 8; /* sizeof(vector[0]) */ vector = xrealloc(vector, sizeof_and_shift * (idx + mask + 1)); - vector += idx; + vector = (char*)vector + (sizeof_and_shift * idx); memset(vector, 0, sizeof_and_shift * (mask + 1)); } return vector;