diff options
author | Sergey Matyukevich <geomatsi@gmail.com> | 2021-01-16 22:21:06 +0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2021-01-19 10:05:02 -0600 |
commit | 7a62b554ab9ec866338f19271aecbee91c377e1c (patch) | |
tree | 14370550e151c0f4cf6d519d583e9bf73c76eb32 | |
parent | bae8ebe907a119cdcde156a3852b1b65e1fb35bb (diff) | |
download | ofono-7a62b554ab9ec866338f19271aecbee91c377e1c.tar.gz |
sim: validate IMS private identity
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.
-rw-r--r-- | src/sim.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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, |