nhttpd: fix stack buffer overflow

Origin commit data
------------------
Branch: ni/coolstream
Commit: 8303352925
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2018-11-30 (Fri, 30 Nov 2018)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2018-11-30 17:54:11 +01:00
committed by vanhofen
parent dd363a0cb8
commit f88ef1c054

View File

@@ -486,7 +486,8 @@ std::string CySocket::ReceiveLine() {
else
break;
}
buffer[++bytes_gotten] = '\0';
if (bytes_gotten < MAX_LINE_BUFFER - 1)
buffer[++bytes_gotten] = '\0';
result.assign(buffer, bytes_gotten);
return result;