All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sim: validate IMS private identity
@ 2021-01-15 16:38 Sergey Matyukevich
  2021-01-15 18:07 ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: Sergey Matyukevich @ 2021-01-15 16:38 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 851 bytes --]

Make sure that IMPI is a valid UTF8 string before attempting
to report it via DBus. Otherwise ofono may crash on dbus assert.
This field may not be defined for ISIM in use. In this case the
field still can be read from ISIM, though it will not contain
a valid UTF8 string. For instance, it may contain 255 0xFF bytes.
---
 src/sim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sim.c b/src/sim.c
index 33e1245f..f60f5d1b 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -423,7 +423,7 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
 		ofono_dbus_dict_append(&dict, "ServiceProviderName",
 					DBUS_TYPE_STRING, &sim->spn);
 
-	if (sim->impi)
+	if (sim->impi && g_utf8_validate(sim->impi, 255, NULL))
 		ofono_dbus_dict_append(&dict, "ImsPrivateIdentity",
 					DBUS_TYPE_STRING, &sim->impi);
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-15 19:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-15 16:38 [PATCH] sim: validate IMS private identity Sergey Matyukevich
2021-01-15 18:07 ` Denis Kenzior
2021-01-15 19:23   ` Sergey Matyukevich
2021-01-15 19:52     ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.