[libvirt PATCH 2/3] remote: fix null string specifier argument in remoteProbeSessionDriverFromBinary

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

 



Detected by gcc 11 -Wformat-overflow:
../src/remote/remote_sockets.c: In function ‘remoteProbeSessionDriverFromBinary’:
../src/util/virlog.h:79:5: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
   79 |     virLogMessage(src, VIR_LOG_DEBUG, filename, linenr, funcname, NULL, __VA_ARGS__)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/util/virlog.h:88:5: note: in expansion of macro ‘VIR_DEBUG_INT’
   88 |     VIR_DEBUG_INT(&virLogSelf, __FILE__, __LINE__, __func__, __VA_ARGS__)
      |     ^~~~~~~~~~~~~
../src/remote/remote_sockets.c:187:9: note: in expansion of macro ‘VIR_DEBUG’
  187 |         VIR_DEBUG("Probing driver '%s' via daemon %s", drivers[i], daemonpath);
      |         ^~~~~~~~~
../src/remote/remote_sockets.c:187:51: note: format string is defined here
  187 |         VIR_DEBUG("Probing driver '%s' via daemon %s", drivers[i], daemonpath);
      |                                                   ^~

Signed-off-by: Scott Davis <scott.davis@xxxxxxxxxx>
---
 src/remote/remote_sockets.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/remote/remote_sockets.c b/src/remote/remote_sockets.c
index c315b24d30..69e6c1e5b8 100644
--- a/src/remote/remote_sockets.c
+++ b/src/remote/remote_sockets.c
@@ -184,7 +184,7 @@ remoteProbeSessionDriverFromBinary(char **driver)
         g_autofree char *daemonpath = NULL;
 
         daemonname = g_strdup_printf("virt%sd", drivers[i]);
-        VIR_DEBUG("Probing driver '%s' via daemon %s", drivers[i], daemonpath);
+        VIR_DEBUG("Probing driver '%s' via daemon %s", drivers[i], daemonname);
 
         if (!(daemonpath = virFileFindResource(daemonname,
                                                abs_top_builddir "/src",
-- 
2.25.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux