From: molivier Date: Tue, 30 Sep 2003 06:36:41 +0000 (+0000) Subject: Fixed 2 potential buffer overflows in SearchInfostring X-Git-Tag: xonotic-v0.1.0preview~6355 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=1ff5a7ef75a7cc595f527a10b766a6c6020ac4c0;p=xonotic%2Fdarkplaces.git Fixed 2 potential buffer overflows in SearchInfostring git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3514 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/common.c b/common.c index f9c2a5ae..4ff60bb9 100644 --- a/common.c +++ b/common.c @@ -898,7 +898,7 @@ char *SearchInfostring(const char *infostring, const char *key) if (c == '\0') return NULL; - if (c == '\\') + if (c == '\\' || key_ind == sizeof (crt_key) - 1) { crt_key[key_ind] = '\0'; break; @@ -914,7 +914,7 @@ char *SearchInfostring(const char *infostring, const char *key) { c = *infostring++; - if (c == '\0' || c == '\\') + if (c == '\0' || c == '\\' || value_ind == sizeof (value) - 1) { value[value_ind] = '\0'; return value;