Chromium Code Reviews| Index: third_party/WebKit/public/platform/WebString.h |
| diff --git a/third_party/WebKit/public/platform/WebString.h b/third_party/WebKit/public/platform/WebString.h |
| index b5e4a896ccd590fefd45461a798cc42a5b7e2fa5..af7c497966f0ca544dbc597f60bf236a3db61161 100644 |
| --- a/third_party/WebKit/public/platform/WebString.h |
| +++ b/third_party/WebKit/public/platform/WebString.h |
| @@ -112,7 +112,7 @@ class WebString { |
| BLINK_COMMON_EXPORT void assign(const WebUChar* data, size_t len); |
| BLINK_COMMON_EXPORT bool equals(const WebString&) const; |
| - BLINK_COMMON_EXPORT bool equals(const char* characters) const; |
| + BLINK_COMMON_EXPORT bool equals(const char* characters, size_t len) const; |
| BLINK_COMMON_EXPORT size_t length() const; |
| @@ -229,7 +229,7 @@ class WebString { |
| }; |
| inline bool operator==(const WebString& a, const char* b) { |
| - return a.equals(b); |
| + return a.equals(b, strlen(b)); |
|
esprehn
2017/01/26 08:36:54
You need to null check, calling strlen with null w
kinuko
2017/01/26 09:41:04
Thanks for catching this! Done.
|
| } |
| inline bool operator!=(const WebString& a, const char* b) { |
| @@ -237,7 +237,7 @@ inline bool operator!=(const WebString& a, const char* b) { |
| } |
| inline bool operator==(const char* a, const WebString& b) { |
| - return b.equals(a); |
| + return b.equals(a, strlen(a)); |
|
esprehn
2017/01/26 08:36:54
ditto, or you could do:
return b == a;
kinuko
2017/01/26 09:41:04
Done.
|
| } |
| inline bool operator!=(const char* a, const WebString& b) { |