diff options
author | tkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 08:34:51 +0000 |
---|---|---|
committer | tkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 08:34:51 +0000 |
commit | a9e132387cacf1abe875409010ab7ee45faa3635 (patch) | |
tree | 48716fe225d32407ef4f54b05766ea9f33c79990 | |
parent | 7d95aae72e11aabaffd68d8b1f7864729713dd43 (diff) | |
download | chromium_src-a9e132387cacf1abe875409010ab7ee45faa3635.zip chromium_src-a9e132387cacf1abe875409010ab7ee45faa3635.tar.gz chromium_src-a9e132387cacf1abe875409010ab7ee45faa3635.tar.bz2 |
Fix possible null-pointer dereferences in WebKit API.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/266039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28530 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/api/src/WebData.cpp | 3 | ||||
-rw-r--r-- | webkit/api/src/WebDragData.cpp | 3 | ||||
-rw-r--r-- | webkit/api/src/WebForm.cpp | 3 | ||||
-rw-r--r-- | webkit/api/src/WebHTTPBody.cpp | 3 | ||||
-rw-r--r-- | webkit/api/src/WebHistoryItem.cpp | 3 | ||||
-rw-r--r-- | webkit/api/src/WebNotification.cpp | 3 | ||||
-rw-r--r-- | webkit/api/src/WebRange.cpp | 3 | ||||
-rw-r--r-- | webkit/api/src/WebSecurityOrigin.cpp | 3 |
8 files changed, 16 insertions, 8 deletions
diff --git a/webkit/api/src/WebData.cpp b/webkit/api/src/WebData.cpp index f4ec81a..6aafe79 100644 --- a/webkit/api/src/WebData.cpp +++ b/webkit/api/src/WebData.cpp @@ -51,7 +51,8 @@ void WebData::reset() void WebData::assign(const WebData& other) { WebDataPrivate* p = const_cast<WebDataPrivate*>(other.m_private); - p->ref(); + if (p) + p->ref(); assign(p); } diff --git a/webkit/api/src/WebDragData.cpp b/webkit/api/src/WebDragData.cpp index facbcd2..df9991c 100644 --- a/webkit/api/src/WebDragData.cpp +++ b/webkit/api/src/WebDragData.cpp @@ -59,7 +59,8 @@ void WebDragData::reset() void WebDragData::assign(const WebDragData& other) { WebDragDataPrivate* p = const_cast<WebDragDataPrivate*>(other.m_private); - p->ref(); + if (p) + p->ref(); assign(p); } diff --git a/webkit/api/src/WebForm.cpp b/webkit/api/src/WebForm.cpp index 3ab7c4a..8b1c6b5 100644 --- a/webkit/api/src/WebForm.cpp +++ b/webkit/api/src/WebForm.cpp @@ -49,7 +49,8 @@ void WebForm::reset() void WebForm::assign(const WebForm& other) { WebFormPrivate* p = const_cast<WebFormPrivate*>(other.m_private); - p->ref(); + if (p) + p->ref(); assign(p); } diff --git a/webkit/api/src/WebHTTPBody.cpp b/webkit/api/src/WebHTTPBody.cpp index bd66b08..335ed5c 100644 --- a/webkit/api/src/WebHTTPBody.cpp +++ b/webkit/api/src/WebHTTPBody.cpp @@ -53,7 +53,8 @@ void WebHTTPBody::reset() void WebHTTPBody::assign(const WebHTTPBody& other) { WebHTTPBodyPrivate* p = const_cast<WebHTTPBodyPrivate*>(other.m_private); - p->ref(); + if (p) + p->ref(); assign(p); } diff --git a/webkit/api/src/WebHistoryItem.cpp b/webkit/api/src/WebHistoryItem.cpp index 77c0edc..d4ee50a 100644 --- a/webkit/api/src/WebHistoryItem.cpp +++ b/webkit/api/src/WebHistoryItem.cpp @@ -60,7 +60,8 @@ void WebHistoryItem::reset() void WebHistoryItem::assign(const WebHistoryItem& other) { WebHistoryItemPrivate* p = const_cast<WebHistoryItemPrivate*>(other.m_private); - p->ref(); + if (p) + p->ref(); assign(p); } diff --git a/webkit/api/src/WebNotification.cpp b/webkit/api/src/WebNotification.cpp index 2b2e3bb..ba1dcba 100644 --- a/webkit/api/src/WebNotification.cpp +++ b/webkit/api/src/WebNotification.cpp @@ -54,7 +54,8 @@ void WebNotification::reset() void WebNotification::assign(const WebNotification& other) { WebNotificationPrivate* p = const_cast<WebNotificationPrivate*>(other.m_private); - p->ref(); + if (p) + p->ref(); assign(p); } diff --git a/webkit/api/src/WebRange.cpp b/webkit/api/src/WebRange.cpp index aa101c90..ea1f168 100644 --- a/webkit/api/src/WebRange.cpp +++ b/webkit/api/src/WebRange.cpp @@ -51,7 +51,8 @@ void WebRange::reset() void WebRange::assign(const WebRange& other) { WebRangePrivate* p = const_cast<WebRangePrivate*>(other.m_private); - p->ref(); + if (p) + p->ref(); assign(p); } diff --git a/webkit/api/src/WebSecurityOrigin.cpp b/webkit/api/src/WebSecurityOrigin.cpp index f1641e3..c0563af 100644 --- a/webkit/api/src/WebSecurityOrigin.cpp +++ b/webkit/api/src/WebSecurityOrigin.cpp @@ -50,7 +50,8 @@ void WebSecurityOrigin::reset() void WebSecurityOrigin::assign(const WebSecurityOrigin& other) { WebSecurityOriginPrivate* p = const_cast<WebSecurityOriginPrivate*>(other.m_private); - p->ref(); + if (p) + p->ref(); assign(p); } |