Re: [PATCH] kernel32: GetPrivateProfileSectionNamesA error checking (Coverity)

2010-01-06 Thread Dan Kegel
On Wed, Jan 6, 2010 at 7:21 AM, Alexandre Julliard wrote: > Crashing is the best behavior. Adding parameter checks all over the > place only hides bugs. I keep forgetting that crashing is good sometimes :-)

Re: [PATCH] kernel32: GetPrivateProfileSectionNamesA error checking (Coverity)

2010-01-06 Thread Alexandre Julliard
Dan Kegel writes: > AJ wrote: >> Marcus Meissner writes: >>> buffer and size need to be either 0 at the same time or not, >>> otherwise this breaks up. Windows is inconsistent (either crashes >>> or returns invalids), so we can just add checking. >> >>If Windows crashes we don't need extra check

Re: [PATCH] kernel32: GetPrivateProfileSectionNamesA error checking (Coverity)

2010-01-06 Thread Paul Vriens
On 01/06/2010 04:03 PM, Dan Kegel wrote: AJ wrote: Marcus Meissner writes: buffer and size need to be either 0 at the same time or not, otherwise this breaks up. Windows is inconsistent (either crashes or returns invalids), so we can just add checking. If Windows crashes we don't need extra

re: [PATCH] kernel32: GetPrivateProfileSectionNamesA error checking (Coverity)

2010-01-06 Thread Dan Kegel
AJ wrote: > Marcus Meissner writes: >> buffer and size need to be either 0 at the same time or not, >> otherwise this breaks up. Windows is inconsistent (either crashes >> or returns invalids), so we can just add checking. > >If Windows crashes we don't need extra checks. Just tell Coverity that >

Re: [PATCH] kernel32: GetPrivateProfileSectionNamesA error checking (Coverity)

2010-01-06 Thread Paul Vriens
On 01/06/2010 01:59 PM, Marcus Meissner wrote: diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c index e3f7156..8e64e73 100644 --- a/dlls/kernel32/tests/profile.c +++ b/dlls/kernel32/tests/profile.c @@ -266,6 +266,10 @@ static void test_profile_sections_names(void)

Re: [PATCH] kernel32: GetPrivateProfileSectionNamesA error checking (Coverity)

2010-01-06 Thread Paul Vriens
On 01/06/2010 01:59 PM, Marcus Meissner wrote: diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c index e3f7156..8e64e73 100644 --- a/dlls/kernel32/tests/profile.c +++ b/dlls/kernel32/tests/profile.c @@ -266,6 +266,10 @@ static void test_profile_sections_names(void)

Re: [PATCH] kernel32: GetPrivateProfileSectionNamesA error checking (Coverity)

2010-01-06 Thread Marcus Meissner
On Wed, Jan 06, 2010 at 01:34:28PM +0100, Alexandre Julliard wrote: > Marcus Meissner writes: > > > buffer and size need to be either 0 at the same time or not, > > otherwise this breaks up. Windows is inconsistent (either crashes > > or returns invalids), so we can just add checking. > > If Win

Re: [PATCH] kernel32: GetPrivateProfileSectionNamesA error checking (Coverity)

2010-01-06 Thread Alexandre Julliard
Marcus Meissner writes: > buffer and size need to be either 0 at the same time or not, > otherwise this breaks up. Windows is inconsistent (either crashes > or returns invalids), so we can just add checking. If Windows crashes we don't need extra checks. Just tell Coverity that crashing is allow

Re: [PATCH] kernel32: GetPrivateProfileSectionNamesA error checking (Coverity)

2010-01-06 Thread Paul Vriens
On 01/06/2010 01:26 PM, Marcus Meissner wrote: +if (!RtlCreateUnicodeStringFromAsciiz(&filenameW, filename)) { +SetLastError(ERROR_OUTOFMEMORY); +return 0; +} Aren't you leaking bufferW here? -- Cheers, Paul.