[server] fix minor CLANG static analyzer bugs
authorMichael Rash <mbr@cipherdyne.org>
Fri, 26 Apr 2013 01:29:37 +0000 (21:29 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Fri, 26 Apr 2013 01:29:37 +0000 (21:29 -0400)
These are simple logic fixes that would not have impacted run time to address
the following warnings generated by the CLANG static analyzer:

incoming_spa.c:433:17: warning: Value stored to 'attempted_decrypt' is never read
                attempted_decrypt = 1;
                ^                   ~
incoming_spa.c:647:13: warning: Value stored to 'acc' is never read
            acc = acc->next;
            ^     ~~~~~~~~~

server/incoming_spa.c

index 11ef13f..9d05e91 100644 (file)
@@ -430,7 +430,7 @@ incoming_spa(fko_srv_options_t *opts)
                 res = fko_new_with_data(&ctx, (char *)spa_pkt->packet_data, NULL,
                         0, FKO_ENC_MODE_ASYMMETRIC, acc->hmac_key,
                         acc->hmac_key_len, acc->hmac_type);
-                attempted_decrypt = 1;
+
                 if(res != FKO_SUCCESS)
                 {
                     log_msg(LOG_WARNING,
@@ -644,7 +644,6 @@ incoming_spa(fko_srv_options_t *opts)
 
             if(ctx != NULL)
                 fko_destroy(ctx);
-            acc = acc->next;
             break;
         }