node-memcache
node-memcache copied to clipboard
should use 'END' + CRLF instead of 'END'
for codes like: buffer.indexOf('END')
if the data contains string like '*END' ,it will crash
I agree (mostly). I ran into this issue today when using this awesome module to read PHP sessions from a memcached server. If the session-string has a value containing the string "END" in it, then the session-string will be truncated, and nothing after the 'E' in 'END' will be passed to the callback. Instead of just looking for "END" or "END" + crlf' it might be best to look for the last occurrence of 'crlf + "END" + crlf inside of handle_get()