Skip to content

Commit ac3236f

Browse files
committed
src/ngx_http_lua_ssl_certby.c: fix possible null pointer dereference found by coverity
deref_ptr: Directly dereferencing pointer c. 419 if (c->addr_text.len) { 420 p = ngx_snprintf(buf, len, ", client: %V", &c->addr_text); 421 len -= p - buf; 422 buf = p; 423 } 424 CID 149837 (openresty#1 of 1): Dereference before null check (REVERSE_INULL)check_after_deref: Null-checking c suggests that it may be null, but it has already been dereferenced on all paths leading to the check. 425 if (c && c->listening && c->listening->addr_text.len) { 426 p = ngx_snprintf(buf, len, ", server: %V", &c->listening->addr_text); 427 /* len -= p - buf; */ 428 buf = p; 429 }
1 parent d062170 commit ac3236f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ngx_http_lua_ssl_certby.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ ngx_http_lua_log_ssl_cert_error(ngx_log_t *log, u_char *buf, size_t len)
416416

417417
c = log->data;
418418

419-
if (c->addr_text.len) {
419+
if (c && c->addr_text.len) {
420420
p = ngx_snprintf(buf, len, ", client: %V", &c->addr_text);
421421
len -= p - buf;
422422
buf = p;

0 commit comments

Comments
 (0)