Fix UB in ebrowse
* lib-src/ebrowse.c (matching_regexp): Avoid writing beyond the limits of 'matching_regexp_buffer'. Patch by Jan Stranik <jan@stranik.org>. (Bug#53333) Copyright-paperwork-exempt: yes
This commit is contained in:
parent
ba57b78064
commit
11ea45c9e4
1 changed files with 9 additions and 1 deletions
|
@ -1925,7 +1925,15 @@ matching_regexp (void)
|
||||||
*--s = *--t;
|
*--s = *--t;
|
||||||
|
|
||||||
if (*s == '"' || *s == '\\')
|
if (*s == '"' || *s == '\\')
|
||||||
*--s = '\\';
|
{
|
||||||
|
if (s > matching_regexp_buffer)
|
||||||
|
*--s = '\\';
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*(matching_regexp_end_buf - 1) = '\0';
|
*(matching_regexp_end_buf - 1) = '\0';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue