Browse Source

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

Marius Zbihlei 16 years ago
parent
commit
e6f4dafdc4
1 changed files with 1 additions and 2 deletions
  1. 1 2
      modules/utils/conf.c

+ 1 - 2
modules/utils/conf.c

@@ -80,11 +80,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';
 }