[Webkit-unassigned] [Bug 40807] [EFL] add support for logging

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 8 07:54:42 PDT 2010


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





--- Comment #16 from Lucas De Marchi <lucas.demarchi at profusion.mobi>  2010-07-08 07:54:42 PST ---
(From update of attachment 60875)
> diff --git a/WebCore/platform/efl/LoggingEfl.cpp b/WebCore/platform/efl/LoggingEfl.cpp
>  void InitializeLoggingChannelsIfNecessary()
>  {
> +    static bool didInitializeLoggingChannels = false;
> +    if (didInitializeLoggingChannels)
> +        return;
> +
> +    didInitializeLoggingChannels = true;
> +
> +    char* logEnv = getenv("WEBKIT_DEBUG");
> +    if (!logEnv)
> +        return;
> +
> +#if defined(NDEBUG)
> +    EINA_LOG_WARN("WEBKIT_DEBUG is not empty, but this is a release build. Notice that many log messages will only appear in a debug build.");
> +#endif
> +
> +    char** logv = eina_str_split(logEnv, ",", -1);
eina_str_split might return NULL if it can not allocate space for either the new string or the array. It would crash on next line since you'd dereference a null pointer. Just add an EINA_SAFETY here.
EINA_SAFETY_ON_NULL_RETURN(logEnv);

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list