瀏覽代碼

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)
 String& String::operator+=(const StringChar *src)
 {
 {
-   if( src == NULL && !*src )
+   if( src == NULL || !*src )
       return *this;
       return *this;
 
 
    // Append the given string into a new string
    // Append the given string into a new string