diff --git a/src/gprs.c b/src/gprs.c index d5f9dc99..506baf1d 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -208,6 +208,9 @@ static DBusMessage *pri_set_apn(struct pri_context *ctx, DBusConnection *conn, if (g_str_equal(apn, ctx->context.apn)) return dbus_message_new_method_return(msg); + if (is_valid_apn(apn) == FALSE) + return __ofono_error_invalid_format(msg); + strcpy(ctx->context.apn, apn); g_dbus_send_reply(conn, msg, DBUS_TYPE_INVALID);