bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glibc's snprintf is a pig; fix or replace ?


From: Pádraig Brady
Subject: Re: glibc's snprintf is a pig; fix or replace ?
Date: Wed, 03 Nov 2010 09:59:04 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 03/11/10 09:13, Jim Meyering wrote:
> glibc's snprintf is next-to-useless in an application that must accept
> arbitrary inputs and/or arbitrary format strings, and that cannot afford
> to allocate 2GiB of heap.
> 
> Did you know that glibc's snprintf can fail due to ENOMEM?  Your reaction
> to that possibility should be disbelief.  But it's true.  Why does
> snprintf allocate space from the heap for a format string like "%*d"?
> I reported it as http://bugzilla.redhat.com/441945, but amazingly
> enough, it was closed "NOTABUG".  The justification was that the POSIX
> specification permits the current senseless behavior.  The letter of the
> spec may permit it, but the spirit must not, so if indeed POSIX allows
> the current behavior, the spec should be adjusted.

Well heap allocation is blatantly silly/lazy/dangerous.
Has that always been the case? It's been the case for long
enough that a replacement is warranted I suppose.
Will we eventually replace all of glibc as it accretes bugs over time :(

It's a pity that bug is closed.
What's the process for appealing this?
I notice no voting feature for example.

cheers,
Pádraig.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]