{"action":"opened","issue":{"url":"https://api.github.com/repos/php-memcached-dev/php-memcached/issues/188","labels_url":"https://api.github.com/repos/php-memcached-dev/php-memcached/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/php-memcached-dev/php-memcached/issues/188/comments","events_url":"https://api.github.com/repos/php-memcached-dev/php-memcached/issues/188/events","html_url":"https://github.com/php-memcached-dev/php-memcached/issues/188","id":108510578,"number":188,"title":"php_memc_*_impl wrongly return MEMCACHED_BAD_KEY_PROVIDED when whitespace in key in binary mode","user":{"login":"dfuhry","id":5598310,"avatar_url":"https://avatars.githubusercontent.com/u/5598310?v=3","gravatar_id":"","url":"https://api.github.com/users/dfuhry","html_url":"https://github.com/dfuhry","followers_url":"https://api.github.com/users/dfuhry/followers","following_url":"https://api.github.com/users/dfuhry/following{/other_user}","gists_url":"https://api.github.com/users/dfuhry/gists{/gist_id}","starred_url":"https://api.github.com/users/dfuhry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfuhry/subscriptions","organizations_url":"https://api.github.com/users/dfuhry/orgs","repos_url":"https://api.github.com/users/dfuhry/repos","events_url":"https://api.github.com/users/dfuhry/events{/privacy}","received_events_url":"https://api.github.com/users/dfuhry/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-27T03:24:26Z","updated_at":"2015-09-27T03:24:26Z","closed_at":null,"body":"The php_memcached.c php_memc_*_impl() functions perform the below check, which is correct in non-binary mode, but incorrect in binary mode:\r\n    if (key_len == 0 || strchr(key, ' ')) {\r\n       i_obj->rescode = MEMCACHED_BAD_KEY_PROVIDED;\r\n       RETURN_FALSE;\r\n    }\r\nIn binary mode, spaces are allowed in keys, so the strchr call should be skipped.\r\n\r\nAlso to be completely correct for non-binary mode, I guess it should check for any whitespace character (tab, etc.; not just space). I do not care about this last point for my current purposes though."}}