1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

libcli/echo: validate the message length

metze
This commit is contained in:
Stefan Metzmacher 2012-09-21 22:18:10 +02:00
parent 83ed9b52e7
commit cc93a3004e

View File

@ -172,6 +172,11 @@ static void echo_request_done(struct tevent_req *subreq)
return; return;
} }
if (len != state->orig_len) {
tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
return;
}
state->message[len-1] = '\0'; state->message[len-1] = '\0';
/* Once the async function has completed, set tevent_req_done() */ /* Once the async function has completed, set tevent_req_done() */
tevent_req_done(req); tevent_req_done(req);