Re: possible deadlock on invalid UTF-8 data
- From: Havoc Pennington <hp redhat com>
- To: Daniel Elstner <daniel elstner gmx net>
- Cc: gtk-devel-list <gtk-devel-list gnome org>
- Subject: Re: possible deadlock on invalid UTF-8 data
- Date: 27 Nov 2001 15:54:26 -0500
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.
] [Thread Prev