]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
x509: remove dead call to strlen()
authorPauli <pauli@openssl.org>
Mon, 8 Nov 2021 01:27:59 +0000 (11:27 +1000)
committerPauli <pauli@openssl.org>
Tue, 9 Nov 2021 10:02:14 +0000 (20:02 +1000)
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 https://github.com/openssl/openssl/pull/16987)

crypto/x509/v3_sxnet.c

index 3e5ae048be5bf549fdfde778875ca448a31a0e3b..4b19ce07d5389a86cf5bbcf158944a93a49f7480 100644 (file)
@@ -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;