nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.26k stars 322 forks source link

Avoid a segfault in nxt_conn_io_sendbuf() #1138

Closed ac000 closed 4 months ago

ac000 commented 4 months ago

This is a simple temporary fix (doesn't address the underlying problem) for an issue reported by a user on GitHub whereby downloading of files from a PHP application would cause the router process to crash.

This is actually a generic problem that will affect anything sending data via nxt_unit_response_write().

This is just a simple fix for the 1.32 release, after which the full correct fix will be worked out.

ac000 commented 4 months ago

Rebased with master and added Zhidao's Reviewed-by

$ git range-diff 1522a6df...30b410e4
-:  -------- > 1:  756feafd Node.js: Use console.warn instead of stderr.write
-:  -------- > 2:  ea239635 Docker: Switch python3.12 to using github
-:  -------- > 3:  0c983530 Node.js: Build/install fix
1:  1522a6df ! 4:  30b410e4 Avoid a segfault in nxt_conn_io_sendbuf()
    @@ Commit message
         Co-developed-by: rustedsword <https://github.com/rustedsword>
         Tested-by: rustedsword <https://github.com/rustedsword>
         Tested-by: Andrew Clayton <a.clayton@nginx.com>
    +    Reviewed-by: Zhidao Hong <z.hong@f5.com>
         Signed-off-by: Andrew Clayton <a.clayton@nginx.com>

      ## src/nxt_conn_write.c ##