[Spice-devel] [usbredir v1] usbredirhost: avoid access to null pointer

Victor Toso victortoso at redhat.com
Wed Aug 3 16:59:32 UTC 2016


Another coverity complain.
---
 usbredirhost/usbredirhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c
index 22c5e39..7d57d40 100644
--- a/usbredirhost/usbredirhost.c
+++ b/usbredirhost/usbredirhost.c
@@ -160,7 +160,7 @@ va_log(struct usbredirhost *host, int level, const char *fmt, ...)
     va_list ap;
     int n;
 
-    if (level > host->verbose) {
+    if (host == NULL || level > host->verbose) {
         return;
     }
 
-- 
2.7.4



More information about the Spice-devel mailing list