Backport 20156 fix (stack corruption)

Fixes: debbugs:20156

* src/fontset.c (fontset_pattern_regexp): Backport: Replace + 1 with
+ 3 in alloca (tiny change)
This commit is contained in:
Jan D 2015-03-22 10:21:45 +01:00
parent e72edc05c3
commit ae3d733360
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2015-03-22 John F Carr <jfc@mit.edu>
* fontset.c (fontset_pattern_regexp): Backport: Replace + 1 with
+ 3 in alloca (Bug#20156) (tiny change)
2015-03-12 Glenn Morris <rgm@gnu.org>
* frame.h (x_set_bitmap_icon): Don't set the icon if icon-type is

View file

@ -1097,9 +1097,9 @@ fontset_pattern_regexp (Lisp_Object pattern)
we convert "*" to "[^-]*" which is much faster in regular
expression matching. */
if (ndashes < 14)
p1 = regex = alloca (SBYTES (pattern) + 2 * nstars + 2 * nescs + 1);
p1 = regex = alloca (SBYTES (pattern) + 2 * nstars + 2 * nescs + 3);
else
p1 = regex = alloca (SBYTES (pattern) + 5 * nstars + 2 * nescs + 1);
p1 = regex = alloca (SBYTES (pattern) + 5 * nstars + 2 * nescs + 3);
*p1++ = '^';
for (p0 = SDATA (pattern); *p0; p0++)