# HG changeset patch
# User vladimir.korobov@infotecs.ru
# Date 1663930357 25200
#      Fri Sep 23 03:52:37 2022 -0700
# Node ID ee42d7efc9a683ac2ede996769ef413242ab2a5f
# Parent  ba5cf8f73a2d0a3615565bf9545f3d65216a0530
Fixed critical errors of the static analyzer.

diff -r ba5cf8f73a2d -r ee42d7efc9a6 src/event/ngx_event_udp.c
--- a/src/event/ngx_event_udp.c	Thu Sep 08 13:53:49 2022 +0400
+++ b/src/event/ngx_event_udp.c	Fri Sep 23 03:52:37 2022 -0700
@@ -182,8 +182,10 @@
             buf.last = buffer + n;
 
             rev = c->read;
-
-            c->udp->buffer = &buf;
+            
+            if (c->udp) {
+                c->udp->buffer = &buf;
+            }
 
             rev->ready = 1;
             rev->active = 0;
diff -r ba5cf8f73a2d -r ee42d7efc9a6 src/http/modules/ngx_http_proxy_module.c
--- a/src/http/modules/ngx_http_proxy_module.c	Thu Sep 08 13:53:49 2022 +0400
+++ b/src/http/modules/ngx_http_proxy_module.c	Fri Sep 23 03:52:37 2022 -0700
@@ -1485,9 +1485,11 @@
 
             continue;
         }
-
-        code = *(ngx_http_script_code_pt *) e.ip;
-        code((ngx_http_script_engine_t *) &e);
+        
+        if (*(uintptr_t *) e.ip) {
+            code = *(ngx_http_script_code_pt *) e.ip;
+            code((ngx_http_script_engine_t *) &e);
+        }
 
         *e.pos++ = ':'; *e.pos++ = ' ';
 
diff -r ba5cf8f73a2d -r ee42d7efc9a6 src/http/modules/ngx_http_scgi_module.c
--- a/src/http/modules/ngx_http_scgi_module.c	Thu Sep 08 13:53:49 2022 +0400
+++ b/src/http/modules/ngx_http_scgi_module.c	Fri Sep 23 03:52:37 2022 -0700
@@ -849,8 +849,10 @@
 #if (NGX_DEBUG)
             key = e.pos;
 #endif
-            code = *(ngx_http_script_code_pt *) e.ip;
-            code((ngx_http_script_engine_t *) &e);
+            if (*(uintptr_t *) e.ip) {
+                code = *(ngx_http_script_code_pt *) e.ip;
+                code((ngx_http_script_engine_t *) &e);
+            }
 
 #if (NGX_DEBUG)
             val = e.pos;
diff -r ba5cf8f73a2d -r ee42d7efc9a6 src/http/modules/ngx_http_try_files_module.c
--- a/src/http/modules/ngx_http_try_files_module.c	Thu Sep 08 13:53:49 2022 +0400
+++ b/src/http/modules/ngx_http_try_files_module.c	Fri Sep 23 03:52:37 2022 -0700
@@ -347,7 +347,7 @@
         }
     }
 
-    if (tf[i - 1].name.data[0] == '=') {
+    if (i != 0 && tf[i - 1].name.data[0] == '=') {
 
         code = ngx_atoi(tf[i - 1].name.data + 1, tf[i - 1].name.len - 2);
 
diff -r ba5cf8f73a2d -r ee42d7efc9a6 src/http/modules/ngx_http_uwsgi_module.c
--- a/src/http/modules/ngx_http_uwsgi_module.c	Thu Sep 08 13:53:49 2022 +0400
+++ b/src/http/modules/ngx_http_uwsgi_module.c	Fri Sep 23 03:52:37 2022 -0700
@@ -1066,8 +1066,10 @@
             *e.pos++ = (u_char) (key_len & 0xff);
             *e.pos++ = (u_char) ((key_len >> 8) & 0xff);
 
-            code = *(ngx_http_script_code_pt *) e.ip;
-            code((ngx_http_script_engine_t *) &e);
+            if (*(uintptr_t *) e.ip) {
+                code = *(ngx_http_script_code_pt *) e.ip;
+                code((ngx_http_script_engine_t *) &e);
+            }
 
             *e.pos++ = (u_char) (val_len & 0xff);
             *e.pos++ = (u_char) ((val_len >> 8) & 0xff);
diff -r ba5cf8f73a2d -r ee42d7efc9a6 src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c	Thu Sep 08 13:53:49 2022 +0400
+++ b/src/http/ngx_http_upstream.c	Fri Sep 23 03:52:37 2022 -0700
@@ -4576,8 +4576,10 @@
                 }
             }
         }
-
-        ngx_http_file_cache_free(r->cache, u->pipe->temp_file);
+        
+        if (u->pipe) {
+            ngx_http_file_cache_free(r->cache, u->pipe->temp_file);
+        }
     }
 
 #endif
