phpredis
phpredis copied to clipboard
Wrong usage of string length
Seems all string length uses int , which should introduce problems (segfault etc) after parameters parsing...
like:
/* {{{ proto array Redis::info() */
PHP_METHOD(Redis, info) {
zval *object;
RedisSock *redis_sock;
char *cmd, *opt = NULL;
int cmd_len, opt_len;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"O|s", &object, redis_ce, &opt, &opt_len)
== FAILURE)
{
RETURN_FALSE;
}
opt_len should be size_t here.
and actually, it's better to use zend_string instead ("S")...
thanks