Skip to content
Snippets Groups Projects
Commit d57ce450 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 10b679d8
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -342,7 +342,8 @@ static void internal_do_cryptInit(void)
cryptInit_error = CRYPT_ERROR_INVALID;
cryptlib_initialized = false;
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;
}
ret = cryptGetAttributeString(CRYPT_UNUSED, CRYPT_OPTION_INFO_PATCHES, patches, &stp);
......@@ -350,7 +351,8 @@ static void internal_do_cryptInit(void)
cryptInit_error = ret;
cryptlib_initialized = false;
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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment