Remove string length check from sscanf()
Florian Weimer
fweimer@redhat.com
Thu Mar 4 12:01:22 GMT 2021
* 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
More information about the Libc-help
mailing list