From: Maxim Nestratov Date: Tue, 29 Nov 2016 18:07:38 +0000 (+0300) Subject: vz: change printing format specifier for network statistics X-Git-Tag: CVE-2017-2635~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99fb668ede605ea9c9c940d6d8f6324b11327416;p=thirdparty%2Flibvirt.git vz: change printing format specifier for network statistics This is necessary to be able to get statistics for venet0 or "host-routed" adapter, which has -1 index and thus, its statistics is shown as "net.nic4294967295". Signed-off-by: Maxim Nestratov --- diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index f89d3e69b8..3f46de7081 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -4517,7 +4517,7 @@ prlsdkGetNetStats(PRL_HANDLE sdkstats, PRL_HANDLE sdkdom, const char *path, prlsdkCheckRetGoto(pret, cleanup); #define PRLSDK_GET_NET_COUNTER(VAL, NAME) \ - if (virAsprintf(&name, "net.nic%d.%s", net_index, NAME) < 0) \ + if (virAsprintf(&name, "net.nic%u.%s", net_index, NAME) < 0) \ goto cleanup; \ if (prlsdkExtractStatsParam(sdkstats, name, &stats->VAL) < 0) \ goto cleanup; \