diff options
author | dormando <dormando@rydia.net> | 2012-01-26 12:36:07 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2012-01-26 12:36:07 -0800 |
commit | 29bfd5a17fd35de1d044eba9c17fe84a0b3b58ff (patch) | |
tree | 495347865896b345dc0d398b1b75b568df5fb975 | |
parent | c0387e3268a27925ccc5919add9559dbd749f760 (diff) | |
download | memcached-29bfd5a17fd35de1d044eba9c17fe84a0b3b58ff.tar.gz |
fix segfault when sending a zero byte command
echo "" | nc localhost 11211 would segfault the server
simple fix is to add the proper token check to the one place it's missing.
-rw-r--r-- | memcached.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/memcached.c b/memcached.c index 33d3e80..8d4c3d7 100644 --- a/memcached.c +++ b/memcached.c @@ -3329,7 +3329,7 @@ static void process_command(conn *c, char *command) { conn_set_state(c, conn_closing); - } else if (strcmp(tokens[COMMAND_TOKEN].value, "slabs") == 0) { + } else if (ntokens > 1 && strcmp(tokens[COMMAND_TOKEN].value, "slabs") == 0) { if (ntokens == 5 && strcmp(tokens[COMMAND_TOKEN + 1].value, "reassign") == 0) { int src, dst, rv; |