@@ -1025,7 +1025,7 @@ static int unbind_usbintf(libxl__gc *gc, const char *intf)
goto out;
}
- if (libxl_write_exactly(CTX, fd, intf, sizeof(intf), path, intf)) {
+ if (libxl_write_exactly(CTX, fd, intf, strlen(intf), path, intf)) {
rc = ERROR_FAIL;
goto out;
}
@@ -1065,7 +1065,7 @@ static int bind_usbintf(libxl__gc *gc, const char *intf, const char *drvpath)
goto out;
}
- if (libxl_write_exactly(CTX, fd, intf, sizeof(intf), path, intf)) {
+ if (libxl_write_exactly(CTX, fd, intf, strlen(intf), path, intf)) {
rc = ERROR_FAIL;
goto out;
}
sizeof is wrongly used in libxl_write_exactly function, using strlen instead. CID: 1358110 CID: 1358109 Signed-off-by: Chunyan Liu <cyliu@suse.com> CC: Simon Cao <caobosimon@gmail.com> CC: George Dunlap <george.dunlap@citrix.com> CC: Ian Jackson <Ian.Jackson@eu.citrix.com> --- tools/libxl/libxl_pvusb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)