mirror of
https://github.com/openssl/openssl.git
synced 2025-02-23 14:42:15 +08:00
coverity 1462571 Dereference after null check
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11651)
This commit is contained in:
parent
67d744b933
commit
61cdc2a08d
@ -106,12 +106,15 @@ static int do_x509_ctrl_string(int (*ctrl)(void *object, int cmd,
|
|||||||
cmd = EVP_PKEY_CTRL_SET1_ID; /* ... except we put it in X509 */
|
cmd = EVP_PKEY_CTRL_SET1_ID; /* ... except we put it in X509 */
|
||||||
#endif
|
#endif
|
||||||
} else if (strcmp(stmp, "hexdistid") == 0) {
|
} else if (strcmp(stmp, "hexdistid") == 0) {
|
||||||
|
if (vtmp != NULL) {
|
||||||
|
void *hexid;
|
||||||
long hexid_len = 0;
|
long hexid_len = 0;
|
||||||
void *hexid = OPENSSL_hexstr2buf((const char *)vtmp, &hexid_len);
|
|
||||||
|
|
||||||
|
hexid = OPENSSL_hexstr2buf((const char *)vtmp, &hexid_len);
|
||||||
OPENSSL_free(stmp);
|
OPENSSL_free(stmp);
|
||||||
stmp = vtmp = hexid;
|
stmp = vtmp = hexid;
|
||||||
vtmp_len = (size_t)hexid_len;
|
vtmp_len = (size_t)hexid_len;
|
||||||
|
}
|
||||||
#ifdef EVP_PKEY_CTRL_SET1_ID
|
#ifdef EVP_PKEY_CTRL_SET1_ID
|
||||||
cmd = EVP_PKEY_CTRL_SET1_ID; /* ... except we put it in X509 */
|
cmd = EVP_PKEY_CTRL_SET1_ID; /* ... except we put it in X509 */
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user