mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-22 09:57:41 +00:00
sudo_regex_compile_v1 stub: set errstr on error
This commit is contained in:
parent
590c4cf62f
commit
e703feeae2
@ -53,8 +53,10 @@ sudo_regex_compile_v1(void *v, const char *pattern, const char **errstr)
|
||||
{
|
||||
regex_t *preg = v;
|
||||
|
||||
if (strlen(pattern) > 32)
|
||||
if (strlen(pattern) > 32) {
|
||||
*errstr = "invalid regular expression";
|
||||
return false;
|
||||
}
|
||||
|
||||
/* hopefully avoid regfree() crashes */
|
||||
memset(preg, 0, sizeof(*preg));
|
||||
|
Loading…
x
Reference in New Issue
Block a user