aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-05-04 00:19:21 -0700
committerPaul Eggert2011-05-04 00:19:21 -0700
commitc378da0b47eb8c26fc8da4d89e128ee3c73537de (patch)
tree69780b09fd68c972f69c1414d48c84cb24a075fa /src
parent288b08c747644d42c1636c2b469f8c34836ccd35 (diff)
downloademacs-c378da0b47eb8c26fc8da4d89e128ee3c73537de.tar.gz
emacs-c378da0b47eb8c26fc8da4d89e128ee3c73537de.zip
Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/eval.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9fac265ae48..a1aa19e6f2e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12011-05-04 Paul Eggert <eggert@cs.ucla.edu> 12011-05-04 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
4 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
5
3 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM 6 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
4 bytes. 7 bytes.
5 8
diff --git a/src/eval.c b/src/eval.c
index 90ef02ef37b..6b4182cb319 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2002,7 +2002,10 @@ verror (const char *m, va_list ap)
2002 2002
2003 while (1) 2003 while (1)
2004 { 2004 {
2005 used = doprnt (buffer, size, m, m + mlen, ap); 2005 va_list ap_copy;
2006 va_copy (ap_copy, ap);
2007 used = doprnt (buffer, size, m, m + mlen, ap_copy);
2008 va_end (ap_copy);
2006 2009
2007 /* Note: the -1 below is because `doprnt' returns the number of bytes 2010 /* Note: the -1 below is because `doprnt' returns the number of bytes
2008 excluding the terminating null byte, and it always terminates with a 2011 excluding the terminating null byte, and it always terminates with a