Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v2 01/10] Add parser for items next action indicator objects
Date: Tue, 30 Mar 2010 10:28:46 -0500	[thread overview]
Message-ID: <201003301028.46334.denkenz@gmail.com> (raw)
In-Reply-To: <1269935857-4234-1-git-send-email-yang.gu@intel.com>

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

Hi Yang,

> +/* For data object that only has a byte array with variable length */
> +static gboolean parse_dataobj_common_byte_array(
> +			struct comprehension_tlv_iter *iter,
> +			enum stk_data_object_type type,
> +			unsigned char *array, unsigned int *array_len)
> +{
> +	const unsigned char *data;
> +	unsigned int len;
> +
> +	if (comprehension_tlv_iter_get_tag(iter) != type)
> +		return FALSE;
> +
> +	len = comprehension_tlv_iter_get_length(iter);
> +	if (len < 1)
> +		return FALSE;
> +
> +	data = comprehension_tlv_iter_get_data(iter);
> +	*array_len = len;
> +	memcpy(array, data, len);
> +
> +	return TRUE;
> +}
> +

So I can see the point of this function for a byte array that requires to be 
allocated.  For fixed size arrays this function is not adequate; it does not do 
length (boundary) checking for instance.

Regards,
-Denis

      parent reply	other threads:[~2010-03-30 15:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30  7:57 [PATCH v2 01/10] Add parser for items next action indicator objects Yang Gu
2010-03-30  7:57 ` [PATCH v2 02/10] Adjust the sequence of comprehension tlv structures Yang Gu
2010-03-30  7:57   ` [PATCH v2 03/10] Add parser for event list objects Yang Gu
2010-03-30  7:57     ` [PATCH v2 04/10] Add parser for cause objects Yang Gu
2010-03-30  7:57       ` [PATCH v2 05/10] Add parser for location status objects Yang Gu
2010-03-30  7:57         ` [PATCH v2 06/10] Add parser for transaction identifier objects Yang Gu
2010-03-30  7:57           ` [PATCH v2 07/10] Add parser for call control requested action objects Yang Gu
2010-03-30  7:57             ` [PATCH v2 08/10] Add enum for icon qualifier Yang Gu
2010-03-30  7:57               ` [PATCH v2 09/10] Adjust the sequence of icon identifier structure Yang Gu
2010-03-30  7:57                 ` [PATCH v2 10/10] Add parser for item icon identifier list objects Yang Gu
2010-03-30 15:04                 ` [PATCH v2 09/10] Adjust the sequence of icon identifier structure Denis Kenzior
2010-03-30 15:28 ` Denis Kenzior [this message]

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=201003301028.46334.denkenz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox