Re: Possible NULL-pointer dereference in _g_file_attribute_value_as_string



On Fri, Jul 9, 2010 at 8:28 AM, Nikolai Weibull <now bitwi se> wrote:
> Hi!
>
> Since _g_file_attribute_value_set_from_pointer uses g_strdupv,
> value->u.stringv may be NULL. _as_string does a
>
> for (i = 0; attr->u.stringv[i] != NULL; i++)
>
> without first checking that attr->u.stringv isn’t NULL, a potential
> NULL-pointer dereference.
>
> Correct?

Technically correct. I think there is a general assumption that
attribute values are not NULL though. u.string being NULL would be bad
news e.g. for the byte string case, as well.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]