Commit a5767dc3 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp90: Call invalid_parameter_handler on index out of range in basic_string::operator[].

parent 1ff00585
......@@ -22,7 +22,6 @@
#include "msvcp90.h"
#include "stdio.h"
#include "assert.h"
#include "windef.h"
#include "winbase.h"
......@@ -1979,7 +1978,11 @@ char* __thiscall MSVCP_basic_string_char_operator_at(
{
TRACE("%p %lu\n", this, pos);
assert(this->size >= pos);
#if _MSVCP_VER >= 80
if (this->size < pos)
_invalid_parameter(NULL, NULL, NULL, 0, 0);
#endif
return basic_string_char_ptr(this)+pos;
}
......@@ -1991,7 +1994,11 @@ const char* __thiscall MSVCP_basic_string_char_const_operator_at(
{
TRACE("%p %lu\n", this, pos);
assert(this->size >= pos);
#if _MSVCP_VER >= 80
if (this->size < pos)
_invalid_parameter(NULL, NULL, NULL, 0, 0);
#endif
return basic_string_char_const_ptr(this)+pos;
}
......@@ -3951,7 +3958,11 @@ wchar_t* __thiscall MSVCP_basic_string_wchar_operator_at(
{
TRACE("%p %lu\n", this, pos);
assert(this->size >= pos);
#if _MSVCP_VER >= 80
if (this->size < pos)
_invalid_parameter(NULL, NULL, NULL, 0, 0);
#endif
return basic_string_wchar_ptr(this)+pos;
}
......@@ -3965,7 +3976,11 @@ const wchar_t* __thiscall MSVCP_basic_string_wchar_const_operator_at(
{
TRACE("%p %lu\n", this, pos);
assert(this->size >= pos);
#if _MSVCP_VER >= 80
if (this->size < pos)
_invalid_parameter(NULL, NULL, NULL, 0, 0);
#endif
return basic_string_wchar_const_ptr(this)+pos;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment