* Returns : void
*
*********************************************************************/
-void save_connection_destination(jb_socket sfd,
- const struct http_request *http,
- const struct forward_spec *fwd,
- struct reusable_connection *server_connection)
+static void save_connection_destination(jb_socket sfd,
+ const struct http_request *http,
+ const struct forward_spec *fwd,
+ struct reusable_connection *server_connection)
{
assert(sfd != JB_INVALID_SOCKET);
assert(NULL != http->host);
/* Move beyond the chunkdata. */
p += 2 + chunksize;
+ /* Make sure we're still within the buffer and have two bytes left */
+ if (p + 2 > iob->eod)
+ {
+ return CHUNK_STATUS_MISSING_DATA;
+ }
+
/* There should be another "\r\n" to skip */
if (memcmp(p, "\r\n", 2))
{