summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan D <jan.h.d@swipnet.se>2015-03-22 10:21:45 +0100
committerJan D <jan.h.d@swipnet.se>2015-03-22 10:21:45 +0100
commitae3d7333608652cc35f1d50cac9ea90b55f12a08 (patch)
treef3c14dfb1ec096f60c7ad99deb67771779cb2084
parente72edc05c3277fbf57a94daaa792635bfede7bc0 (diff)
downloademacs-ae3d7333608652cc35f1d50cac9ea90b55f12a08.tar.gz
Backport 20156 fix (stack corruption)
Fixes: debbugs:20156 * src/fontset.c (fontset_pattern_regexp): Backport: Replace + 1 with + 3 in alloca (tiny change)
-rw-r--r--src/ChangeLog5
-rw-r--r--src/fontset.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 90908fcf759..060486b4ab3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -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
diff --git a/src/fontset.c b/src/fontset.c
index d9aa99d05f5..5772cc830c8 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -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++)