[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [libvirt] [PATCH] remote_internal.c: don't dereference a NULL "conn"
- From: Daniel Veillard <veillard redhat com>
- To: Jim Meyering <jim meyering net>
- Cc: Libvirt <libvir-list redhat com>
- Subject: Re: [libvirt] [PATCH] remote_internal.c: don't dereference a NULL "conn"
- Date: Wed, 2 Sep 2009 12:23:41 +0200
On Wed, Sep 02, 2009 at 11:58:07AM +0200, Jim Meyering wrote:
> Here's the test just before the else-if in the patch below:
>
> if (conn &&
> conn->driver &&
> STREQ (conn->driver->name, "remote")) {
>
> So, in the else-branch, "conn" is guaranteed to be NULL.
> And dereferenced.
>
> This may be only a theoretical risk, but if so,
> the test of "conn" above should be changed to an assertion,
> and/or the parameter should get the nonnull attribute.
I'm fine with your patch, so that even if code around changes
having a gard is IMHO a good thing
ACK
thanks !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]