diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-09-21 22:18:10 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2012-09-28 09:23:08 +0200 |
commit | 036c23a33a8420d4529094adb29f03f587c30dfc (patch) | |
tree | d6a58502a850b1967d1bddcf1ef736c7173cabb6 | |
parent | 350d5ecc91c5d66db5b48500058c117380852f59 (diff) | |
download | samba-036c23a33a8420d4529094adb29f03f587c30dfc.tar.gz |
libcli/echo: validate the message length
metze
-rw-r--r-- | libcli/echo/echo.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libcli/echo/echo.c b/libcli/echo/echo.c index b6005cb32c0..0f5f7f77b16 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); |