All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 1/3] stkutil: display text attributes as html
Date: Thu, 01 Jul 2010 13:54:16 -0500	[thread overview]
Message-ID: <4C2CE458.2080806@gmail.com> (raw)
In-Reply-To: <20100701112903.0d4cd35f@kcaccard-MOBL3>

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

Hi Kristen,

On 07/01/2010 01:29 PM, Kristen Carlson Accardi wrote:
> On Thu, 01 Jul 2010 11:30:07 -0500
> Denis Kenzior <denkenz@gmail.com> wrote:
> 
>>
>>> +		start = attrs[i++];
>>> +		len = attrs[i++];
>>> +		code = attrs[i++];
>>
>> You might want to be extra paranoid here that attrs_len is a multiple of 4.
> 
> attrs_len does not have to be a multiple of 4.  I will add a sanity
> check to attrs_len to make sure it is at least >= i + 3.
> 

Then this code is incorrect, as it handles len 3 attrs only at the end
of the array.  Also please note that SIM Toolkit Text Attributes are
always coded on 4 bytes (see 102.223 Section 8.72 for details).  You
might want to assume 4 byte alignment or invent a data structure for
these attributes.

>>
>>> +
>>> +		if (i < attrs_len)
>>> +			color = attrs[i++];
>>> +		else
>>> +			color = 0;
>>> +
>>> +		if (len == 0)
>>> +			end = text_len;
>>> +		else
>>> +			end = start + len;
>>> +
>>> +		/* sanity check values */
>>> +		if (start > end || end > text_len)
>>> +			continue;
>>> +
>>> +		/*
>>> +		 * if the alignment is the same as either the default
>>> +		 * or the last alignment used, don't set any alignment
>>> +		 * value.
>>> +		 */
>>> +		if (start == 0)
>>> +			align = STK_DEFAULT_TEXT_ALIGNMENT;
>>
>> Are attributes which do not contain start = 0 valid?  If so, you might
>> take extra care here.
> 
> Yes start can be nonzero, but I don't understand what you are asking here.
> If start is not equal to zero, we have already made sure it is not
> greater than the end.

I'm not seeing how align gets initialized properly if start != 0.

Regards,
-Denis

  reply	other threads:[~2010-07-01 18:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29 11:22 [PATCH 0/3] html text attribute patches Kristen Carlson Accardi
2010-06-29 11:22 ` [PATCH 1/3] stkutil: display text attributes as html Kristen Carlson Accardi
2010-07-01 16:30   ` Denis Kenzior
2010-07-01 18:29     ` Kristen Carlson Accardi
2010-07-01 18:54       ` Denis Kenzior [this message]
2010-07-01 20:54         ` Kristen Carlson Accardi
2010-07-01 21:15           ` Denis Kenzior
2010-07-01 22:56             ` Kristen Carlson Accardi
2010-07-01 23:08               ` Denis Kenzior
2010-07-01 23:05                 ` Kristen Carlson Accardi
2010-07-01 23:47                   ` Denis Kenzior
2010-07-01 22:10     ` Andrzej Zaborowski
2010-07-01 22:35       ` Denis Kenzior
2010-07-01 22:47         ` Andrzej Zaborowski
2010-07-01 22:50           ` Denis Kenzior
2010-06-29 11:22 ` [PATCH 2/3] test-stkutil: add unit test for html text attributes Kristen Carlson Accardi
2010-06-29 11:22 ` [PATCH 3/3] test-stkutil: add html attribute test for Display Text tests 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=4C2CE458.2080806@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.