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
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to