summaryrefslogtreecommitdiffstats
path: root/main/usbredir/Initialize-usb_redir_hello_header-to-0-in-usbredirparser_init.patch
blob: 30f2842f510e92bef16d0561938d959b9b718a1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 95aef51fa3efb7ae5722afc429665f9a0d0af154 Mon Sep 17 00:00:00 2001
From: Christophe Fergeau <cfergeau@redhat.com>
Date: Thu, 20 Nov 2014 18:01:27 +0100
Subject: Initialize usb_redir_hello_header to 0 in usbredirparser_init

This fixes this valgrind warning during virt-viewer startup:

==29279== Uninitialised byte(s) found during client check request
==29279==    at 0x5C85FCD: usbredirparser_queue (usbredirparser.c:1154)
==29279==    by 0x5C83E5F: usbredirparser_init (usbredirparser.c:185)
==29279==    by 0x5A79BA9: usbredirhost_open_full (usbredirhost.c:739)
==29279==    by 0x573E462: spice_usbredir_channel_set_context (channel-usbredir.c:212)
==29279==    by 0x57439CA: channel_new (usb-device-manager.c:738)
==29279==    by 0x3E1980FD34: g_closure_invoke (gclosure.c:768)
==29279==    by 0x3E19821A41: signal_emit_unlocked_R (gsignal.c:3553)
==29279==    by 0x3E1982A180: g_signal_emit_valist (gsignal.c:3309)
==29279==    by 0x3E1982A3AE: g_signal_emit (gsignal.c:3365)
==29279==    by 0x571A1F2: spice_session_channel_new (spice-session.c:1939)
==29279==    by 0x571BAD9: spice_channel_constructed (spice-channel.c:142)
==29279==    by 0x3E198154F3: g_object_new_internal (gobject.c:1814)
==29279==  Address 0x115bc729 is 41 bytes inside a block of size 80 alloc'd
==29279==    at 0x4A06BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==29279==    by 0x5C85E56: usbredirparser_queue (usbredirparser.c:1132)
==29279==    by 0x5C83E5F: usbredirparser_init (usbredirparser.c:185)
==29279==    by 0x5A79BA9: usbredirhost_open_full (usbredirhost.c:739)
==29279==    by 0x573E462: spice_usbredir_channel_set_context (channel-usbredir.c:212)
==29279==    by 0x57439CA: channel_new (usb-device-manager.c:738)
==29279==    by 0x3E1980FD34: g_closure_invoke (gclosure.c:768)
==29279==    by 0x3E19821A41: signal_emit_unlocked_R (gsignal.c:3553)
==29279==    by 0x3E1982A180: g_signal_emit_valist (gsignal.c:3309)
==29279==    by 0x3E1982A3AE: g_signal_emit (gsignal.c:3365)
==29279==    by 0x571A1F2: spice_session_channel_new (spice-session.c:1939)
==29279==    by 0x571BAD9: spice_channel_constructed (spice-channel.c:142)
=

diff --git a/usbredirparser/usbredirparser.c b/usbredirparser/usbredirparser.c
index 2cebada..8076b72 100644
--- a/usbredirparser/usbredirparser.c
+++ b/usbredirparser/usbredirparser.c
@@ -161,7 +161,7 @@ void usbredirparser_init(struct usbredirparser *parser_pub,
 {
     struct usbredirparser_priv *parser =
         (struct usbredirparser_priv *)parser_pub;
-    struct usb_redir_hello_header hello;
+    struct usb_redir_hello_header hello = { { 0 }, };
 
     parser->flags = (flags & ~usbredirparser_fl_no_hello);
     if (parser->callb.alloc_lock_func) {
-- 
cgit v0.10.2