[libdmapsharing/LIBDMAPSHARING_3_0] Fix size of array to match received string



commit 00cf08da2f973f1279393d0a5e21cc4418400878
Author: W. Michael Petullo <mike flyn org>
Date:   Tue Jun 30 13:58:58 2020 -0400

    Fix size of array to match received string

 libdmapsharing/dmap-structure.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/libdmapsharing/dmap-structure.c b/libdmapsharing/dmap-structure.c
index c8e10c6..2092463 100644
--- a/libdmapsharing/dmap-structure.c
+++ b/libdmapsharing/dmap-structure.c
@@ -911,10 +911,11 @@ dmap_content_code_string_as_int32 (const gchar * str)
        union
        {
                gint32 i;
-               gchar str[4];
+               gchar str[5];
        } u;
 
        strncpy (u.str, str, 4);
+       u.str[4] = 0x00;
 
        return g_htonl (u.i);
 }


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