Prevent infinite for loop since i went from ssize_t to size_t.  Patch from
eagleoflqj via OpenSSH github PR#178, ok djm@, feedback & ok millert@
This commit is contained in:
Darren Tucker 2020-04-21 18:27:23 +10:00
Родитель d00d07b674
Коммит 8854724cce
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -1,4 +1,4 @@
/* $OpenBSD: glob.c,v 1.48 2019/02/04 16:45:40 millert Exp $ */
/* $OpenBSD: glob.c,v 1.49 2020/04/21 08:25:22 dtucker Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@ -833,7 +833,7 @@ globextend(const Char *path, glob_t *pglob, struct glob_lim *limitp,
if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {
/* first time around -- clear initial gl_offs items */
pathv += pglob->gl_offs;
for (i = pglob->gl_offs; --i >= 0; )
for (i = pglob->gl_offs; i > 0; i--)
*--pathv = NULL;
}
pglob->gl_pathv = pathv;
@ -845,7 +845,7 @@ globextend(const Char *path, glob_t *pglob, struct glob_lim *limitp,
if (pglob->gl_statv == NULL && pglob->gl_offs > 0) {
/* first time around -- clear initial gl_offs items */
statv += pglob->gl_offs;
for (i = pglob->gl_offs; --i >= 0; )
for (i = pglob->gl_offs; i > 0; i--)
*--statv = NULL;
}
pglob->gl_statv = statv;