Skip to content

Commit

Permalink
Merge r220677 - [GTK][WPE] Crash in IconDatabase::IconRecord::setImag…
Browse files Browse the repository at this point in the history
…eData()

https://bugs.webkit.org/show_bug.cgi?id=175527

Reviewed by Žan Doberšek.

The problem is that when setImageData() is called from IconDatabase::readFromDatabase() the shared buffer might
be nullptr, because getImageDataForIconURLFromSQLDatabase() returns nullptr if the icon data is not in the database.

* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::IconRecord::setImageData): Return early if passed in buffer is nullptr.
  • Loading branch information
carlosgcampos committed Aug 14, 2017
1 parent 44ae35e commit ee17dd6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,16 @@
2017-08-14 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK][WPE] Crash in IconDatabase::IconRecord::setImageData()
https://bugs.webkit.org/show_bug.cgi?id=175527

Reviewed by Žan Doberšek.

The problem is that when setImageData() is called from IconDatabase::readFromDatabase() the shared buffer might
be nullptr, because getImageDataForIconURLFromSQLDatabase() returns nullptr if the icon data is not in the database.

* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::IconRecord::setImageData): Return early if passed in buffer is nullptr.

2017-08-13 Manuel Rego Casasnovas <rego@igalia.com>

Composition underline color is always black
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/API/glib/IconDatabase.cpp
Expand Up @@ -120,7 +120,7 @@ void IconDatabase::IconRecord::setImageData(RefPtr<SharedBuffer>&& data)
m_imageData = WTFMove(data);
m_image = nullptr;

if (!m_imageData->size()) {
if (!m_imageData || !m_imageData->size()) {
m_imageData = nullptr;
return;
}
Expand Down

0 comments on commit ee17dd6

Please sign in to comment.