All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 1/4] sim: read EFimg
Date: Wed, 25 Aug 2010 18:39:26 -0500	[thread overview]
Message-ID: <4C75A9AE.8070106@gmail.com> (raw)
In-Reply-To: <1282753794-7612-1-git-send-email-kristen@linux.intel.com>

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

Hi Kristen,

On 08/25/2010 11:29 AM, Kristen Carlson Accardi wrote:
> ---
>  src/sim.c |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 49 insertions(+), 0 deletions(-)
> 
> diff --git a/src/sim.c b/src/sim.c
> index 04a708b..dc47901 100644
> --- a/src/sim.c
> +++ b/src/sim.c
> @@ -88,6 +88,8 @@ struct ofono_sim {
>  	unsigned char efmsisdn_records;
>  	unsigned char *efli;
>  	unsigned char efli_length;
> +	unsigned char *efimg;
> +	int efimg_length;
>  	enum ofono_sim_cphs_phase cphs_phase;
>  	unsigned char cphs_service_table[2];
>  	struct ofono_watchlist *state_watches;
> @@ -958,6 +960,46 @@ static void sim_own_numbers_update(struct ofono_sim *sim)
>  			sim_msisdn_read_cb, sim);
>  }
>  
> +static void sim_efimg_read_cb(int ok, int length, int record,
> +				const unsigned char *data,
> +				int record_length, void *userdata)
> +{
> +	struct ofono_sim *sim = userdata;
> +	unsigned char *efimg;
> +	int num_records;
> +
> +	if (!ok)
> +		return;
> +
> +	num_records = length / record_length;
> +
> +	/*
> +	 * EFimg descriptors are 9 bytes long.
> +	 * Byte 1 of the record is the number of descriptors per record.
> +	 */
> +	if ((record_length % 9 != 2) && (record_length % 9 != 1))
> +		return;

You want to do this check in addition to ensuring record_length is at
least 10.  Right now records of size 1 and 2 pass this check...

Regards,
-Denis

  reply	other threads:[~2010-08-25 23:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-25 11:00 [PATCH v2 0/6] icon support patches Kristen Carlson Accardi
2010-08-25 11:00 ` [PATCH 1/6] simutil: add fileid for EFimg Kristen Carlson Accardi
2010-08-25 18:49   ` Denis Kenzior
2010-08-25 11:00 ` [PATCH 2/6] stkutil: change uint32_t to guint32 Kristen Carlson Accardi
2010-08-25 18:49   ` Denis Kenzior
2010-08-25 11:00 ` [PATCH 3/6] sim: read EFimg Kristen Carlson Accardi
2010-08-25 18:52   ` Denis Kenzior
2010-08-25 16:29     ` [PATCH 1/4] " Kristen Carlson Accardi
2010-08-25 23:39       ` Denis Kenzior [this message]
2010-08-26 14:20         ` Kristen Carlson Accardi
2010-08-26 23:45           ` Denis Kenzior
2010-08-25 11:00 ` [PATCH 4/6] sim: read EFiidf Kristen Carlson Accardi
2010-08-25 21:17   ` Denis Kenzior
2010-08-25 22:36     ` Kristen Carlson Accardi
2010-08-25 22:54       ` Denis Kenzior
2010-08-25 11:00 ` [PATCH 5/6] sim: implement GetIcon Kristen Carlson Accardi
2010-08-25 11:00 ` [PATCH 6/6] test: add get-icon script Kristen Carlson Accardi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C75A9AE.8070106@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.