DESCRIPTION

JVMCBC-359 Check for sane header values

Motivation
There was a recent bug seen where a memcached malformed packets came with
incorrect length and the client tried to allocate a large space in heap based
on incorrect length information and ran into OOM errors.

Changes
Added header checks for key value requests. If the response header is missing
required information throw a MalformedMemcacheHeader exception in
BinaryMemcacheResponseDecoder and bubble up the exception to Keyvalue Handler.
Close, reconnect the socket and then retry the request as something may be
wrong with the underlying socket that the network packets are getting corrupted.

Result
If a malformed response header arrives, the client will retry the request using
a new socket endpoint.

Change-Id: Ib00d58bd771e7e5eba267bd0407bf46087ab8bc4


COMMENTS

author: Marques Ellis
date: 2016-10-11 00:36:20.335000000

Uploaded patch set 4.

-------------------------------------
