File: bug61-empty-file-segfault.test

package info (click to toggle)
nginx 1.18.0-6.1%2Bdeb11u3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 19,344 kB
  • sloc: ansic: 250,653; perl: 7,548; sh: 1,408; ruby: 879; python: 358; makefile: 338; awk: 36; cpp: 18
file content (16 lines) | stat: -rw-r--r-- 439 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /bin/bash
cat <<---
Bug #61: Listing a directory with an empty file crashes Nginx
https://github.com/aperezdc/ngx-fancyindex/issues/61
--

# Prepare an empty directory with an empty file
mkdir -p "${TESTDIR}/bug61"
touch "${TESTDIR}/bug61/bug61.txt"

nginx_start 'fancyindex_exact_size off;'
content=$(fetch /bug61/)
test -n "${content}" || fail "Empty response"
echo "Response:"
echo "${content}"
nginx_is_running || fail "Nginx died"