]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Password WALK_LIST bugfix.
authorOndrej Filip <feela@network.cz>
Thu, 1 Jul 2004 15:01:26 +0000 (15:01 +0000)
committerOndrej Filip <feela@network.cz>
Thu, 1 Jul 2004 15:01:26 +0000 (15:01 +0000)
nest/password.c

index 6309602369ecdfd24aebe121470b1567dca6f027..0bc38f108d77059539d0644e871722fe0405a38c 100644 (file)
@@ -18,10 +18,13 @@ password_find(list *l)
 {
   struct password_item *pi;
 
-  WALK_LIST(pi, *l)
+  if (l)
   {
-    if ((pi->genfrom > now) && (pi->gento < now))
-      return pi;
+    WALK_LIST(pi, *l)
+    {
+      if ((pi->genfrom > now) && (pi->gento < now))
+        return pi;
+    }
   }
   return NULL;
 }
@@ -29,6 +32,6 @@ password_find(list *l)
 void password_cpy(char *dst, char *src, int size)
 {
   bzero(dst, size);
-  memcpy(dst, src, strlen(src) < size ? strlen(src) : size);
+  memcpy(dst, src, strlen(src) < (unsigned) size ? strlen(src) : (unsigned) size);
 }