2
0
Эх сурвалжийг харах

When string was in the form of 0=on\n\0 this function caused a segmentation fault(canaries where overwritten).
(cherry picked from commit e6f4dafdc43d90e9679ad4695e9729379245984d)

Marius Zbihlei 16 жил өмнө
parent
commit
4e49d033a4
1 өөрчлөгдсөн 1 нэмэгдсэн , 2 устгасан
  1. 1 2
      modules/utils/conf.c

+ 1 - 2
modules/utils/conf.c

@@ -76,11 +76,10 @@ static void remove_spaces(char *s)
 {
 	char *p, *dst;
 
-	for (p = s, dst = s; *p != '\0'; ++p, ++dst) {
+	for (p = s, dst = s; *dst != '\0'; ++p, ++dst) {
 		while (isspace(*p)) ++p;
 		*dst = *p;
 	}
-	*dst = '\0';
 }