lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100312025324.GC2712@localhost.localdomain>
Date:	Fri, 12 Mar 2010 10:53:24 +0800
From:	wzt.wzt@...il.com
To:	linux-kernel@...r.kernel.org
Cc:	xen-devel@...ts.xensource.com, jeremy@...source.com
Subject: [PATCH] XEN: Make handle_vcpu_hotplug_event() to check the sscanf() return value

It seems handle_vcpu_hotplug_event() not check the sscanf() return value.

Signed-off-by: Zhitong Wang <zhitong.wangzt@...baba-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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ