Fixed busy-loop in WATCH command when adding public keys.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 8 Apr 2008 05:00:40 +0000 (08:00 +0300)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 8 Apr 2008 05:00:40 +0000 (08:00 +0300)
If the public key decoding failed the command ended up
decoding and failing the same public key for ever.

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;