summaryrefslogtreecommitdiff
path: root/debian/patches/0014-super-intel-Avoid-gcc-8.1-complaining-about-truncati.patch
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2018-06-26 15:38:57 +0100
committerDimitri John Ledkov <xnox@ubuntu.com>2018-06-26 15:38:57 +0100
commit9421e599c44cd50d3df4cd019cd3c53d9320e93d (patch)
tree2d9606679ad49fbc9f9cf72b3a3a87d7a6dc8fff /debian/patches/0014-super-intel-Avoid-gcc-8.1-complaining-about-truncati.patch
parentec9bfc63255cdf01a67171d1228f562c927c6d36 (diff)
Cherrypick master patches up to 4th of June 2018.debian/4.1_rc1-3archive/debian/4.1_rc1-3
Diffstat (limited to 'debian/patches/0014-super-intel-Avoid-gcc-8.1-complaining-about-truncati.patch')
-rw-r--r--debian/patches/0014-super-intel-Avoid-gcc-8.1-complaining-about-truncati.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/debian/patches/0014-super-intel-Avoid-gcc-8.1-complaining-about-truncati.patch b/debian/patches/0014-super-intel-Avoid-gcc-8.1-complaining-about-truncati.patch
new file mode 100644
index 00000000..fa3b1d0e
--- /dev/null
+++ b/debian/patches/0014-super-intel-Avoid-gcc-8.1-complaining-about-truncati.patch
@@ -0,0 +1,38 @@
+From 40659392ff90fc9c2861ec18c34ed1bdb54f92ca Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <jsorensen@fb.com>
+Date: Wed, 30 May 2018 11:56:37 -0400
+Subject: [PATCH 14/26] super-intel: Avoid gcc-8.1 complaining about truncating
+ snprintf()
+
+We know the max size of the volume name, so no need to play the
+snprintf() game.
+
+Signed-off-by: Jes Sorensen <jsorensen@fb.com>
+---
+ super-intel.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/super-intel.c b/super-intel.c
+index cc53f0fc..520d2921 100644
+--- a/super-intel.c
++++ b/super-intel.c
+@@ -9881,6 +9881,7 @@ static void imsm_process_update(struct supertype *st,
+ /* sanity check that we are not affecting the uuid of
+ * an active array
+ */
++ memset(name, 0, sizeof(name));
+ snprintf(name, MAX_RAID_SERIAL_LEN, "%s", (char *) u->name);
+ name[MAX_RAID_SERIAL_LEN] = '\0';
+ for (a = st->arrays; a; a = a->next)
+@@ -9892,7 +9893,7 @@ static void imsm_process_update(struct supertype *st,
+ break;
+ }
+
+- snprintf((char *) dev->volume, MAX_RAID_SERIAL_LEN, "%s", name);
++ memcpy(dev->volume, name, MAX_RAID_SERIAL_LEN);
+ super->updates_pending++;
+ break;
+ }
+--
+2.17.1
+