From 6bd0e4ed9b8a11ecf8dfdb56dbcdc829b9f4baa7 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 170f615e..b57cb4c9 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -950,10 +950,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);