소스 검색

Merge pull request #670 from BeamNG/fix_string_dereference_null_ptr

Fix Dereference of null pointer on String::operator+=
Thomas Fischer 11 년 전
부모
커밋
353ecb5961
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Engine/source/core/util/str.cpp

+ 1 - 1
Engine/source/core/util/str.cpp

@@ -760,7 +760,7 @@ String& String::operator=(const String &src)
 
 String& String::operator+=(const StringChar *src)
 {
-   if( src == NULL && !*src )
+   if( src == NULL || !*src )
       return *this;
 
    // Append the given string into a new string