From: Andre Przywara <andre.przywara@amd.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] xl: fix compiler warnings
Date: Fri, 2 Dec 2011 15:42:07 +0100 [thread overview]
Message-ID: <4ED8E3BF.6050509@amd.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 549 bytes --]
Hi,
either GCC 4.6.1 or Ubuntu add -Werror=format-security to the -Wall set,
so libxl compilation breaks:
libxl_create.c: In function 'store_libxl_entry':
libxl_create.c:454:9: error: format not a string literal and no
format arguments [-Werror=format-security]
cc1: all warnings being treated as errors
attached patch fixes this and another occurrence.
Patch from: Uwe Dannowski
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Regards,
Andre.
--
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
[-- Attachment #2: libxl_sprintf_security.patch --]
[-- Type: text/x-patch, Size: 1311 bytes --]
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index ce6a55e..6486156 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -461,7 +461,7 @@ static int store_libxl_entry(libxl__gc *gc, uint32_t domid,
path = libxl__xs_libxl_path(gc, domid);
path = libxl__sprintf(gc, "%s/dm-version", path);
- return libxl__xs_write(gc, XBT_NULL, path, libxl__strdup(gc,
+ return libxl__xs_write(gc, XBT_NULL, path, "%s", libxl__strdup(gc,
libxl_device_model_version_to_string(dm_info->device_model_version)));
}
diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index a53fb70..1db395c 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -516,7 +516,7 @@ int libxl__devices_destroy(libxl__gc *gc, uint32_t domid, int force)
for (j = 0; j < num_devs; j++) {
path = libxl__sprintf(gc, "/local/domain/%d/device/%s/%s/backend",
domid, kinds[i], devs[j]);
- path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, path));
+ path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s", path));
if (path && libxl__parse_backend_path(gc, path, &dev) == 0) {
dev.domid = domid;
dev.kind = kind;
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2011-12-02 14:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-02 14:42 Andre Przywara [this message]
2011-12-12 17:43 ` [PATCH] xl: fix compiler warnings Ian Jackson
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=4ED8E3BF.6050509@amd.com \
--to=andre.przywara@amd.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.