Skip to content

Commit

Permalink
Avoid computer arithmetics with null pointer.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87508 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
kalibera committed Jan 2, 2025
1 parent abbebd3 commit 69f52e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gnuwin32/dos_wglob.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,8 @@ glob0(const wchar_t *pattern, wglob_t *pglob)
pglob->gl_flags = oldflags;
return(globextend(qpat, pglob, &limit));
}
else if (!(pglob->gl_flags & GLOB_NOSORT))
else if (!(pglob->gl_flags & GLOB_NOSORT) &&
(pglob->gl_pathc - oldpathc) > 0)
qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc,
pglob->gl_pathc - oldpathc, sizeof(wchar_t *),
(pglob->gl_flags & (GLOB_ALPHASORT|GLOB_NOCASE))
Expand Down

0 comments on commit 69f52e8

Please sign in to comment.