From: Seven Du Date: Sun, 7 Sep 2014 03:45:12 +0000 (+0800) Subject: fix incorrect string termination X-Git-Tag: v1.4.8~2^2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e07845f2d57f7e633ae4097f3eae55d363a723f;p=thirdparty%2Ffreeswitch.git fix incorrect string termination if read multi times when waiting for a slow client, then bytes is much shorter than datalen so it could incorrectly terminate the string and data could be lost --- diff --git a/src/mod/endpoints/mod_verto/ws.c b/src/mod/endpoints/mod_verto/ws.c index 70c91fb59c..6e91ff6493 100644 --- a/src/mod/endpoints/mod_verto/ws.c +++ b/src/mod/endpoints/mod_verto/ws.c @@ -264,7 +264,7 @@ int ws_handshake(wsh_t *wsh) goto err; } - *(wsh->buffer+bytes) = '\0'; + *(wsh->buffer + wsh->datalen) = '\0'; if (strncasecmp(wsh->buffer, "GET ", 4)) { goto err;