bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH v2 0/5] Speed up uNN_chr and uNN_strchr with Boyer-Moore algo


From: Bruno Haible
Subject: Re: [PATCH v2 0/5] Speed up uNN_chr and uNN_strchr with Boyer-Moore algorithm
Date: Thu, 29 Jul 2010 17:36:16 +0200
User-agent: KMail/1.9.9

Paolo Bonzini wrote:
> The point is that
> u8_mbtouc will look only one byte past the end of a (valid or invalid)
> character

This is not guaranteed. If you call u8_mbtouc(&uc, needle, 4)
you are asserting that needle[0..3] are valid memory addresses.
If it's not the case, u8_mbtouc may crash.

You should better use u8_strmbtouc in this case.

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]