Re: [PATCH 13/14] git-compat-util.h: fix integer overflow on IL32P64 systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 08, 2014 at 01:02:10PM -0700, Junio C Hamano wrote:
> Junio C Hamano <gitster@xxxxxxxxx> writes:
> 
> > Marat Radchenko <marat@xxxxxxxxxxxxxxxx> writes:
> >
> >> Signed-off-by: Marat Radchenko <marat@xxxxxxxxxxxxxxxx>
> >> ---
> >>  git-compat-util.h | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/git-compat-util.h b/git-compat-util.h
> >> index b338277..101c9d7 100644
> >> --- a/git-compat-util.h
> >> +++ b/git-compat-util.h
> >> @@ -474,7 +474,7 @@ extern int git_munmap(void *start, size_t length);
> >>  #endif
> >>  
> >>  #define DEFAULT_PACKED_GIT_LIMIT \
> >> -	((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
> >> +	((size_t)(1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
> >
> > 1024 * 1024 * 8192 overflows 32-bit unsigned, but is size_t always
> > large enough?  Just checking.
> 
> Heh, I was being silly.  This gives the default value for a variable
> whose type is size_t, so it would better fit.  So please throw 13 in
> the list of changes I found sensible in the other message.

Is it an Acked-by?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]