Skip to content

Commit

Permalink
Fix #2149.
Browse files Browse the repository at this point in the history
  • Loading branch information
twose committed Nov 26, 2018
1 parent a431eaf commit 9c073f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion swoole_redis_coro.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4159,7 +4159,8 @@ static void swoole_redis_coro_parse_result(swRedisClient *redis, zval* return_va
{
redis->context->err = SW_REDIS_ERR_OTHER;
}
memcpy(redis->context->errstr, reply->str, strlen(reply->str));
size_t str_len = strlen(reply->str);
memcpy(redis->context->errstr, reply->str, MIN(str_len, sizeof(redis->context->errstr)-1));
}
zend_update_property_long(swoole_redis_coro_class_entry_ptr, redis->object, ZEND_STRL("errCode"), redis->context->err);
zend_update_property_string(swoole_redis_coro_class_entry_ptr, redis->object, ZEND_STRL("errMsg"), redis->context->errstr);
Expand Down

0 comments on commit 9c073f6

Please sign in to comment.