Skip to content

Keys and Values are improperly constrained to type String #11

@jereynolds

Description

@jereynolds

The following function implicitly constrains the data type of cache keys and values to String. Memcache and the binary SASL protocol support both keys and values of arbitrary type since they are binary formats. The client library should not assume that these items are strings.

protected function _build_request($data)
{
$valuelength = $extralength = $keylength = 0;
if (array_key_exists('extra', $data)) {
$extralength = strlen($data['extra']);
}
if (array_key_exists('key', $data)) {
$keylength = strlen($data['key']);
}
if (array_key_exists('value', $data)) {
$valuelength = strlen($data['value']);
}
...
...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions