Re: [pcre-dev] PCRE2 SVN 492 regression?

トップ ページ
このメッセージを削除
著者: ph10
日付:  
To: Ralf Junker
CC: pcre-dev@exim.org
題目: Re: [pcre-dev] PCRE2 SVN 492 regression?
On Fri, 10 Jun 2016, Ralf Junker wrote:

> With SVN 492, pcre2_get_error_message(100, ...) returns 8 for the length of
> "no error". Before it returned 0 for an empty string. As far as I can see, "no
> error" was never returned.
>
> Since the check-in comment merely talks about compiler warnings, I do not know
> if this regression is intended. It makes sense somewhat, but might also break
> existing code which checks the error message instead of the error code.


It was not intended, in the sense that I didn't even consider this. It's
an accident of turning an unsigned integer into a signed one (which it
should be). However, I consider the previous situation to have been a
bug. The documentation implies that errorcode and erroroffset are set
only when pcre2_compile() returns NULL, and in that situation it never
sets errorcode to 100 (ERR0).

While looking into this weird effect I have realized that the code for
pcre2_get_error_message() is buggy in another way, and also not as
robust as it should be. I am going to implement a testing facility and
then fix the issue. Watch this space.

Thank you for noticing and reporting this.

Philip

--
Philip Hazel