Changeset 95088 in webkit


Ignore:
Timestamp:
Sep 14, 2011 6:52:30 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL] Add NULL checks to ewk_window_features_new_from_core and ewk_view_window_create.
https://bugs.webkit.org/show_bug.cgi?id=64932

Patch by Grzegorz Czajkowski <g.czajkowski@samsung.com> on 2011-09-14
Reviewed by Eric Seidel.

It prevents the crash while allocating memory for the new window.

  • ewk/ewk_view.cpp:

(ewk_view_window_create):

  • ewk/ewk_window_features.cpp:

(ewk_window_features_new_from_core):

Location:
trunk/Source/WebKit/efl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/efl/ChangeLog

    r95033 r95088  
     12011-09-14  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
     2
     3        [EFL] Add NULL checks to ewk_window_features_new_from_core and ewk_view_window_create.
     4        https://bugs.webkit.org/show_bug.cgi?id=64932
     5
     6        Reviewed by Eric Seidel.
     7
     8        It prevents the crash while allocating memory for the new window.
     9
     10        * ewk/ewk_view.cpp:
     11        (ewk_view_window_create):
     12        * ewk/ewk_window_features.cpp:
     13        (ewk_window_features_new_from_core):
     14
    1152011-09-13  Raphael Kubo da Costa  <kubo@profusion.mobi>
    216
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r94965 r95088  
    28652865 *
    28662866 * @return New view, in case smart class implements the creation of new windows;
    2867  * else, current view @param o.
     2867 * else, current view @param o or @c 0 on failure.
    28682868 *
    28692869 * @see ewk_window_features_ref().
     
    28772877
    28782878    Ewk_Window_Features *window_features = ewk_window_features_new_from_core(coreFeatures);
     2879    if (!window_features)
     2880        return 0;
     2881
    28792882    Evas_Object* view = sd->api->window_create(sd, javascript, window_features);
    28802883    ewk_window_features_unref(window_features);
  • trunk/Source/WebKit/efl/ewk/ewk_window_features.cpp

    r94063 r95088  
    106106 * @param core if not @c 0 a new WebCore::WindowFeatures is allocated copying core features and
    107107 * it is embedded inside the Ewk_Window_Features whose ref count is initialized, if core is @c 0 a new one is created with the default features.
    108  * @returns a new allocated the Ewk_Window_Features object
     108 * @return a new allocated the Ewk_Window_Features object on sucess or @c 0 on failure
    109109 */
    110110Ewk_Window_Features *ewk_window_features_new_from_core(const WebCore::WindowFeatures *core)
    111111{
    112112    Ewk_Window_Features *window_features = static_cast<Ewk_Window_Features*>(malloc(sizeof(*window_features)));
     113    if (!window_features) {
     114        CRITICAL("Could not allocate Ewk_Window_Features.");
     115        return 0;
     116    }
    113117
    114118    if (core)
Note: See TracChangeset for help on using the changeset viewer.