* [PATCH] XEN: Make handle_vcpu_hotplug_event() to check the sscanf() return value
@ 2010-03-12 2:53 wzt.wzt
2010-03-13 0:39 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 2+ messages in thread
From: wzt.wzt @ 2010-03-12 2:53 UTC (permalink / raw)
To: linux-kernel; +Cc: xen-devel, jeremy
It seems handle_vcpu_hotplug_event() not check the sscanf() return value.
Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
---
drivers/xen/cpu_hotplug.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/xen/cpu_hotplug.c b/drivers/xen/cpu_hotplug.c
index 14e2d99..99773a6 100644
--- a/drivers/xen/cpu_hotplug.c
+++ b/drivers/xen/cpu_hotplug.c
@@ -69,8 +69,8 @@ static void handle_vcpu_hotplug_event(struct xenbus_watch *watch,
cpustr = strstr(node, "cpu/");
if (cpustr != NULL) {
- sscanf(cpustr, "cpu/%u", &cpu);
- vcpu_hotplug(cpu);
+ if (sscanf(cpustr, "cpu/%u", &cpu) == 1)
+ vcpu_hotplug(cpu);
}
}
--
1.6.5.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] XEN: Make handle_vcpu_hotplug_event() to check the sscanf() return value
2010-03-12 2:53 [PATCH] XEN: Make handle_vcpu_hotplug_event() to check the sscanf() return value wzt.wzt
@ 2010-03-13 0:39 ` Jeremy Fitzhardinge
0 siblings, 0 replies; 2+ messages in thread
From: Jeremy Fitzhardinge @ 2010-03-13 0:39 UTC (permalink / raw)
To: wzt.wzt; +Cc: linux-kernel, xen-devel, jeremy
On 03/11/2010 06:53 PM, wzt.wzt@gmail.com wrote:
> It seems handle_vcpu_hotplug_event() not check the sscanf() return value.
>
> Signed-off-by: Zhitong Wang<zhitong.wangzt@alibaba-inc.com>
>
Good catch, thanks.
J
> ---
> drivers/xen/cpu_hotplug.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/xen/cpu_hotplug.c b/drivers/xen/cpu_hotplug.c
> index 14e2d99..99773a6 100644
> --- a/drivers/xen/cpu_hotplug.c
> +++ b/drivers/xen/cpu_hotplug.c
> @@ -69,8 +69,8 @@ static void handle_vcpu_hotplug_event(struct xenbus_watch *watch,
>
> cpustr = strstr(node, "cpu/");
> if (cpustr != NULL) {
> - sscanf(cpustr, "cpu/%u",&cpu);
> - vcpu_hotplug(cpu);
> + if (sscanf(cpustr, "cpu/%u",&cpu) == 1)
> + vcpu_hotplug(cpu);
> }
> }
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-13 0:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-12 2:53 [PATCH] XEN: Make handle_vcpu_hotplug_event() to check the sscanf() return value wzt.wzt
2010-03-13 0:39 ` Jeremy Fitzhardinge
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).