aboutsummaryrefslogtreecommitdiff
path: root/ssl
diff options
context:
space:
mode:
authorKurt Roeckx <kurt@roeckx.be>2015-01-24 14:46:50 +0100
committerKurt Roeckx <kurt@roeckx.be>2015-01-24 14:46:50 +0100
commit2747d73c1466c487daf64a1234b6fe2e8a62ac75 (patch)
treef862e6a4a3ecdd9d53ec8d7a6814d7271504043b /ssl
parentc963c421fb3d84ca3c86284593f0439f7c152f3e (diff)
downloadopenssl-2747d73c1466c487daf64a1234b6fe2e8a62ac75.zip
openssl-2747d73c1466c487daf64a1234b6fe2e8a62ac75.tar.gz
openssl-2747d73c1466c487daf64a1234b6fe2e8a62ac75.tar.bz2
Fix segfault with empty fields as last in the config.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssl_conf.c2
-rw-r--r--ssl/t1_lib.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/ssl/ssl_conf.c b/ssl/ssl_conf.c
index af88a47..354f218 100644
--- a/ssl/ssl_conf.c
+++ b/ssl/ssl_conf.c
@@ -167,6 +167,8 @@ static int ssl_set_option_list(const char *elem, int len, void *usr)
* len == -1 indicates not being called in list context, just for single
* command line switches, so don't allow +, -.
*/
+ if (elem == NULL)
+ return 0;
if (len != -1) {
if (*elem == '+') {
elem++;
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
index 8fb26a4..115aab5 100644
--- a/ssl/t1_lib.c
+++ b/ssl/t1_lib.c
@@ -596,6 +596,8 @@ static int nid_cb(const char *elem, int len, void *arg)
size_t i;
int nid;
char etmp[20];
+ if (elem == NULL)
+ return 0;
if (narg->nidcnt == MAX_CURVELIST)
return 0;
if (len > (int)(sizeof(etmp) - 1))
@@ -4001,6 +4003,8 @@ static int sig_cb(const char *elem, int len, void *arg)
size_t i;
char etmp[20], *p;
int sig_alg, hash_alg;
+ if (elem == NULL)
+ return 0;
if (sarg->sigalgcnt == MAX_SIGALGLEN)
return 0;
if (len > (int)(sizeof(etmp) - 1))