libcli/echo: fix off by 1 crash bug
[metze/samba/wip.git] / libcli / echo / echo.c
index 46d1e28b36a55794fd8ad1613dc9cfeaa8aaefd4..271f71b0ae82a937c3a4845dedee824057fc0e21 100644 (file)
@@ -172,7 +172,7 @@ static void echo_request_done(struct tevent_req *subreq)
                return;
        }
 
-       state->message[len] = '\0';
+       state->message[len-1] = '\0';
        /* Once the async function has completed, set tevent_req_done() */
        tevent_req_done(req);
 }