Module Name:    src
Committed By:   mrg
Date:           Mon Mar 14 05:06:59 UTC 2022

Modified Files:
        src/libexec/httpd: dir-index-bozo.c

Log Message:
check for scandir() returning -1.  should handle PR#56358.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/libexec/httpd/dir-index-bozo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/dir-index-bozo.c
diff -u src/libexec/httpd/dir-index-bozo.c:1.34 src/libexec/httpd/dir-index-bozo.c:1.35
--- src/libexec/httpd/dir-index-bozo.c:1.34	Thu Oct 15 02:19:23 2020
+++ src/libexec/httpd/dir-index-bozo.c	Mon Mar 14 05:06:59 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir-index-bozo.c,v 1.34 2020/10/15 02:19:23 mrg Exp $	*/
+/*	$NetBSD: dir-index-bozo.c,v 1.35 2022/03/14 05:06:59 mrg Exp $	*/
 
 /*	$eterna: dir-index-bozo.c,v 1.20 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -141,7 +141,7 @@ bozo_dir_index(bozo_httpreq_t *request, 
 		"<tbody>\r\n");
 
 	for (j = k = scandir(dirpath, &de, NULL, alphasort), deo = de;
-	    j--; de++) {
+	    j-- > 0; de++) {
 		int nostat = 0;
 		char *name = (*de)->d_name;
 		char *urlname, *htmlname;

Reply via email to