From: Martin Mares Date: Mon, 8 Jan 2001 11:13:01 +0000 (+0000) Subject: Fixed infinite recursion in password_same. X-Git-Tag: v1.2.0~478 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c6ce98b9d9b5c4970e902cf667c1ffb64f04a62;p=thirdparty%2Fbird.git Fixed infinite recursion in password_same. Pavel, please check. --- diff --git a/nest/password.c b/nest/password.c index c27062708..ba5d0e611 100644 --- a/nest/password.c +++ b/nest/password.c @@ -54,12 +54,19 @@ password_strncpy(char *to, char *from, int len) int password_same(struct password_item *old, struct password_item *new) { - if (old == new) - return 1; - if ((!old) || (!new)) - return 0; - return ((old->from == new->from) && - (old->to == new->to) && - (old->passive == new->passive) && - password_same(old, new)); + for(;;) + { + if (old == new) + return 1; + if (!old || !new) + return 0; + if (old->from != new->from || + old->to != new->to || + old->passive != new->passive || + old->id != new->id || + strcmp(old->password, new->password)) + return 0; + old = old->next; + new = new->next; + } }