Merge pull request #1571 from 7eRoM/bug/listpids_off_by_one

Fix off-by-one vulnerability of listpids
This commit is contained in:
DavidXanatos 2022-01-26 11:10:48 +01:00 committed by GitHub
commit 7206258abc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -922,7 +922,7 @@ void List_Process_Ids(void)
sprintf(msg, "%d\r\n", pid_count);
WriteFile(out, msg, strlen(msg), &len, NULL);
for (i = 0; i <= pid_count; ++i) {
for (i = 0; i < pid_count; ++i) {
sprintf(msg, "%d\r\n", pids[i]);
WriteFile(out, msg, strlen(msg), &len, NULL);
}