Blame SOURCES/0173-bus-message-also-properly-copy-struct-signature-when.patch

a3e2b5
From 13993b51c5cab806d81a7305c895bafd4cd48876 Mon Sep 17 00:00:00 2001
a3e2b5
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
a3e2b5
Date: Sat, 11 Aug 2018 09:02:48 +0200
a3e2b5
Subject: [PATCH] bus-message: also properly copy struct signature when
a3e2b5
 skipping
a3e2b5
a3e2b5
The change is similar to that in the previous commit, but I don't have
a3e2b5
a reproducer / test case case for this one, so I'm keeping it seperate.
a3e2b5
a3e2b5
(cherry picked from commit 3d338a302f56c0ef0445660d9856794abe1af8b5)
a3e2b5
a3e2b5
Resolves: #1696224
a3e2b5
---
a3e2b5
 src/libsystemd/sd-bus/bus-message.c | 6 +++---
a3e2b5
 1 file changed, 3 insertions(+), 3 deletions(-)
a3e2b5
a3e2b5
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
a3e2b5
index 202f1aab30..e71d29f91d 100644
a3e2b5
--- a/src/libsystemd/sd-bus/bus-message.c
a3e2b5
+++ b/src/libsystemd/sd-bus/bus-message.c
a3e2b5
@@ -5036,9 +5036,9 @@ static int message_skip_fields(
a3e2b5
 
a3e2b5
                         assert(l >= 2);
a3e2b5
                         {
a3e2b5
-                                char sig[l-1], *s;
a3e2b5
-                                strncpy(sig, *signature + 1, l-1);
a3e2b5
-                                s = sig;
a3e2b5
+                                char sig[l + 1], *s = sig;
a3e2b5
+                                strncpy(sig, *signature + 1, l);
a3e2b5
+                                sig[l] = '\0';
a3e2b5
 
a3e2b5
                                 r = message_skip_fields(m, ri, (uint32_t) -1, (const char**) &s);
a3e2b5
                                 if (r < 0)