From cc93a3004e1f7a38e7519ecd124a1ce6a21ffe1c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 21 Sep 2012 22:18:10 +0200 Subject: libcli/echo: validate the message length metze --- libcli/echo/echo.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libcli') diff --git a/libcli/echo/echo.c b/libcli/echo/echo.c index b6005cb32c..0f5f7f77b1 100644 --- a/libcli/echo/echo.c +++ b/libcli/echo/echo.c @@ -172,6 +172,11 @@ static void echo_request_done(struct tevent_req *subreq) return; } + if (len != state->orig_len) { + tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE); + return; + } + state->message[len-1] = '\0'; /* Once the async function has completed, set tevent_req_done() */ tevent_req_done(req); -- cgit