Commit 8c6ce98b authored by Martin Mareš's avatar Martin Mareš

Fixed infinite recursion in password_same.

Pavel, please check.
parent 32749f49
......@@ -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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment