fix terminating message buffer with \0

sayer/1.4-spce2.6
Stefan Sayer 16 years ago
parent afbad3b310
commit 1b48f2f46f

@ -196,8 +196,10 @@ int JsonrpcNetstringsConnection::netstringsRead() {
// DBG("received '%.*s'\n", rcvd_size, msgbuf);
if (rcvd_size == msg_size+1) {
if (msgbuf[msg_size] == ',')
if (msgbuf[msg_size] == ',') {
msgbuf[msg_size+1] = '\0';
return DISPATCH;
}
INFO("Protocol error on connection [%p/%d]: netstring not terminated with ','\n",
this, fd);
close();

Loading…
Cancel
Save