mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-06 03:40:56 -08:00
Fix unlikely user-full-name integer overflow
* src/editfns.c (Fuser_full_name): Don’t assume uid fits into fixnum.
This commit is contained in:
parent
c73d18ac42
commit
6f52478e0c
1 changed files with 1 additions and 1 deletions
|
|
@ -1260,7 +1260,7 @@ name, or nil if there is no such user. */)
|
||||||
/* Substitute the login name for the &, upcasing the first character. */
|
/* Substitute the login name for the &, upcasing the first character. */
|
||||||
if (q)
|
if (q)
|
||||||
{
|
{
|
||||||
Lisp_Object login = Fuser_login_name (make_fixnum (pw->pw_uid));
|
Lisp_Object login = Fuser_login_name (INT_TO_INTEGER (pw->pw_uid));
|
||||||
USE_SAFE_ALLOCA;
|
USE_SAFE_ALLOCA;
|
||||||
char *r = SAFE_ALLOCA (strlen (p) + SBYTES (login) + 1);
|
char *r = SAFE_ALLOCA (strlen (p) + SBYTES (login) + 1);
|
||||||
memcpy (r, p, q - p);
|
memcpy (r, p, q - p);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue