]> git.saurik.com Git - wxWidgets.git/commit
Fix caching wrong length in wxString(str, len) ctor in UTF-8 build.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 23 Mar 2012 15:13:08 +0000 (15:13 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 23 Mar 2012 15:13:08 +0000 (15:13 +0000)
commitbd42a07c7a528c607e7327dcd194b739fb242da2
tree88a8d1c5f7a8c6af3e9b27fbd9e7f7e43725e686
parentd1485d817770acb1e1dd0cffe62469a4547a5f5b
Fix caching wrong length in wxString(str, len) ctor in UTF-8 build.

A length greater than that of the source string could be passed to this ctor.
This worked correctly, i.e. created a string which was a copy of the source
one but cached a wrong length for it.

Avoid this by explicitly checking the length before caching it in
wxString::assign(str, len).

See #14130.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70986 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/string.h
tests/strings/strings.cpp