Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 13 Jul 2011 14:57:21 +0200
From: Luka Marčetić <paxcoder@...il.com>
To: musl@...ts.openwall.com
Subject: Re: cluts review

On 07/13/2011 02:21 PM, Solar Designer wrote:
> Luka,
>
> On Wed, Jul 13, 2011 at 02:02:44PM +0200, Luka Mar??eti?? wrote:
>> Hmm, hope you won't mind me saying: Diff output for multiple files
>> replacing 1-2 non-subsequent lines is not very readable.
> I don't mind, but I also don't understand what you're trying to say.

I guess I like doing things manually. But thanks for the patch. Anyway, 
here:
https://github.com/lmarcetic/cluts/commit/7c836ff779c1f9ffecdae9f7d469772e88d3bc68
(note also that cluts.c should now return correct nr. of failed tests, 
that would've been a valid critique)

>> Instead of<sys/param.h>
>> for PATH_MAX, will limits.h do (that's what i usually include)?
> No, it doesn't get PATH_MAX defined for me.

Strange, SUSv4 (which is really the std I'm testing for compliance 
against) says it should be there. I'm surprised you don't have any 
issues with SUS-specific functions. So, do you want me to replace limits 
with param.h?

> What you could actually want to do is get rid of the dependency on
> PATH_MAX and FILENAME_MAX.  The system does not guarantee that actual
> pathnames fit in PATH_MAX anyway.  So you may want to replace those
> strcat()'s with dynamic memory allocation or add a check for potential
> buffer overflow there (then report the error and skip the test).

Ah, wherever I do this, I think the path isn't big anyway (cluts.c and 
buf.c). I'll keep it in mind if there's ever a chance they might be. Agreed?

> For dynamic memory allocation, you may use asprintf(3), but it is not
> very portable, or you may use my concat() function:

Thanks, I didn't even know about that one!

> http://openwall.info/wiki/people/solar/software/public-domain-source-code/concat
>
> (put it in a common source file).

I already have my sreturnf function for such purposes (right now it uses 
vsnprintf). Why do you think *snprintf and *asprintf aren't portable?

Luka.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.