https://git.reactos.org/?p=reactos.git;a=commitdiff;h=94f6db22d1c5a9e54eede4...
commit 94f6db22d1c5a9e54eede4abc1ddd9ab729bede2 Author: Serge Gautherie reactos-git_serge_171003@gautherie.fr AuthorDate: Sat Mar 7 13:20:28 2020 +0100 Commit: Victor Perevertkin victor@perevertkin.ru CommitDate: Wed Mar 25 08:52:28 2020 +0300
[PING] Do not abort (as OoM) when request size = 0 --- base/applications/network/ping/ping.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/base/applications/network/ping/ping.c b/base/applications/network/ping/ping.c index 435fe03f55b..17afdfc5738 100644 --- a/base/applications/network/ping/ping.c +++ b/base/applications/network/ping/ping.c @@ -418,19 +418,22 @@ static void Ping(void) { - PVOID ReplyBuffer = NULL; + PVOID ReplyBuffer; PVOID SendBuffer = NULL; DWORD ReplySize = 0; DWORD Status;
- SendBuffer = malloc(RequestSize); - if (SendBuffer == NULL) + if (RequestSize != 0) { - ConResPrintf(StdErr, IDS_NO_RESOURCES); - exit(1); - } + SendBuffer = malloc(RequestSize); + if (SendBuffer == NULL) + { + ConResPrintf(StdErr, IDS_NO_RESOURCES); + exit(1); + }
- ZeroMemory(SendBuffer, RequestSize); + ZeroMemory(SendBuffer, RequestSize); + }
if (Family == AF_INET6) {