Skip to content

Commit

Permalink
x509: remove dead call to strlen()
Browse files Browse the repository at this point in the history
The condition `userlen == -1` isn't possible because this is already checked
on line 159 above and the subsequent strlen(3) call guarantees that it's value
is positive.

Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
(Merged from #16987)
  • Loading branch information
paulidale committed Nov 9, 2021
1 parent 64c428c commit a18cdd2
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions crypto/x509/v3_sxnet.c
Expand Up @@ -177,8 +177,6 @@ int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, const char *user,

if ((id = SXNETID_new()) == NULL)
goto err;
if (userlen == -1)
userlen = strlen(user);

if (!ASN1_OCTET_STRING_set(id->user, (const unsigned char *)user, userlen))
goto err;
Expand Down

0 comments on commit a18cdd2

Please sign in to comment.