[sr-dev] git:master: When string was in the form of 0= on\n\0 this function caused a segmentation fault(canaries where overwritten ).

Marius Zbihlei marius.zbihlei at 1and1.ro
Mon Oct 26 16:18:36 CET 2009


Module: sip-router
Branch: master
Commit: e6f4dafdc43d90e9679ad4695e9729379245984d
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e6f4dafdc43d90e9679ad4695e9729379245984d

Author: Marius Zbihlei <marius.zbihlei at 1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei at 1and1.ro>
Date:   Mon Oct 26 17:16:37 2009 +0200

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

---

 modules/utils/conf.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/modules/utils/conf.c b/modules/utils/conf.c
index 996d56c..9ffc61f 100644
--- a/modules/utils/conf.c
+++ b/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';
 }
 
 




More information about the sr-dev mailing list