[Spice-commits] 2 commits - server/reds.c server/websocket.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 17 11:54:07 UTC 2019


 server/reds.c      |    8 ++++----
 server/websocket.h |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 642b1683ae77489c9423b57d1b2002ec39b4e662
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Wed Jul 17 12:32:23 2019 +0100

    websocket: Include proper type header
    
    inttypes.h contains macro for format string while
    stdint.h more specifically contains type definitions (like uint8_t).
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Uri Lublin <uril at redhat.com>

diff --git a/server/websocket.h b/server/websocket.h
index ec452038..4619836a 100644
--- a/server/websocket.h
+++ b/server/websocket.h
@@ -18,7 +18,7 @@
 #ifndef WEBSOCKET_H_
 #define WEBSOCKET_H_
 
-#include <inttypes.h>
+#include <stdint.h>
 
 #include "sys-socket.h"
 
commit 4894d58ace32730f7eb44e2cee129f9ac2b292b4
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Wed Jul 17 11:38:43 2019 +0100

    reds: Fix use-after-free
    
    video_codecs can be freed so use it before.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Uri Lublin <uril at redhat.com>

diff --git a/server/reds.c b/server/reds.c
index 817fdd42..78bbe5a0 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3851,6 +3851,10 @@ static int reds_set_video_codecs_from_string(RedsState *reds, const char *codecs
         codecs = c;
     }
 
+    if (installed) {
+        *installed = video_codecs->len;
+    }
+
     if (video_codecs->len == 0) {
         spice_warning("Failed to set video codecs, input string: '%s'", codecs);
         g_array_unref(video_codecs);
@@ -3860,10 +3864,6 @@ static int reds_set_video_codecs_from_string(RedsState *reds, const char *codecs
 
     g_free(codecs_copy);
 
-    if (installed) {
-        *installed = video_codecs->len;
-    }
-
     return invalid_codecs;
 }
 


More information about the Spice-commits mailing list