jonathancammack / rpms / openssh

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