2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00

sudo_regex_compile_v1 stub: set errstr on error

This commit is contained in:
Todd C. Miller 2022-02-25 14:07:22 -07:00
parent 590c4cf62f
commit e703feeae2

View File

@ -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));