mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
BUG/MINOR: ssl: Check malloc return code
If malloc() can't allocate memory and return NULL, a segfaut will raises. This patch should be backported in the 1.6 and 1.5 version.
This commit is contained in:
parent
d44ea3f77c
commit
7a3bd3b9dc
1 changed files with 2 additions and 0 deletions
|
|
@ -1704,6 +1704,8 @@ static int ssl_sock_add_cert_sni(SSL_CTX *ctx, struct bind_conf *s, char *name,
|
|||
int j, len;
|
||||
len = strlen(name);
|
||||
sc = malloc(sizeof(struct sni_ctx) + len + 1);
|
||||
if (!sc)
|
||||
return order;
|
||||
for (j = 0; j < len; j++)
|
||||
sc->name.key[j] = tolower(name[j]);
|
||||
sc->name.key[len] = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue