Skip to content

Commit

Permalink
Fix ossl_param_bld_push_{utf8,octet}_string() / param_bld_convert()
Browse files Browse the repository at this point in the history
ossl_param_bld_push_{utf8,octet}_string() saved the constant string
pointer to a non-constant structure field, so we change that field to
a pointer to a constant.  We also modify param_bld_convert() to
pretend the resulting pointer for PTR types points to a constant as
well.

Completes #9649

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from #9651)
  • Loading branch information
levitte committed Aug 21, 2019
1 parent 5fa7789 commit d32d304
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crypto/param_build.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static OSSL_PARAM *param_bld_convert(OSSL_PARAM_BLD *bld, OSSL_PARAM *param,
} else if (pd->type == OSSL_PARAM_OCTET_PTR
|| pd->type == OSSL_PARAM_UTF8_PTR) {
/* PTR */
*(void **)p = pd->string;
*(const void **)p = pd->string;
} else if (pd->type == OSSL_PARAM_OCTET_STRING
|| pd->type == OSSL_PARAM_UTF8_STRING) {
if (pd->string != NULL)
Expand Down
2 changes: 1 addition & 1 deletion include/internal/param_build.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ typedef struct {
size_t size;
size_t alloc_blocks;
const BIGNUM *bn;
void *string;
const void *string;
union {
/*
* These fields are never directly addressed, but their sizes are
Expand Down

0 comments on commit d32d304

Please sign in to comment.