Olaf Hering
2010-Nov-02 22:38 UTC
[Xen-devel] [PATCH] qemu/block-vvfat.c: fix warnings with _FORTIFY_SOURCE
In function ''snprintf'',
inlined from ''init_directories'' at block-vvfat.c:868:10,
inlined from ''vvfat_open'' at block-vvfat.c:1065:24:
/usr/include/bits/stdio2.h:65:3: warning: call to __builtin___snprintf_chk will
always overflow destination buffer
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
ioemu-remote/block-vvfat.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- xen-unstable.hg-4.1.22285.orig/ioemu-remote/block-vvfat.c
+++ xen-unstable.hg-4.1.22285/ioemu-remote/block-vvfat.c
@@ -865,7 +865,8 @@ static int init_directories(BDRVVVFATSta
{
direntry_t* entry=array_get_next(&(s->directory));
entry->attributes=0x28; /* archive | volume label */
- snprintf((char*)entry->name,11,"QEMU VVFAT");
+ memcpy(entry->name,"QEMU VVF",8);
+ memcpy(entry->extension,"AT",3);
}
/* Now build FAT, and write back information into directory */
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Ian Jackson
2010-Nov-03 12:50 UTC
Re: [Xen-devel] [PATCH] qemu/block-vvfat.c: fix warnings with _FORTIFY_SOURCE
Olaf Hering writes ("[Xen-devel] [PATCH] qemu/block-vvfat.c: fix warnings
with _FORTIFY_SOURCE"):> In function ''snprintf'',
> inlined from ''init_directories'' at
block-vvfat.c:868:10,
> inlined from ''vvfat_open'' at block-vvfat.c:1065:24:
> /usr/include/bits/stdio2.h:65:3: warning: call to __builtin___snprintf_chk
will always overflow destination buffer
Thanks, I have applied both of these patches to qemu-xen-unstable.
However: have you checked whether these problems exist in qemu
upstream ? With Anthony''s work on upstreaming Xen support in qemu
coming along well, we should be thinking about sending fixes like this
upstream.
When we switch to the upstream-based qemu we won''t want to carry a lot
of patches like this one.
Regards,
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Olaf Hering
2010-Nov-03 14:04 UTC
Re: [Xen-devel] [PATCH] qemu/block-vvfat.c: fix warnings with _FORTIFY_SOURCE
On Wed, Nov 03, Ian Jackson wrote:> However: have you checked whether these problems exist in qemu > upstream ? With Anthony''s work on upstreaming Xen support in qemu > coming along well, we should be thinking about sending fixes like this > upstream.The vvfat patch is already upstream, the other one should be there too. But I havent verified it, the website does not resolve for me right now. Olaf _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2010-Nov-03 16:54 UTC
Re: [Xen-devel] [PATCH] qemu/block-vvfat.c: fix warnings with _FORTIFY_SOURCE
Olaf Hering writes ("Re: [Xen-devel] [PATCH] qemu/block-vvfat.c: fix
warnings with _FORTIFY_SOURCE"):> On Wed, Nov 03, Ian Jackson wrote:
> > However: have you checked whether these problems exist in qemu
> > upstream ? With Anthony''s work on upstreaming Xen support in
qemu
> > coming along well, we should be thinking about sending fixes like this
> > upstream.
>
> The vvfat patch is already upstream, the other one should be there too.
> But I havent verified it, the website does not resolve for me right now.
Great, thanks. I guess in this case if it gets dropped the compiler
will tell us in due course.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel