aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog2
-rw-r--r--src/xsmfns.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f8e5ca78b33..1f288a48f2f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,7 @@
12011-07-29 Paul Eggert <eggert@cs.ucla.edu> 12011-07-29 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
4
3 * xselect.c: Integer and memory overflow issues. 5 * xselect.c: Integer and memory overflow issues.
4 (X_LONG_SIZE, X_USHRT_MAX, X_ULONG_MAX): New macros. 6 (X_LONG_SIZE, X_USHRT_MAX, X_ULONG_MAX): New macros.
5 Use them to make the following changes clearer. 7 Use them to make the following changes clearer.
diff --git a/src/xsmfns.c b/src/xsmfns.c
index cb56ae648d1..217087dbae7 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -223,6 +223,9 @@ smc_save_yourself_CB (SmcConn smcConn,
223 props[props_idx]->name = xstrdup (SmRestartCommand); 223 props[props_idx]->name = xstrdup (SmRestartCommand);
224 props[props_idx]->type = xstrdup (SmLISTofARRAY8); 224 props[props_idx]->type = xstrdup (SmLISTofARRAY8);
225 /* /path/to/emacs, --smid=xxx --no-splash --chdir=dir ... */ 225 /* /path/to/emacs, --smid=xxx --no-splash --chdir=dir ... */
226 if (min (INT_MAX, min (PTRDIFF_MAX, SIZE_MAX) / sizeof *vp) - 3
227 < initial_argc)
228 memory_full (SIZE_MAX);
226 i = 3 + initial_argc; 229 i = 3 + initial_argc;
227 props[props_idx]->num_vals = i; 230 props[props_idx]->num_vals = i;
228 vp = (SmPropValue *) xmalloc (i * sizeof(*vp)); 231 vp = (SmPropValue *) xmalloc (i * sizeof(*vp));