From 1b6dfafce240745f6b509492673e1c1c60fe9f39 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Wed, 17 Oct 2012 10:00:13 +0200 Subject: [PATCH] msvcp60: Fixed overflow in basic_string_char_find_cstr_substr function. --- dlls/msvcp60/string.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/msvcp60/string.c b/dlls/msvcp60/string.c index 2bef248711..591ffdf41e 100644 --- a/dlls/msvcp60/string.c +++ b/dlls/msvcp60/string.c @@ -826,6 +826,8 @@ MSVCP_size_t __thiscall basic_string_char_find_cstr_substr( if(len==0 && pos<=this->size) return pos; + if(pos>=this->size || len>this->size) + return basic_string_char_npos; end = this->ptr+this->size-len+1; for(p=this->ptr+pos; psize) return pos; + if(pos>=this->size || len>this->size) + return basic_string_wchar_npos; end = this->ptr+this->size-len+1; for(p=this->ptr+pos; p