Incorrect code detected in project uClibc by SaveSources.com
Dmytro Gorbunov
gdm at savesources.com
Sat Nov 22 11:41:10 UTC 2008
Hi, Rob
Rob Landley wrote:
> Research team? Or automated tool? Because a human might have noticed that:
>
>
Team that use automated tool, half-automatically.
>> Project: uClibc
>> Repository: svn://uclibc.org/trunk/uClibc/...@24106
>>
>> File: uClibc/test/string/tester.c:
>> 1319: equal(one, "axxxefgh", 2); /* Basic test. */
>> 1320:
>> 1321: (void) memset(one+2, 'y', 0);
>> 1322: equal(one, "axxxefgh", 3); /* Zero-length set. */
>>
>>
>> Reason: Zero length as a 3rd argument has no sense for memset function. It
>> may happen order of 2nd and 3rd parameters are wrong.
>>
>
> It's in the uClibc test suite, and the comment explicitly says we're testing a
> zero length set. So I'd guess we know we're doing this, we're making sure the
> library behaves when explicitly asked to do something stupid.
>
>
You are right, sorry.
So, as I understand we check that memset doesn't threat 0-byte size as
1-byte size. Hm..
But as for me for test suite better memset(NULL, 'y', 0), but anyway you
are right, I shouldn't report about this code.
>> This letter is not spam.
>>
>
> That phrase does not help messages stay _out_ of spam filters.
>
>
This phrase intended to me for humans
I will remove it from my template.
> Rob
>
Thank you,
Dmtyro Gorbunov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/uclibc/attachments/20081122/60b5bbba/attachment-0002.htm
More information about the uClibc
mailing list