Re: [PATCH 1/6] virNetDevBridgeGet: Avoid NULL dereference

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

 



On 31.05.2016 13:06, Peter Krempa wrote:
> On Tue, May 31, 2016 at 12:33:25 +0200, Michal Privoznik wrote:
>> It may happen, that this function would dereference a NULL
>> pointer:
>>
>> util/virnetdevbridge.c: In function 'virNetDevBridgeGetVlanFiltering':
>> util/virnetdevbridge.c:199:23: error: null pointer dereference [-Werror=null-dereference]
>>          ifr->ifr_data = (char*)&args;
>>          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
>>
>> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
>> ---
>>  src/util/virnetdevbridge.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> How about fixing the single caller that passes NULL in @ifr?
> 
> virNetDevBridgeGetVlanFiltering
> 

What about it? AFAIK, SIOCDEVPRIVATE ioctl is not able to tell us
whether vlan filtering is enabled. Therefore I don't see much sense in
providing a fd and ifreq struct just so that we can go through else
branch too.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]