aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-04-17 21:16:47 -0700
committerPaul Eggert2011-04-17 21:16:47 -0700
commit000098c13577337d3bb8cb381bd16701dc11cc32 (patch)
tree6ec6d9a48dc63ed9c1d6dc6e9c294a0d283fd280 /src
parentbfd1c7811d3661512b382906334ac959d332735b (diff)
downloademacs-000098c13577337d3bb8cb381bd16701dc11cc32.tar.gz
emacs-000098c13577337d3bb8cb381bd16701dc11cc32.zip
* alloc.c (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
can cause Emacs to crash when string overrun checking is enabled.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog2
-rw-r--r--src/alloc.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d51052f0e3d..fa2aa03233d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -4,6 +4,8 @@
4 This doesn't fix a bug but makes the code clearer. 4 This doesn't fix a bug but makes the code clearer.
5 (string_overrun_cookie): Now const. Use initializers that 5 (string_overrun_cookie): Now const. Use initializers that
6 don't formally overflow signed char, to avoid warnings. 6 don't formally overflow signed char, to avoid warnings.
7 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
8 can cause Emacs to crash when string overrun checking is enabled.
7 9
82011-04-17 Chong Yidong <cyd@stupidchicken.com> 102011-04-17 Chong Yidong <cyd@stupidchicken.com>
9 11
diff --git a/src/alloc.c b/src/alloc.c
index 2029383dec8..2af75e3c471 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1937,7 +1937,8 @@ allocate_string_data (struct Lisp_String *s,
1937 s->size_byte = nbytes; 1937 s->size_byte = nbytes;
1938 s->data[nbytes] = '\0'; 1938 s->data[nbytes] = '\0';
1939#ifdef GC_CHECK_STRING_OVERRUN 1939#ifdef GC_CHECK_STRING_OVERRUN
1940 memcpy (data + needed, string_overrun_cookie, GC_STRING_OVERRUN_COOKIE_SIZE); 1940 memcpy ((char *) data + needed, string_overrun_cookie,
1941 GC_STRING_OVERRUN_COOKIE_SIZE);
1941#endif 1942#endif
1942 1943
1943 /* If S had already data assigned, mark that as free by setting its 1944 /* If S had already data assigned, mark that as free by setting its