summaryrefslogtreecommitdiffstats
path: root/src/sim.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-06-25 00:00:45 -0700
committerMarcel Holtmann <marcel@holtmann.org>2012-06-25 00:00:45 -0700
commit674cb0d167120fd169931996142e76885fa583ee (patch)
tree1ab61c2cb74c6a648a62812b744f81115edb4742 /src/sim.c
parentb168c0f953838af09f611333a0e64ea3a6c586b2 (diff)
downloadofono-674cb0d167120fd169931996142e76885fa583ee.tar.bz2
sim: Add extra errors for EFmsisdn and EFad length mismatches
Diffstat (limited to 'src/sim.c')
-rw-r--r--src/sim.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sim.c b/src/sim.c
index 33543eda..4384eb0c 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -441,7 +441,6 @@ static void sim_pin_retries_query_cb(const struct ofono_error *error,
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
ofono_error("Querying remaining pin retries failed");
-
return;
}
@@ -1137,8 +1136,10 @@ static void sim_msisdn_read_cb(int ok, int length, int record,
if (!ok)
goto check;
- if (record_length < 14 || length < record_length)
+ if (record_length < 14 || length < record_length) {
+ ofono_error("EFmsidn shall at least contain 14 bytes");
return;
+ }
total = length / record_length;
@@ -1758,8 +1759,10 @@ static void sim_ad_read_cb(int ok, int length, int record,
if (!ok)
return;
- if (length < 4)
+ if (length < 4) {
+ ofono_error("EFad should contain at least four bytes");
return;
+ }
new_mnc_length = data[3] & 0xf;