From d5760d802e6557b4c010c9cb0bbe1e544c008f0f Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 29 Mar 2019 18:50:30 +0100 Subject: [PATCH] eina_log: reset logging callback to default when null is set as the callback Summary: passing null here causes any log message to crash the app and is probably not the intended result Reviewers: cedric, segfaultxavi Reviewed By: cedric, segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8513 --- src/lib/eina/eina_log.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/eina/eina_log.c b/src/lib/eina/eina_log.c index 1e55f6b..807efbc 100644 --- a/src/lib/eina/eina_log.c +++ b/src/lib/eina/eina_log.c @@ -1752,7 +1752,10 @@ eina_log_print_cb_set(Eina_Log_Print_Cb cb, void *data) { #ifdef EINA_ENABLE_LOG LOG_LOCK(); - _print_cb = cb; + if (cb) + _print_cb = cb; + else + _print_cb = eina_log_print_cb_stderr; _print_cb_data = data; eina_log_print_prefix_update(); LOG_UNLOCK(); -- 2.7.4