[PATCH] libstdc++: Fix infinite loop in std::istream::ignore(n, delim) [PR93672]

Ulrich Drepper drepper.fsp@gmail.com
Thu Apr 4 16:28:43 GMT 2024


On Thu, Apr 4, 2024 at 5:29 PM Jonathan Wakely <jwakely@redhat.com> wrote:
> I would appreciate more eyes on this to confirm my conclusions about
> negative int_type values, and the proposed fix, make sense.

The way something like this is handled in glibc's ctype functions is
that both branches are considered.  For isXXX(c) whether c is -v or
256-v the same value is returned (except for EOF which is -1).  This
caused the least number of bad surprises.

You could here also perform similar actions.


More information about the Libstdc++ mailing list