Skip to content
Snippets Groups Projects
Commit bffceeba authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

asprintf() on Linux does not guarantee to set the ptr to NULL on error.

parent 4677e092
Branches
Tags
No related merge requests found
Pipeline #5702 passed
...@@ -342,7 +342,8 @@ static void internal_do_cryptInit(void) ...@@ -342,7 +342,8 @@ static void internal_do_cryptInit(void)
cryptInit_error = CRYPT_ERROR_INVALID; cryptInit_error = CRYPT_ERROR_INVALID;
cryptlib_initialized = false; cryptlib_initialized = false;
cryptEnd(); cryptEnd();
asprintf(&cryptfail, "Incorrect cryptlib version %d (expected %d)", tmp, CRYPTLIB_VERSION); if (asprintf(&cryptfail, "Incorrect cryptlib version %d (expected %d)", tmp, CRYPTLIB_VERSION) == -1)
cryptfail = NULL;
return; return;
} }
ret = cryptGetAttributeString(CRYPT_UNUSED, CRYPT_OPTION_INFO_PATCHES, patches, &stp); ret = cryptGetAttributeString(CRYPT_UNUSED, CRYPT_OPTION_INFO_PATCHES, patches, &stp);
...@@ -350,7 +351,8 @@ static void internal_do_cryptInit(void) ...@@ -350,7 +351,8 @@ static void internal_do_cryptInit(void)
cryptInit_error = ret; cryptInit_error = ret;
cryptlib_initialized = false; cryptlib_initialized = false;
cryptEnd(); cryptEnd();
asprintf(&cryptfail, "Incorrect cryptlib patch set %.32s (expected %s)", patches, CRYPTLIB_PATCHES); if (asprintf(&cryptfail, "Incorrect cryptlib patch set %.32s (expected %s)", patches, CRYPTLIB_PATCHES) == -1)
cryptfail = NULL;
return; return;
} }
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment