From 0054236e872f1291582d5d2c3925b63eceb0e897 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Tue, 2 May 2017 17:22:41 +0200 Subject: [PATCH] gprs/pri_set_apn: only call dbus function when msg is given Otherwise dbus is trying to operate on a null-pointer resulting in an abort() --- src/gprs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index 377eced7..7a2eca39 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -1029,10 +1029,10 @@ static DBusMessage *pri_set_apn(struct pri_context *ctx, DBusConnection *conn, GKeyFile *settings = ctx->gprs->settings; if (g_str_equal(apn, ctx->context.apn)) - return dbus_message_new_method_return(msg); + return msg ? dbus_message_new_method_return(msg) : NULL; if (is_valid_apn(apn) == FALSE) - return __ofono_error_invalid_format(msg); + return msg ? __ofono_error_invalid_format(msg) : NULL; strcpy(ctx->context.apn, apn);