From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: segfault on sscanf
Date: Thu, 14 Mar 2019 19:38:12 +0100 [thread overview]
Message-ID: <20190314183812.GK28106@voyager> (raw)
In-Reply-To: <20190314181919.GJ26605@port70.net>
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
next prev parent reply other threads:[~2019-03-14 18:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-14 9:46 Marian Buschsieweke
2019-03-14 12:44 ` A. Wilcox
2019-03-14 13:29 ` Szabolcs Nagy
2019-03-14 14:34 ` Pascal Cuoq
2019-03-14 16:28 ` Markus Wichmann
2019-03-14 16:53 ` Markus Wichmann
2019-03-14 18:19 ` Szabolcs Nagy
2019-03-14 18:38 ` Markus Wichmann [this message]
2019-03-14 19:49 ` Szabolcs Nagy
2019-03-14 20:15 ` Szabolcs Nagy
2019-03-14 22:34 ` Rich Felker
2019-03-14 22:43 ` Szabolcs Nagy
2019-03-14 22:52 ` Rich Felker
2019-03-15 1:54 ` Rich Felker
2019-03-14 22:40 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190314183812.GK28106@voyager \
--to=nullplan@gmx.net \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).