Re: [dev] [sic]: patches for string handling

From: Anselm R Garbe <anselm_AT_garbe.us>
Date: Wed, 23 Sep 2009 14:41:23 +0100

Hi,

2009/9/23 Kris Maglione <maglione.k_AT_gmail.com>:
> On Wed, Sep 23, 2009 at 12:53:35AM +0200, Mark Edgar wrote:
>>
>> * Fix buffer overrun when using strncpy()
>
> It's really sad to see code using strncpy.

Well strncpy has performance issues on large buffers since it pads the
remainder with null bytes. I agree that it would be better to use
something else, though I don't like your util.c strlcpy solution
because that's calling strncpy as well and does some superflous
double-termination that seems to be unnecessary to me.

I applied both sic.c and util.c temporarily to sic/kris/, I need to
sort out what I'm going to re-use and what not. The state when you
patched sic.c seems to be quite old though... or your patch was quite
big ;)

> I'll take this opportunity to re-submit my ages-old modifications of sic
> (which push the line count to 251). Incidentally, what's with all of the
> (void) casts of function calls lately? Have we really resorted to that level
> of GNU-style hair brained pedantry?

Well apparently they push the line count to 296, but nevermind I agree
these ugly (void) casts have been removed in hg tip.
I was too quick when I applied the last patch provided by Martin.

Kind regards,
Anselm
Received on Wed Sep 23 2009 - 13:41:23 UTC

This archive was generated by hypermail 2.2.0 : Wed Sep 23 2009 - 13:48:02 UTC