diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-11-10 15:16:50 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-11-10 15:44:04 -0800 |
commit | 05aa6d4a68c036602f253fb27c3ca8995533b4c7 (patch) | |
tree | 390bd3b2221624d4f8b74d4f238abee8d9aa509a | |
parent | 096f638ddc806db875fa5bf90bb3be17b6893821 (diff) | |
download | emacs-05aa6d4a68c036602f253fb27c3ca8995533b4c7.tar.gz |
Fix off-by-1 bug in --enable-checking=stringbytes
Evidently nobody builds Emacs with --enable-checking=all,
which is no surprise as it is so slow as to be unusable nowadays.
Perhaps we should remove the slowest checks, or move them into
another category, or speed them up, or something.
* src/alloc.c (SDATA_SIZE) [GC_CHECK_STRING_BYTES]: Fix off-by-one
error in size calculation, which caused a failure when
--enable-checking=stringbytes was used. I introduced this bug in
2016-09-08T01:08:45!eggert@cs.ucla.edu "Port flexible array
members to GCC + valgrind".
-rw-r--r-- | src/alloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c index 0fc79fe68ac..5a44d7a9fc2 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1760,7 +1760,7 @@ static char const string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] = #ifdef GC_CHECK_STRING_BYTES -#define SDATA_SIZE(NBYTES) FLEXSIZEOF (struct sdata, data, NBYTES) +#define SDATA_SIZE(NBYTES) FLEXSIZEOF (struct sdata, data, (NBYTES) + 1) #else /* not GC_CHECK_STRING_BYTES */ |