This is the mail archive of the glibc-bugs-regex@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug regex/21442] Crash in re_search_stub


https://sourceware.org/bugzilla/show_bug.cgi?id=21442

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adhemerval.zanella at linaro dot o
                   |                            |rg

--- Comment #1 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
Since re_exec is an GNU extension this API corner case should be documented and
afaik unfortunately they aren't (using the gnulib documentation [1]).

For these cases I tend to follow, if possible, the POSIX inspired API. On POSIX
regular expression API [2] states that:

"[...] If the preg argument to regexec() or regfree() is not a compiled regular
expression returned by regcomp(), the result is undefined. [...]"

So if I understood correctly the issue description, it is using an invalid
regular expression buffer description on re_search (since the expression
compilation failed). IMHO we should treat this as undefined (as POSIX
counterpart) and let the user handle it correctly.  In a short, I would say we
should close this as not a bug.

[1] https://www.gnu.org/software/gnulib/manual/html_node/GNU-Searching.html
[2] http://pubs.opengroup.org/onlinepubs/9699919799/

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]