Re: Possible NULL-pointer dereference in _g_file_attribute_value_as_string
- From: Matthias Clasen <matthias clasen gmail com>
- To: Nikolai Weibull <now bitwi se>
- Cc: Gtk+ Developers <gtk-devel-list gnome org>
- Subject: Re: Possible NULL-pointer dereference in _g_file_attribute_value_as_string
- Date: Fri, 9 Jul 2010 09:16:25 -0400
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]