Add checks to CefStringBase constructors for NULL pointers (issue #671).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@732 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
3b8ebef27b
commit
b6720c17e0
|
@ -314,6 +314,7 @@ class CefStringBase {
|
|||
}
|
||||
CefStringBase(const char* src) // NOLINT(runtime/explicit)
|
||||
: string_(NULL), owner_(false) {
|
||||
if (src)
|
||||
FromString(std::string(src));
|
||||
}
|
||||
|
||||
|
@ -328,6 +329,7 @@ class CefStringBase {
|
|||
}
|
||||
CefStringBase(const wchar_t* src) // NOLINT(runtime/explicit)
|
||||
: string_(NULL), owner_(false) {
|
||||
if (src)
|
||||
FromWString(std::wstring(src));
|
||||
}
|
||||
|
||||
|
@ -343,6 +345,7 @@ class CefStringBase {
|
|||
}
|
||||
CefStringBase(const char16* src) // NOLINT(runtime/explicit)
|
||||
: string_(NULL), owner_(false) {
|
||||
if (src)
|
||||
FromString16(string16(src));
|
||||
}
|
||||
#endif // BUILDING_CEF_SHARED && WCHAR_T_IS_UTF32
|
||||
|
@ -355,6 +358,7 @@ class CefStringBase {
|
|||
///
|
||||
CefStringBase(const char_type* src, size_t src_len, bool copy)
|
||||
: string_(NULL), owner_(false) {
|
||||
if (src && src_len > 0)
|
||||
FromString(src, src_len, copy);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue