chiark / gitweb /
virt: add comment that we need to use sscanf()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 Jan 2018 14:00:39 +0000 (23:00 +0900)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:50:09 +0000 (07:50 +0200)
Follow-up for 13e0f9fe8334859ee86f4ff725374d1d83f5baf7.
See PR #7890 and comment in PR #7581.

src/basic/virt.c

index 4c3791381a5176f86997a4ee85805e786747ca45..bb6b70f98e101aa74a31ee298107bdac5d080052 100644 (file)
@@ -223,6 +223,8 @@ static int detect_vm_xen_dom0(void) {
         if (r == 0) {
                 unsigned long features;
 
+                /* Here, we need to use sscanf() instead of safe_atoul()
+                 * as the string lacks the leading "0x". */
                 r = sscanf(domcap, "%lx", &features);
                 if (r == 1) {
                         r = !!(features & (1U << XENFEAT_dom0));