Skip to content

Commit

Permalink
p_get_params() [test/p_test.c]: clear the OSSL_PARAM buffers for ever…
Browse files Browse the repository at this point in the history
…y test

Fixes openssl#8796

Reviewed-by: Paul Dale <[email protected]>
(Merged from openssl#8851)
  • Loading branch information
levitte committed May 1, 2019
1 parent b6a07f6 commit 1ccf497
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/p_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ static int p_get_params(void *vprov, const OSSL_PARAM params[])

for (; ok && p->key != NULL; p++) {
if (strcmp(p->key, "greeting") == 0) {
static char *opensslv = NULL;
static char *provname = NULL;
static char *greeting = NULL;
static OSSL_PARAM counter_request[] = {
static char *opensslv;
static char *provname;
static char *greeting;
static const OSSL_PARAM counter_request[] = {
/* Known libcrypto provided parameters */
{ "openssl-version", OSSL_PARAM_UTF8_PTR,
&opensslv, sizeof(&opensslv), NULL },
Expand All @@ -74,6 +74,8 @@ static int p_get_params(void *vprov, const OSSL_PARAM params[])
char buf[256];
size_t buf_l;

opensslv = provname = greeting = NULL;

if (c_get_params(prov, counter_request)) {
if (greeting) {
strcpy(buf, greeting);
Expand Down

0 comments on commit 1ccf497

Please sign in to comment.