Skip to content

Commit 69f52e8

Browse files
author
kalibera
committed
Avoid computer arithmetics with null pointer.
git-svn-id: https://svn.r-project.org/R/trunk@87508 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent abbebd3 commit 69f52e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/gnuwin32/dos_wglob.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,8 @@ glob0(const wchar_t *pattern, wglob_t *pglob)
598598
pglob->gl_flags = oldflags;
599599
return(globextend(qpat, pglob, &limit));
600600
}
601-
else if (!(pglob->gl_flags & GLOB_NOSORT))
601+
else if (!(pglob->gl_flags & GLOB_NOSORT) &&
602+
(pglob->gl_pathc - oldpathc) > 0)
602603
qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc,
603604
pglob->gl_pathc - oldpathc, sizeof(wchar_t *),
604605
(pglob->gl_flags & (GLOB_ALPHASORT|GLOB_NOCASE))

0 commit comments

Comments
 (0)