Commit c0c09ac8 authored by Cyril Deguet's avatar Cyril Deguet

* ustring.cpp: fixed the operator= (the trailing '\0' was not copied,

   leading to invalid memory reads)
parent 0876b490
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ustring.cpp * ustring.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ustring.cpp,v 1.1 2004/01/03 23:31:34 asmax Exp $ * $Id$
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr>
...@@ -204,7 +204,7 @@ void UString::operator =( const UString &rOther ) ...@@ -204,7 +204,7 @@ void UString::operator =( const UString &rOther )
m_length = rOther.m_length; m_length = rOther.m_length;
delete[] m_pString; delete[] m_pString;
m_pString = new uint32_t[size() + 1]; m_pString = new uint32_t[size() + 1];
for( uint32_t i = 0; i < size(); i++ ) for( uint32_t i = 0; i <= size(); i++ )
{ {
m_pString[i] = rOther.m_pString[i]; m_pString[i] = rOther.m_pString[i];
} }
......
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