From 1ff5a7ef75a7cc595f527a10b766a6c6020ac4c0 Mon Sep 17 00:00:00 2001 From: molivier Date: Tue, 30 Sep 2003 06:36:41 +0000 Subject: [PATCH] Fixed 2 potential buffer overflows in SearchInfostring git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3514 d7cf8633-e32d-0410-b094-e92efae38249 --- common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.2