[nginx] SSL: fixed $ssl_curves allocation error handling.

Sergey Kandaurov pluknet at nginx.com
Tue Jan 30 15:18:55 UTC 2024


details:   https://hg.nginx.org/nginx/rev/43fc897bbab8
branches:  
changeset: 9206:43fc897bbab8
user:      Sergey Kandaurov <pluknet at nginx.com>
date:      Tue Jan 30 19:18:31 2024 +0400
description:
SSL: fixed $ssl_curves allocation error handling.

diffstat:

 src/event/ngx_event_openssl.c |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (13 lines):

diff -r 4a3aa287704f -r 43fc897bbab8 src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c	Tue Jan 30 19:14:16 2024 +0400
+++ b/src/event/ngx_event_openssl.c	Tue Jan 30 19:18:31 2024 +0400
@@ -5187,6 +5187,9 @@ ngx_ssl_get_curves(ngx_connection_t *c, 
     }
 
     curves = ngx_palloc(pool, n * sizeof(int));
+    if (curves == NULL) {
+        return NGX_ERROR;
+    }
 
     n = SSL_get1_curves(c->ssl->connection, curves);
     len = 0;


More information about the nginx-devel mailing list