Re: [PATCH v3 2/3] sim: validate IMS private identity

2021-01-19 Thread Denis Kenzior

Hi Sergey,

On 1/16/21 1:21 PM, Sergey Matyukevich wrote:

Make sure that IMS private identity is a valid UTF8 string before
setting sim->impi field. Otherwise ofono may crash on dbus assert
when SIM properties are reported via org.ofono.SimManager interface.
---
  src/sim.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)



Patch  2 and 3 applied, thanks.

Regards,
-Denis
___
ofono mailing list -- ofono@ofono.org
To unsubscribe send an email to ofono-le...@ofono.org


[PATCH v3 2/3] sim: validate IMS private identity

2021-01-16 Thread Sergey Matyukevich
Make sure that IMS private identity is a valid UTF8 string before
setting sim->impi field. Otherwise ofono may crash on dbus assert
when SIM properties are reported via org.ofono.SimManager interface.
---
 src/sim.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/sim.c b/src/sim.c
index 33e1245f..793ff64a 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -1664,7 +1664,8 @@ static void impi_read_cb(int ok, int total_length, int 
record,
return;
}
 
-   sim->impi = g_strndup((const char *)data + 2, data[1]);
+   if (validate_utf8_tlv(data))
+   sim->impi = g_strndup((const char *)data + 2, data[1]);
 }
 
 static void discover_apps_cb(const struct ofono_error *error,
___
ofono mailing list -- ofono@ofono.org
To unsubscribe send an email to ofono-le...@ofono.org