Blame SOURCES/openssh-6.6p1-memory-problems.patch

b58e57
diff -up openssh-7.4p1/servconf.c.memory-problems openssh-7.4p1/servconf.c
b58e57
--- openssh-7.4p1/servconf.c.memory-problems	2017-02-09 10:41:42.483123417 +0100
b58e57
+++ openssh-7.4p1/servconf.c	2017-02-09 10:42:16.392102462 +0100
b58e57
@@ -2006,6 +2006,8 @@ copy_set_server_options(ServerOptions *d
b58e57
 		dst->n = src->n; \
b58e57
 } while (0)
b58e57
 
b58e57
+	u_int i;
b58e57
+
b58e57
 	M_CP_INTOPT(password_authentication);
b58e57
 	M_CP_INTOPT(gss_authentication);
b58e57
 	M_CP_INTOPT(pubkey_authentication);
b58e57
@@ -2058,8 +2060,10 @@ copy_set_server_options(ServerOptions *d
b58e57
 } while(0)
b58e57
 #define M_CP_STRARRAYOPT(n, num_n) do {\
b58e57
 	if (src->num_n != 0) { \
b58e57
+		for (i = 0; i < dst->num_n; i++) \
b58e57
+			free(dst->n[i]); \
b58e57
 		for (dst->num_n = 0; dst->num_n < src->num_n; dst->num_n++) \
b58e57
-			dst->n[dst->num_n] = xstrdup(src->n[dst->num_n]); \
b58e57
+			dst->n[dst->num_n] = src->n[dst->num_n]; \
b58e57
 	} \
b58e57
 } while(0)
b58e57
 
b58e57
diff -up openssh-7.4p1/sshd.c.memory-problems openssh-7.4p1/sshd.c