Browse Source

Add missing BUF_strdup failure checks.

Change-Id: I997e8806b0bccb58fe7b8bbea4e98c68d0925361
Reviewed-on: https://boringssl-review.googlesource.com/4513
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 9 years ago
committed by Adam Langley
parent
commit
de95d262ab
2 changed files with 8 additions and 0 deletions
  1. +6
    -0
      crypto/bio/connect.c
  2. +2
    -0
      crypto/x509v3/v3_utl.c

+ 6
- 0
crypto/bio/connect.c View File

@@ -430,11 +430,17 @@ static long conn_ctrl(BIO *bio, int cmd, long num, void *ptr) {
OPENSSL_free(data->param_hostname);
}
data->param_hostname = BUF_strdup(ptr);
if (data->param_hostname == NULL) {
ret = 0;
}
} else if (num == 1) {
if (data->param_port != NULL) {
OPENSSL_free(data->param_port);
}
data->param_port = BUF_strdup(ptr);
if (data->param_port == NULL) {
ret = 0;
}
} else {
ret = 0;
}


+ 2
- 0
crypto/x509v3/v3_utl.c View File

@@ -262,6 +262,8 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line)
int state;
/* We are going to modify the line so copy it first */
linebuf = BUF_strdup(line);
if (linebuf == NULL)
goto err;
state = HDR_NAME;
ntmp = NULL;
/* Go through all characters */


Loading…
Cancel
Save