[PATCH spice-gtk 1/2] usb-device-manager: Fix number truncation by spice_usb_device_get_busnum

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

 



"bus" field is 16 bit so returning using a guint8 type potentially
truncate the value.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 src/usb-device-manager-priv.h | 2 +-
 src/usb-device-manager.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/usb-device-manager-priv.h b/src/usb-device-manager-priv.h
index 66acf6d5..2530d294 100644
--- a/src/usb-device-manager-priv.h
+++ b/src/usb-device-manager-priv.h
@@ -29,7 +29,7 @@ G_BEGIN_DECLS
 void spice_usb_device_manager_device_error(
     SpiceUsbDeviceManager *manager, SpiceUsbDevice *device, GError *err);
 
-guint8 spice_usb_device_get_busnum(const SpiceUsbDevice *device);
+guint16 spice_usb_device_get_busnum(const SpiceUsbDevice *device);
 guint8 spice_usb_device_get_devaddr(const SpiceUsbDevice *device);
 guint16 spice_usb_device_get_vid(const SpiceUsbDevice *device);
 guint16 spice_usb_device_get_pid(const SpiceUsbDevice *device);
diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index 544e5687..a035683d 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -1490,7 +1490,7 @@ static SpiceUsbDevice *spice_usb_device_new(SpiceUsbBackendDevice *bdev)
     return info;
 }
 
-guint8 spice_usb_device_get_busnum(const SpiceUsbDevice *info)
+guint16 spice_usb_device_get_busnum(const SpiceUsbDevice *info)
 {
     const UsbDeviceInformation *b_info;
 
-- 
2.20.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]