From: Chunyan Liu <cyliu@suse.com>
To: xen-devel@lists.xen.org
Cc: Simon Cao <caobosimon@gmail.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Chunyan Liu <cyliu@suse.com>,
George Dunlap <george.dunlap@citrix.com>
Subject: [PATCH 2/4] correct libxl_write_exactly sizeof
Date: Thu, 7 Apr 2016 17:40:26 +0800 [thread overview]
Message-ID: <1460022028-25174-3-git-send-email-cyliu@suse.com> (raw)
In-Reply-To: <1460022028-25174-1-git-send-email-cyliu@suse.com>
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(-)
diff --git a/tools/libxl/libxl_pvusb.c b/tools/libxl/libxl_pvusb.c
index 04e41b4..45117cf 100644
--- a/tools/libxl/libxl_pvusb.c
+++ b/tools/libxl/libxl_pvusb.c
@@ -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;
}
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-04-07 9:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-07 9:40 [PATCH 0/4] pvusb fixes Chunyan Liu
2016-04-07 9:40 ` [PATCH 1/4] a fix in libxl_device_usbdev_list Chunyan Liu
2016-04-07 16:45 ` Ian Jackson
2016-04-08 3:47 ` Chun Yan Liu
2016-04-08 13:28 ` Ian Jackson
2016-04-08 13:30 ` Ian Jackson
2016-04-07 16:50 ` Ian Jackson
2016-04-07 9:40 ` Chunyan Liu [this message]
2016-04-07 16:46 ` [PATCH 2/4] correct libxl_write_exactly sizeof Ian Jackson
2016-04-07 9:40 ` [PATCH 3/4] cleanup redundant lstat in libxl_pvusb.c Chunyan Liu
2016-04-07 16:47 ` Ian Jackson
2016-04-07 9:40 ` [PATCH 4/4] fix a pvusb type check Chunyan Liu
2016-04-07 9:47 ` Juergen Gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1460022028-25174-3-git-send-email-cyliu@suse.com \
--to=cyliu@suse.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=caobosimon@gmail.com \
--cc=george.dunlap@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).