From: Paul Eggert Date: Mon, 29 Aug 2011 19:46:15 +0000 (-0700) Subject: * process.c (make_process): Use printmax_t, not int, to format X-Git-Tag: emacs-pretest-24.0.90~104^2~153^2~1^2~19 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=31c286f79d43a002f441b90dc0176014ba0fa8e7;p=emacs.git * process.c (make_process): Use printmax_t, not int, to format process-name gensyms. --- diff --git a/src/ChangeLog b/src/ChangeLog index d1d11df1900..b1c29363da0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -85,6 +85,9 @@ index. Don't assume hash table size fits in 'long', or that vectorlike size fits in 'unsigned long'. + * process.c (make_process): Use printmax_t, not int, to format + process-name gensyms. + 2011-08-26 Paul Eggert Integer and memory overflow issues (Bug#9196). diff --git a/src/process.c b/src/process.c index a8088322147..058ad5f871f 100644 --- a/src/process.c +++ b/src/process.c @@ -616,8 +616,8 @@ make_process (Lisp_Object name) { register Lisp_Object val, tem, name1; register struct Lisp_Process *p; - char suffix[10]; - register int i; + char suffix[sizeof "<>" + INT_STRLEN_BOUND (printmax_t)]; + printmax_t i; p = allocate_process (); @@ -651,7 +651,7 @@ make_process (Lisp_Object name) { tem = Fget_process (name1); if (NILP (tem)) break; - sprintf (suffix, "<%d>", i); + sprintf (suffix, "<%"pMd">", i); name1 = concat2 (name, build_string (suffix)); } name = name1;