[Spice-devel] [PATCH v2 6/8] replay: Assure read_binary receives a NULL pointer

Frediano Ziglio fziglio at redhat.com
Thu Sep 15 22:19:38 UTC 2016


read_binary do not allocate a buffer for no-NULL pointers.
Avoid using uninitialized data and allocate proper buffer.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/red-replay-qxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/red-replay-qxl.c b/server/red-replay-qxl.c
index ef5569e..45c105c 100644
--- a/server/red-replay-qxl.c
+++ b/server/red-replay-qxl.c
@@ -1089,7 +1089,7 @@ static QXLUpdateCmd *red_replay_update_cmd(SpiceReplay *replay)
 
 static QXLMessage *red_replay_message(SpiceReplay *replay)
 {
-    QXLMessage *qxl;
+    QXLMessage *qxl = NULL;
     size_t size;
 
     read_binary(replay, "message", &size, (uint8_t**)&qxl, sizeof(QXLMessage));
-- 
2.7.4



More information about the Spice-devel mailing list