#4379 new defect

crypt-sha512.c: Constant variable guards dead code

Reported by: Ryan Long Owned by:
Priority: normal Milestone: 6.1
Component: lib Version: 6
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

CID 1018087: Constant variable guards dead code in crypt_sha512_r().

   assignment: Assigning: copied_salt = NULL.
 77        copied_salt = NULL;
.
.
.
276                memset(copied_key, '\0', key_len);
   null: At condition copied_salt != NULL, the value of copied_salt must be NULL.
   dead_error_condition: The condition copied_salt != NULL cannot be true.
277        if (copied_salt != NULL)

CID 1018088: Constant variable guards dead code in crypt_sha512_r().

 75
   assignment: Assigning: copied_key = NULL.
 76        copied_key = NULL;
.
.
.
274        memset(&alt_ctx, '\0', sizeof(alt_ctx));
   null: At condition copied_key != NULL, the value of copied_key must be NULL.
   dead_error_condition: The condition copied_key != NULL cannot be true.
275        if (copied_key != NULL)

Change History (1)

comment:1 Changed on Apr 7, 2021 at 1:05:48 PM by Ryan Long

These variables/checks are no longer in this code according to the source code of the latest stable release https://cgit.freebsd.org/src/tree/lib/libcrypt/crypt-sha512.c?h=stable/13#n71.

Note: See TracTickets for help on using tickets.