public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Dominic Letz <dominic.letz@berlin.de>
Cc: libc-help@sourceware.org
Subject: Re: Remove string length check from sscanf()
Date: Thu, 04 Mar 2021 13:01:22 +0100	[thread overview]
Message-ID: <871rcvnn59.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <6d2fa0f2-457d-db67-fde1-fd7b373a0f58@berlin.de> (Dominic Letz's message of "Thu, 4 Mar 2021 12:20:03 +0100")

* Dominic Letz:

> I'm reading this source the first time, but I guess to not break
> anything I could introduce a new type of FILE* string-buffer let's say 
> in 'strops_incr.c' that is working incrementally reading one char at
> the time from the underlying string skipping the strlen()...

And maybe special-case the char-by-char check for small buffer sizes
based on the results of a strnlen call.  I agree that this should work.

Even today, applications can use fmemopen and fscanf to avoid the
overhead.

> So that brings me to my question. Is the incremental approach
> something that would get accepted when I prepare a patch? And how /
> where to submit that? (Sorry GitHub generation speaking).

You could send a patch to libc-alpha (git send-email should work).  Note
that the change will exceed the size threshold for FSF copyright
assignment, so you'll have to follow that process as well:

  Contribution Checklist: FSF copyright assignment
  <https://sourceware.org/glibc/wiki/Contribution%20checklist#FSF_copyright_assignment>

Thanks,
Florian


      reply	other threads:[~2021-03-04 12:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 11:20 Dominic Letz
2021-03-04 12:01 ` Florian Weimer [this message]

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=871rcvnn59.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=dominic.letz@berlin.de \
    --cc=libc-help@sourceware.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).