From: Paul Eggert Date: Sun, 19 Jun 2011 18:44:09 +0000 (-0700) Subject: * coding.c (make_subsidiaries): Don't assume string length fits in int. X-Git-Tag: emacs-pretest-24.0.90~104^2~473^2~29 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1bfdaf108fd83f2c673a50eb069e29556e2e3ca6;p=emacs.git * coding.c (make_subsidiaries): Don't assume string length fits in int. --- diff --git a/src/ChangeLog b/src/ChangeLog index bcf40a4e470..99d9cad7628 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2011-06-19 Paul Eggert + * coding.c (make_subsidiaries): Don't assume string length fits in int. + * callproc.c (child_setup): Rewrite to avoid two strlen calls. * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT. diff --git a/src/coding.c b/src/coding.c index 04985ab3c74..9939774ea82 100644 --- a/src/coding.c +++ b/src/coding.c @@ -9442,7 +9442,7 @@ static Lisp_Object make_subsidiaries (Lisp_Object base) { Lisp_Object subsidiaries; - int base_name_len = SBYTES (SYMBOL_NAME (base)); + ptrdiff_t base_name_len = SBYTES (SYMBOL_NAME (base)); char *buf = (char *) alloca (base_name_len + 6); int i; @@ -9450,7 +9450,7 @@ make_subsidiaries (Lisp_Object base) subsidiaries = Fmake_vector (make_number (3), Qnil); for (i = 0; i < 3; i++) { - memcpy (buf + base_name_len, suffixes[i], strlen (suffixes[i]) + 1); + strcpy (buf + base_name_len, suffixes[i]); ASET (subsidiaries, i, intern (buf)); } return subsidiaries;