Fixed busy-loop in WATCH command when adding public keys.
[silc.git] / apps / silcd / command.c
index 12b5ce26236161276a37e780c79a47e9cfa6d1b1..f9b723afacd003664e6680656e0b2f86129825cd 100644 (file)
@@ -4370,8 +4370,10 @@ SILC_SERVER_CMD_FUNC(watch)
 
     pk = silc_argument_get_next_arg(pkargs, &type, &pk_len);
     while (pk) {
-      if (!silc_public_key_payload_decode(pk, pk_len, &public_key))
+      if (!silc_public_key_payload_decode(pk, pk_len, &public_key)) {
+        pk = silc_argument_get_next_arg(pkargs, &type, &pk_len);
        continue;
+      }
       if (type == 0x03)
         type = 0x00;