[Lazarus] FindInvalidUTF8Character hanging linux hard?
Mattias Gaertner
nc-gaertnma at netcologne.de
Sat Nov 7 14:11:27 CET 2009
On Fri, 06 Nov 2009 15:16:52 +0100
Luca Olivetti <luca at wetron.es> wrote:
> I know that it seems absurd, and it probably is.
>
> Short version:
>
> FindInvalidUTF8Character could access the string beyond its length
> since it uses p[1], p[2] and p[3] without properly checking that
> those aren't beyond the end of the string.
> In the worst case this should cause nothing more than a sigsev,
> however here, under circumstances that I cannot determine exactly
> (i.e. random), it seems to hang linux hard.
>
>
> Long version:
>
> I have a (relatively simple) program that has been running flawlessly
> 24x7 the last 4 years.
>[...]
> The most intriguing part is that, under the test conditions,
> FindInvalidUTF8Character is only given pure ASCII strings, so it
> should never enter the branches where it checks p[1], p[2] or p[3],
> so I'm really puzzled.
Me too.
Nevertheless, I fixed FindInvalidUTF8Character.
Mattias
More information about the Lazarus
mailing list