]> xenbits.xensource.com Git - libvirt.git/commit
virnetdevtap: Don't crash on !ifname in virNetDevTapInterfaceStats
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 13 Jul 2018 09:08:32 +0000 (11:08 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 13 Jul 2018 13:38:41 +0000 (15:38 +0200)
commit318d54e5201295239869655c2c60fb44d9d9466e
tree1682a8e1cf27d3ad05df06d2fe14d954eaf1b0f7
parent4085984889a2228164a7ef8af5f5026567a3d344
virnetdevtap: Don't crash on !ifname in virNetDevTapInterfaceStats

https://bugzilla.redhat.com/show_bug.cgi?id=1595184

Some domain <interfaces/> do not have a name (because they are
not TAP devices). Therefore, if
virNetDevTapInterfaceStats(net->ifname, ...) is called an instant
crash occurs. In Linux version of the function strlen() is called
over the name and in BSD version STREQ() is called.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/util/virnetdevtap.c