Skip to content

Commit b8c1d61

Browse files
committed
Fixed integer overflow while searching line character in xsrc
1 parent 9963772 commit b8c1d61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sys/xfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ static int XFile_CheckCriteria(xfile_search_t *pSearch, const char *pPath, const
12171217
return XSTDNON;
12181218
}
12191219

1220-
while (nPosit && pBuffer[nPosit] != '\n') nPosit--;
1220+
while (nPosit > 1 && pBuffer[nPosit] != '\n') nPosit--;
12211221
if (pBuffer[nPosit] == '\n') nPosit++;
12221222

12231223
int nEnd = xstrsrc(&pBuffer[nPosit], "\n");

0 commit comments

Comments
 (0)