This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] signal-safe fprintf?


On Thu, Mar 7, 2013 at 10:53 AM, Siddhesh Poyarekar
<siddhesh.poyarekar@gmail.com> wrote:
> On 7 March 2013 22:39, Andrew Hunter <ahh@google.com> wrote:
>> This is true, but as pointed out downthread snprintf is (I think) not
>> vulnerable to this, though I could be misinterpreting how the
>> fake-files work.
>
> Not snprintf, but the rest of *printf would be vulnerable to this,
> i.e. anything that doesn't do fake-files.  snprintf will have another
> problem.  Since the fake-files are different, there would be
> corruption of output since the read/write pointers in the buffers
> within the fake-files will not be synced.  It will most likely only
> lead to jumbled up output though, not anything serious.
>

I'm sorry, I don't follow you--snprintf creates a single use fake file
that's only written to by the single call to vfprintf.  How does that
break?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]