From: Paul Eggert Date: Thu, 13 Oct 2011 06:58:12 +0000 (-0700) Subject: * editfns.c (Fuser_login_name, Fuser_full_name): Signal an error X-Git-Tag: emacs-24.2.90~471^2~6^2~154 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3f4eabd19215fe1271594ac3ec81d543d2714f20;p=emacs.git * editfns.c (Fuser_login_name, Fuser_full_name): Signal an error if a uid argument is out of range, rather than relying on undefined behavior. --- diff --git a/src/ChangeLog b/src/ChangeLog index c2cf656b101..5826a4bd412 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -265,6 +265,9 @@ (lo_time): Use int, not EMACS_INT, when int suffices. (lisp_time_argument): Check for usec out of range. (Fencode_time): Don't assume fixnum fits in int. + (Fuser_login_name, Fuser_full_name): Signal an error + if a uid argument is out of range, rather than relying on + undefined behavior. * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT. (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT. (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT. diff --git a/src/editfns.c b/src/editfns.c index ac9c20ced65..8489a47649e 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1247,7 +1247,7 @@ of the user with that uid, or nil if there is no such user. */) if (NILP (uid)) return Vuser_login_name; - id = XFLOATINT (uid); + CONS_TO_INTEGER (uid, uid_t, id); BLOCK_INPUT; pw = getpwuid (id); UNBLOCK_INPUT; @@ -1306,7 +1306,8 @@ name, or nil if there is no such user. */) return Vuser_full_name; else if (NUMBERP (uid)) { - uid_t u = XFLOATINT (uid); + uid_t u; + CONS_TO_INTEGER (uid, uid_t, u); BLOCK_INPUT; pw = getpwuid (u); UNBLOCK_INPUT;