Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-19 Thread Junio C Hamano
Duy Nguyen writes: > Anyway it does not put strbuf_slopbuf in .rodata. That's sad. I wa hoping that it would behave the same as this, which does give me SEGV: #include static const char x = '\0'; static char *y = (char *)&x; int main (void) { *y = 1; } -- To unsubscribe from this li

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-19 Thread Duy Nguyen
On Fri, Jun 19, 2015 at 5:50 PM, Remi Galan Alfonso wrote: > Duy Nguyen writes: > >> + sb.buf[0] = 'Z'; >> + printf("%c\n", strbuf_slopbuf[0]); >> + return 0; >> startup_info = &git_startup_info; > > I might be wrong, but I definitely think that this > printf and return 0 are some debug lines tha

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-19 Thread Remi Galan Alfonso
Duy Nguyen writes: > + sb.buf[0] = 'Z'; > + printf("%c\n", strbuf_slopbuf[0]); > + return 0; > startup_info = &git_startup_info; I might be wrong, but I definitely think that this printf and return 0 are some debug lines that you forgot to remove. Rémi -- To unsubscribe from this list: send th

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-19 Thread Duy Nguyen
On Thu, Jun 18, 2015 at 09:46:09AM -0700, Junio C Hamano wrote: > Duy Nguyen writes: > > > The last resort is simply filter out a whole class of warnings. > > Probably good enough if both patches look equally ugly. > > > > -- 8< -- > > Subject: [PATCH] strbuf: kill strbuf_slopbuf, in favor of ""

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-18 Thread Junio C Hamano
Duy Nguyen writes: > The last resort is simply filter out a whole class of warnings. > Probably good enough if both patches look equally ugly. > > -- 8< -- > Subject: [PATCH] strbuf: kill strbuf_slopbuf, in favor of "" > > A lot of "out-of-bound access" warnings on scan.coverity.com is because >

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-18 Thread Duy Nguyen
On Wed, Jun 17, 2015 at 03:12:35PM -0400, Jeff King wrote: > On Wed, Jun 17, 2015 at 10:58:10AM -0700, Stefan Beller wrote: > > > > Just make strbuf_slopbuf[] large enough to keep Coverity happy. If it's > > > happy, we'll have cleaner defect list > > > > It's down 31 defects, roughly 10% of all

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Stefan Beller
On Wed, Jun 17, 2015 at 12:25 PM, Junio C Hamano wrote: > Stefan Beller writes: > >>> Just make strbuf_slopbuf[] large enough to keep Coverity happy. If it's >>> happy, we'll have cleaner defect list >> >> It's down 31 defects, roughly 10% of all things coverity detected as >> problematic. >> YAY

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Stefan Beller
On Wed, Jun 17, 2015 at 12:12 PM, Jeff King wrote: > On Wed, Jun 17, 2015 at 10:58:10AM -0700, Stefan Beller wrote: > >> > Just make strbuf_slopbuf[] large enough to keep Coverity happy. If it's >> > happy, we'll have cleaner defect list >> >> It's down 31 defects, roughly 10% of all things coveri

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Junio C Hamano
Stefan Beller writes: >> Just make strbuf_slopbuf[] large enough to keep Coverity happy. If it's >> happy, we'll have cleaner defect list > > It's down 31 defects, roughly 10% of all things coverity detected as > problematic. > YAY! I actually think this is too ugly to live. If coverity is bugg

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Jeff King
On Wed, Jun 17, 2015 at 10:58:10AM -0700, Stefan Beller wrote: > > Just make strbuf_slopbuf[] large enough to keep Coverity happy. If it's > > happy, we'll have cleaner defect list > > It's down 31 defects, roughly 10% of all things coverity detected as > problematic. > YAY! That's a good thing.

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Stefan Beller
> Just make strbuf_slopbuf[] large enough to keep Coverity happy. If it's > happy, we'll have cleaner defect list It's down 31 defects, roughly 10% of all things coverity detected as problematic. YAY! -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to maj

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Stefan Beller
On Wed, Jun 17, 2015 at 3:16 AM, Nguyễn Thái Ngọc Duy wrote: > It usually goes like this > > strbuf sb = STRBUF_INIT; > if (!strncmp(sb.buf, "foo", 3)) >printf("%s", sb.buf + 3); > > Coverity thinks that printf() can be executed, and because initial > sb.buf only has one character

[PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Nguyễn Thái Ngọc Duy
It usually goes like this strbuf sb = STRBUF_INIT; if (!strncmp(sb.buf, "foo", 3)) printf("%s", sb.buf + 3); Coverity thinks that printf() can be executed, and because initial sb.buf only has one character (from strbuf_slopbuf), sb.buf + 3 is out of bound. What it does not recogniz