Bug 174859 - [WPE] Fix a potential crash in the platform pasteboard when reading a string
Summary: [WPE] Fix a potential crash in the platform pasteboard when reading a string
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Claudio Saavedra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-26 03:37 PDT by Claudio Saavedra
Modified: 2017-07-26 06:52 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.58 KB, patch)
2017-07-26 03:39 PDT, Claudio Saavedra
no flags Details | Formatted Diff | Diff
Patch (1.67 KB, patch)
2017-07-26 03:51 PDT, Claudio Saavedra
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Claudio Saavedra 2017-07-26 03:37:39 PDT
[WPE] Fix a potential crash in the platform pasteboard when reading a string
Comment 1 Claudio Saavedra 2017-07-26 03:39:58 PDT
Created attachment 316442 [details]
Patch
Comment 2 Zan Dobersek 2017-07-26 03:43:40 PDT
Comment on attachment 316442 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=316442&action=review

> Source/WebCore/platform/wpe/PlatformPasteboardWPE.cpp:67
> -    struct wpe_pasteboard_string string;
> +    struct wpe_pasteboard_string string = { nullptr, 0 };
>      wpe_pasteboard_get_string(m_pasteboard, type.utf8().data(), &string);
>  
>      String returnValue(string.data, string.length);

Early return should be used, returning String(), in case string.length is still zero after wpe_pasteboard_get_string() call.
Comment 3 Claudio Saavedra 2017-07-26 03:51:07 PDT
Created attachment 316443 [details]
Patch
Comment 4 WebKit Commit Bot 2017-07-26 06:52:39 PDT
Comment on attachment 316443 [details]
Patch

Clearing flags on attachment: 316443

Committed r219943: <http://trac.webkit.org/changeset/219943>
Comment 5 WebKit Commit Bot 2017-07-26 06:52:41 PDT
All reviewed patches have been landed.  Closing bug.