Skip to content

Commit 7562317

Browse files
committed
handle empty STATS key
1 parent 2b32140 commit 7562317

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

php_memcached_server.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,11 @@ protocol_binary_response_status s_stat_handler (const void *cookie, const void *
514514

515515
MEMC_MAKE_ZVAL_COOKIE(zcookie, cookie);
516516

517-
ZVAL_STRINGL(&zkey, key, key_len);
517+
if (key && key_len) {
518+
ZVAL_STRINGL(&zkey, key, key_len);
519+
} else {
520+
ZVAL_NULL(&zkey);
521+
}
518522
ZVAL_NULL(&zbody);
519523
ZVAL_MAKE_REF(&zbody);
520524

@@ -566,7 +570,6 @@ protocol_binary_response_status s_version_handler (const void *cookie,
566570
ZVAL_COPY(&params[1], &zversion);
567571

568572
retval = s_invoke_php_callback (&MEMC_GET_CB(MEMC_SERVER_ON_VERSION), params, 2);
569-
570573
if (retval == PROTOCOL_BINARY_RESPONSE_SUCCESS) {
571574
if (Z_TYPE(zversion) != IS_STRING) {
572575
convert_to_string(&zversion);

0 commit comments

Comments
 (0)