[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] switch from sprintf to asprintf and snprintf
From: |
Vladimir 'φ-coder/phcoder' Serbinenko |
Subject: |
Re: [PATCH] switch from sprintf to asprintf and snprintf |
Date: |
Sun, 17 Jan 2010 13:02:16 +0100 |
User-agent: |
Mozilla-Thunderbird 2.0.0.22 (X11/20091109) |
Robert Millan wrote:
> On Tue, Dec 29, 2009 at 10:30:12AM +0100, Vladimir 'φ-coder/phcoder'
> Serbinenko wrote:
>
>> sprintf is potentially dangerous especially with gettext, when messages
>> may be larger than coder would expect. I attach the patch to fix it
>>
>
> Could you split the patches into one for asprintf and one for *nprintf? The
> asprintf one is something I'd really like to see in trunk. For the rest I'm
> not so sure.
>
Implementing sprintf on top of this would be just a waste. It would need
to add conditions to ignore size limits. IMHO unavailability of sprintf
decreases temptaion of making a 1024-bytes buffer and hoping it fits, or
at very least we don't have a memory corruption when it doesn't
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
signature.asc
Description: OpenPGP digital signature
Re: [PATCH] switch from sprintf to asprintf and snprintf, Vladimir 'φ-coder/phcoder' Serbinenko, 2010/01/17