Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 14 Mar 2019 19:38:12 +0100
From: Markus Wichmann <nullplan@....net>
To: musl@...ts.openwall.com
Subject: Re: segfault on sscanf

On Thu, Mar 14, 2019 at 07:19:19PM +0100, Szabolcs Nagy wrote:
> i think __shgetc should ensure f->rpos == f->shend on EOF

What about shunget(), though? Currently, if shgetc() returns EOF, at the
very least shunget() will not try to back off from EOF, which I think
was the intent of setting f->shend to 0.

You also can't make shunget() not do anything if f->rpos == f->shend
because then there is no difference between trying to unget an EOF and
trying to unget the last character of a file (you can't tell if f->rpos
== f->shend was already true before the last shgetc()).

Ciao,
Markus

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.