* [PATCH] xl: fix compiler warnings
@ 2011-12-02 14:42 Andre Przywara
2011-12-12 17:43 ` Ian Jackson
0 siblings, 1 reply; 2+ messages in thread
From: Andre Przywara @ 2011-12-02 14:42 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: xen-devel
[-- 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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xl: fix compiler warnings
2011-12-02 14:42 [PATCH] xl: fix compiler warnings Andre Przywara
@ 2011-12-12 17:43 ` Ian Jackson
0 siblings, 0 replies; 2+ messages in thread
From: Ian Jackson @ 2011-12-12 17:43 UTC (permalink / raw)
To: Andre Przywara; +Cc: xen-devel, Stefano Stabellini
Andre Przywara writes ("[Xen-devel] [PATCH] xl: fix compiler warnings"):
> 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.
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-12 17:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-02 14:42 [PATCH] xl: fix compiler warnings Andre Przywara
2011-12-12 17:43 ` Ian Jackson
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.