Hi Jonas,

On 05/04/2017 08:24 AM, Jonas Bonn wrote:
pri_set_apn is called by ofono_gprs_cid_activated() which is not a DBus
method; as such, there is no DBus return message.  Attempting to create
the return message with a NULL 'msg' may cause the DBus library to
call abort().
---
 src/gprs.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gprs.c b/src/gprs.c
index c5e7709..ed2131e 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -1030,8 +1030,12 @@ static DBusMessage *pri_set_apn(struct pri_context *ctx, 
DBusConnection *conn,
        if (strlen(apn) > OFONO_GPRS_MAX_APN_LENGTH)
                return __ofono_error_invalid_format(msg);

-       if (g_str_equal(apn, ctx->context.apn))
-               return dbus_message_new_method_return(msg);
+       if (g_str_equal(apn, ctx->context.apn)) {
+               if (msg)
+                       return dbus_message_new_method_return(msg);
+               else
+                       return NULL;
+       }

This doesn't really help as __ofono_error still uses dbus_message_new... with a NULL argument.

I suspect that the code in this function likely needs to be duplicated for the cid_activated case.


        if (is_valid_apn(apn) == FALSE)
                return __ofono_error_invalid_format(msg);


Regards,
-Denis
_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to