File: 0003-gcc8.patch

package info (click to toggle)
infinipath-psm 3.3%2B20.604758e7-6.4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,508 kB
  • sloc: ansic: 34,260; makefile: 359; asm: 47; sh: 18
file content (29 lines) | stat: -rw-r--r-- 857 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Author: Reiner Herrmann <reiner@reiner-h.de>
Description: Fix build with gcc 8
 - psm_utils.c: reserve enough memory for both input strings and the fixed part
 - psm_ep.c: e has sufficient space to copy including the NULL terminator,
             which fixes a warning about truncation of the input string
Bug-Debian: https://bugs.debian.org/897774

--- a/psm_ep.c
+++ b/psm_ep.c
@@ -1349,7 +1349,7 @@
 
     b_new = (char *) devstr;
     e = b_new + len;
-    strncpy(e, devstring, len-1);
+    strncpy(e, devstring, len);
     e[len-1] = '\0';
     ee = e + len;
     i = 0;
--- a/psm_utils.c
+++ b/psm_utils.c
@@ -955,7 +955,7 @@
 	union psmi_envvar_val env_fi;
 	char fvals_str[128];
 	char fname[128];
-	char fdesc[256];
+	char fdesc[300];
 
 	snprintf(fvals_str, sizeof fvals_str - 1, "%d:%d:1", num, denom);
 	fvals_str[sizeof fvals_str - 1] = '\0';