summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorderaadt <>2015-04-30 15:28:03 +0000
committerderaadt <>2015-04-30 15:28:03 +0000
commitc19b01be46eebe1dbd5e0a633c2df35bd557ece8 (patch)
tree5dbbead2a58b780d074080a834ebb07d64b278f4
parentcf34713cd683bb40529f80a7460a5d0c1466ea3f (diff)
downloadopenbsd-c19b01be46eebe1dbd5e0a633c2df35bd557ece8.tar.gz
openbsd-c19b01be46eebe1dbd5e0a633c2df35bd557ece8.tar.bz2
openbsd-c19b01be46eebe1dbd5e0a633c2df35bd557ece8.zip
use strdup() to init string
ok doug millert
-rw-r--r--src/lib/libcrypto/conf/conf_def.c5
-rw-r--r--src/lib/libssl/src/crypto/conf/conf_def.c5
2 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c
index e608e5fe9d..5526fa5c03 100644
--- a/src/lib/libcrypto/conf/conf_def.c
+++ b/src/lib/libcrypto/conf/conf_def.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_def.c,v 1.29 2015/02/07 13:19:15 doug Exp $ */ 1/* $OpenBSD: conf_def.c,v 1.30 2015/04/30 15:28:03 deraadt Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -228,12 +228,11 @@ def_load_bio(CONF *conf, BIO *in, long *line)
228 goto err; 228 goto err;
229 } 229 }
230 230
231 section = malloc(10); 231 section = strdup("default");
232 if (section == NULL) { 232 if (section == NULL) {
233 CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); 233 CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
234 goto err; 234 goto err;
235 } 235 }
236 strlcpy(section, "default",10);
237 236
238 if (_CONF_new_data(conf) == 0) { 237 if (_CONF_new_data(conf) == 0) {
239 CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); 238 CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
diff --git a/src/lib/libssl/src/crypto/conf/conf_def.c b/src/lib/libssl/src/crypto/conf/conf_def.c
index e608e5fe9d..5526fa5c03 100644
--- a/src/lib/libssl/src/crypto/conf/conf_def.c
+++ b/src/lib/libssl/src/crypto/conf/conf_def.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_def.c,v 1.29 2015/02/07 13:19:15 doug Exp $ */ 1/* $OpenBSD: conf_def.c,v 1.30 2015/04/30 15:28:03 deraadt Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -228,12 +228,11 @@ def_load_bio(CONF *conf, BIO *in, long *line)
228 goto err; 228 goto err;
229 } 229 }
230 230
231 section = malloc(10); 231 section = strdup("default");
232 if (section == NULL) { 232 if (section == NULL) {
233 CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); 233 CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
234 goto err; 234 goto err;
235 } 235 }
236 strlcpy(section, "default",10);
237 236
238 if (_CONF_new_data(conf) == 0) { 237 if (_CONF_new_data(conf) == 0) {
239 CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); 238 CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);