qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-7.2] Add G_GNUC_PRINTF to function qemu_set_info_str and


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH for-7.2] Add G_GNUC_PRINTF to function qemu_set_info_str and fix related issues
Date: Tue, 15 Nov 2022 12:10:00 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 15/11/22 08:19, Stefan Weil via wrote:
With the G_GNUC_PRINTF function attribute the compiler detects
two potential insecure format strings:

../../../net/stream.c:248:31: warning: format string is not a string literal 
(potentially insecure) [-Wformat-security]
     qemu_set_info_str(&s->nc, uri);
                               ^~~
../../../net/stream.c:322:31: warning: format string is not a string literal 
(potentially insecure) [-Wformat-security]
     qemu_set_info_str(&s->nc, uri);
                               ^~~

There are also two other warnings:

../../../net/socket.c:182:35: warning: zero-length gnu_printf format string 
[-Wformat-zero-length]
   182 |         qemu_set_info_str(&s->nc, "");
       |                                   ^~
../../../net/stream.c:170:35: warning: zero-length gnu_printf format string 
[-Wformat-zero-length]
   170 |         qemu_set_info_str(&s->nc, "");

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
  include/net/net.h | 3 ++-
  net/socket.c      | 2 +-
  net/stream.c      | 6 +++---
  3 files changed, 6 insertions(+), 5 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]