summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrzej Zaborowski <andrew.zaborowski@intel.com>2010-12-20 13:52:33 +0100
committerDenis Kenzior <denkenz@gmail.com>2010-12-21 14:25:09 -0600
commitbb9e26f2a52d6b24e905f19ff777276b3b473c0c (patch)
tree95723e8bd5bcc2de885c6b1abafbe8422832ed8d /src
parent6074554be92db57a4782fc7b75ec26772065ed48 (diff)
downloadofono-bb9e26f2a52d6b24e905f19ff777276b3b473c0c.tar.bz2
sim: Set sane number len in empty EFmsisdn records
Valid number length range is 1 - 11 bytes, other values, such as 0xff, could potentially crash external parsers.
Diffstat (limited to 'src')
-rw-r--r--src/sim.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sim.c b/src/sim.c
index 6217a252..335f6118 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -429,6 +429,8 @@ static gboolean set_own_numbers(struct ofono_sim *sim,
new_numbers = new_numbers->next;
} else {
memset(efmsisdn, 0xff, sim->efmsisdn_length);
+ /* Set number length */
+ efmsisdn[sim->efmsisdn_length - 14] = 1;
}
if (ofono_sim_write(req->sim, SIM_EFMSISDN_FILEID,