From: Junio C Hamano Date: Wed, 08 Oct 2014 20:02:10 GMT Subject: Re: [PATCH 13/14] git-compat-util.h: fix integer overflow on IL32P64 systems Message-ID: In-Reply-To: Junio C Hamano writes: > Marat Radchenko writes: > >> Signed-off-by: Marat Radchenko >> --- >> 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. Thanks. -- -- *** Please reply-to-all at all times *** *** (do not pretend to know who is subscribed and who is not) *** *** Please avoid top-posting. *** The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free. You received this message because you are subscribed to the Google Groups "msysGit" group. To post to this group, send email to msysgit@googlegroups.com To unsubscribe from this group, send email to msysgit+unsubscribe@googlegroups.com For more options, and view previous threads, visit this group at http://groups.google.com/group/msysgit?hl=en_US?hl=en --- You received this message because you are subscribed to the Google Groups "Git for Windows" group. To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.