The size is passed from the limited-privileges process.
This check ensures that the service won't allocate
more than needed.
Reported-by: Joshua Rogers <contact@joshua.hu>
Found-by: ZeroPath (https://zeropath.com/)
Change-Id: I75ebf01641db4dcd07041e3b8b3fa8a632d07595
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1331
Message-Id: <
20251030150432.4689-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34039.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
}
size = bytes / sizeof(*data);
- if (size == 0)
+ if ((size == 0) || (size > 4096)) /* our startup data is 1024 wchars at the moment */
{
- MsgToEventLog(M_SYSERR, L"malformed startup data: 1 byte received");
+ MsgToEventLog(M_SYSERR, L"malformed startup data: %lu bytes received", size);
ReturnError(pipe, ERROR_STARTUP_DATA, L"GetStartupData", 1, &exit_event);
goto err;
}