Incorrect code detected in project uClibc by SaveSources.com

Rob Landley rob at landley.net
Sat Nov 22 10:04:27 UTC 2008


On Friday 21 November 2008 10:06:39 gdm at savesources.com wrote:
> Hello uClibc group,
>
> We sent you this letter because your project uClibc has been scanned by
> SaveSources research team and we found a piece of code that looks
> incorrect.

Research team?  Or automated tool?  Because a human might have noticed that:

> 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.

> This letter is not spam.

That phrase does not help messages stay _out_ of spam filters.

Rob



More information about the uClibc mailing list