Skip to content
  • Stefan Weil's avatar
    ac149498
    Add G_GNUC_PRINTF to function qemu_set_info_str and fix related issues · ac149498
    Stefan Weil authored
    
    
    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, "");
    
    Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20221126152507.283271-7-sw@weilnetz.de>
    ac149498
    Add G_GNUC_PRINTF to function qemu_set_info_str and fix related issues
    Stefan Weil authored
    
    
    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, "");
    
    Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20221126152507.283271-7-sw@weilnetz.de>
Loading