From 0234988c465ab606f934ef1212899ce8f36e6a64 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 17 Jul 2003 22:14:50 +0000 Subject: [PATCH] fix an exploitable overflow (owwie) --- qw/source/cl_parse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qw/source/cl_parse.c b/qw/source/cl_parse.c index 2398f67ad..3fe5aff26 100644 --- a/qw/source/cl_parse.c +++ b/qw/source/cl_parse.c @@ -986,11 +986,12 @@ CL_ParseClientdata (void) static void CL_ProcessUserInfo (int slot, player_info_t *player) { - char skin[512]; + char *skin; const char *s; s = Info_ValueForKey (player->userinfo, "skin"); - QFS_StripExtension (s, skin); // FIXME: buffer overflow + skin = alloca (strlen (s) + 1); + QFS_StripExtension (s, skin); if (!strequal (s, skin)) Info_SetValueForKey (player->userinfo, "skin", skin, 1); strncpy (player->name, Info_ValueForKey (player->userinfo, "name"),