iface-modem-cdma: disallow empty carrier code in automatic activation

This commit is contained in:
Aleksander Morgado
2014-07-05 07:06:05 +02:00
parent e60132284b
commit bfa5fd660c

View File

@@ -135,6 +135,17 @@ handle_activate_auth_ready (MMBaseModem *self,
return;
}
/* Error if carrier code is empty */
if (!ctx->carrier || !ctx->carrier[0]) {
g_dbus_method_invocation_return_error (ctx->invocation,
MM_CORE_ERROR,
MM_CORE_ERROR_INVALID_ARGS,
"Cannot perform OTA activation: "
"invalid empty carrier code");
handle_activate_context_free (ctx);
return;
}
modem_state = MM_MODEM_STATE_UNKNOWN;
g_object_get (self,
MM_IFACE_MODEM_STATE, &modem_state,