mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Fixed 32-bit overflow
This commit is contained in:
@@ -200,7 +200,7 @@ read_bd_stats (virConnectPtr conn, xenUnifiedPrivatePtr priv,
|
||||
* an assumed sector size.
|
||||
*/
|
||||
if (stats->rd_bytes > 0) {
|
||||
if (stats->rd_bytes >= 1L<<(63-9)) {
|
||||
if (stats->rd_bytes >= ((unsigned long long)1)<<(63-9)) {
|
||||
statsErrorFunc (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__,
|
||||
"stats->rd_bytes would overflow 64 bit counter",
|
||||
domid);
|
||||
@@ -209,7 +209,7 @@ read_bd_stats (virConnectPtr conn, xenUnifiedPrivatePtr priv,
|
||||
stats->rd_bytes *= 512;
|
||||
}
|
||||
if (stats->wr_bytes > 0) {
|
||||
if (stats->wr_bytes >= 1L<<(63-9)) {
|
||||
if (stats->wr_bytes >= ((unsigned long long)1)<<(63-9)) {
|
||||
statsErrorFunc (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__,
|
||||
"stats->wr_bytes would overflow 64 bit counter",
|
||||
domid);
|
||||
|
||||
Reference in New Issue
Block a user