aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/emacs.c8
2 files changed, 8 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index afd78a46c6e..e918fa46a2b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -30,6 +30,9 @@
30 even if the time zone offset is outlandishly large. 30 even if the time zone offset is outlandishly large.
31 Don't mishandle offset == INT_MIN. 31 Don't mishandle offset == INT_MIN.
32 32
33 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
34 when creating daemon; the previous buffer-overflow check was incorrect.
35
332011-08-26 Paul Eggert <eggert@cs.ucla.edu> 362011-08-26 Paul Eggert <eggert@cs.ucla.edu>
34 37
35 Integer and memory overflow issues (Bug#9196). 38 Integer and memory overflow issues (Bug#9196).
diff --git a/src/emacs.c b/src/emacs.c
index 7039f063dc2..2c6af6b5431 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1068,15 +1068,17 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1068 if (!dname_arg || !strchr (dname_arg, '\n')) 1068 if (!dname_arg || !strchr (dname_arg, '\n'))
1069 { /* In orig, child: now exec w/special daemon name. */ 1069 { /* In orig, child: now exec w/special daemon name. */
1070 char fdStr[80]; 1070 char fdStr[80];
1071 int fdStrlen =
1072 snprintf (fdStr, sizeof fdStr,
1073 "--daemon=\n%d,%d\n%s", daemon_pipe[0],
1074 daemon_pipe[1], dname_arg ? dname_arg : "");
1071 1075
1072 if (dname_arg && strlen (dname_arg) > 70) 1076 if (! (0 <= fdStrlen && fdStrlen < sizeof fdStr))
1073 { 1077 {
1074 fprintf (stderr, "daemon: child name too long\n"); 1078 fprintf (stderr, "daemon: child name too long\n");
1075 exit (1); 1079 exit (1);
1076 } 1080 }
1077 1081
1078 sprintf (fdStr, "--daemon=\n%d,%d\n%s", daemon_pipe[0],
1079 daemon_pipe[1], dname_arg ? dname_arg : "");
1080 argv[skip_args] = fdStr; 1082 argv[skip_args] = fdStr;
1081 1083
1082 execv (argv[0], argv); 1084 execv (argv[0], argv);