libcli/echo: fix off by 1 crash bug
authorStefan Metzmacher <metze@samba.org>
Sat, 11 Dec 2010 10:17:17 +0000 (11:17 +0100)
committerStefan Metzmacher <metze@samba.org>
Sat, 11 Dec 2010 12:48:54 +0000 (13:48 +0100)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sat Dec 11 13:48:54 CET 2010 on sn-devel-104

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);
 }