Re: possible deadlock on invalid UTF-8 data

Daniel Elstner <daniel elstner gmx net> writes: 
> Yes, but as long as the pointer is not dereferenced it should work. 
> (Although ANSI C only guarantees that moving the pointer to a position
> immediately after the last element will work, I consider failures when
> moving it six bytes after the end very rare.)

How many next_char loops don't dereference the char?
> I absolutely agree with the policy.  But if we can easily avoid an
> endless loop even in case the programmer makes an error, shouldn't we
> try to do so?

On the other hand, the advantage of the endless loop (vs. reading
invalid memory) is that the bug is immediately evident, and pretty
easy to track down.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]