From c47aef193f1b568a34f8ac818d0af743c9ef13e9 Mon Sep 17 00:00:00 2001 From: "Yichun Zhang (agentzh)" Date: Tue, 31 May 2016 15:45:49 -0700 Subject: [PATCH] bugfix: applied the patch for nginx security advisory (CVE-2016-4450) to the nginx 1.9.15 core. --- patches/patch.2016.write.txt | 14 ++++++++++++++ util/mirror-tarballs | 7 +++++++ 2 files changed, 21 insertions(+) create mode 100644 patches/patch.2016.write.txt diff --git a/patches/patch.2016.write.txt b/patches/patch.2016.write.txt new file mode 100644 index 0000000..789501d --- /dev/null +++ b/patches/patch.2016.write.txt @@ -0,0 +1,14 @@ +--- src/os/unix/ngx_files.c ++++ src/os/unix/ngx_files.c +@@ -356,6 +356,11 @@ + n = 0; + + for ( /* void */ ; cl; cl = cl->next) { ++ ++ if (ngx_buf_special(cl->buf)) { ++ continue; ++ } ++ + size = cl->buf->last - cl->buf->pos; + + if (prev == cl->buf->pos) { diff --git a/util/mirror-tarballs b/util/mirror-tarballs index 1c234b3..10da984 100755 --- a/util/mirror-tarballs +++ b/util/mirror-tarballs @@ -46,6 +46,13 @@ if [ "$answer" = "N" ]; then echo "$info_txt applying the patch for nginx security advisory (CVE-2016-4450)" patch -p0 < $root/patches/patch.2016.write2.txt || exit 1 echo +else + answer=`$root/util/ver-ge "$main_ver" 1.10.1` + if [ "$answer" = "N" ]; then + echo "$info_txt applying the patch for nginx security advisory (CVE-2016-4450)" + patch -p0 < $root/patches/patch.2016.write.txt || exit 1 + echo + fi fi echo "$info_txt applying the upstream-pipelining patch for nginx"