1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-18 15:26:23 -05:00

Fix crash when "insert-string $HOME", missing length check when copying environment variables.

This commit is contained in:
Renaud 2013-09-29 16:56:13 +08:00
parent d0a5516da6
commit 897c50013e

3
exec.c
View File

@ -294,7 +294,8 @@ int nextarg(const char *prompt, char *buffer, int size, int terminator)
execstr = token(execstr, buffer, size);
/* evaluate it */
strcpy(buffer, getval(buffer));
strncpy( buffer, getval( buffer), size - 1) ;
buffer[ size - 1] = '\0' ;
return TRUE;
}