| Message ID | 20251030150432.4689-1-gert@greenie.muc.de |
|---|---|
| State | New |
| Headers | show |
| Series | [Openvpn-devel,v1] interactive.c: add the upper bound for startupdata size | expand |
Looks good, reasonable hardening against unasked-for garbage coming in
via the service pipe. Have not tested this, but since you have so nicely
made event logging beautiful again, evidence should be clearly visible.
Your patch has been applied to the master branch.
commit 37af2c953266a3ffd34b3fa95317bd995e985aec
Author: Lev Stipakov
Date: Thu Oct 30 16:04:26 2025 +0100
interactive.c: add the upper bound for startupdata size
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>
--
kind regards,
Gert Doering
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index ce0d4dd..cb31267 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -446,9 +446,9 @@ } 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; }