Skip to content

Commit

Permalink
Replace malloc+strlcpy with strdup
Browse files Browse the repository at this point in the history
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
  • Loading branch information
ghedo authored and levitte committed Oct 23, 2015
1 parent 4428c7d commit 8acaabe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crypto/conf/conf_def.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,11 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
goto err;
}

section = OPENSSL_malloc(10);
section = BUF_strdup("default");
if (section == NULL) {
CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
goto err;
}
BUF_strlcpy(section, "default", 10);

if (_CONF_new_data(conf) == 0) {
CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
Expand Down

0 comments on commit 8acaabe

Please sign in to comment.