Skip to content

Segmentation fault when calling getKeys after getting a variable from Redis when the serializer is enabled. #315

@niekie

Description

@niekie

When calling "getKeys" after a "get" call to fetch an item from the Redis database, a segmentation fault happens in the PHP process if the serializer is set to Redis::SERIALIZER_PHP.

The following 2 PHP interactive console sessions demonstrate the bug:

Interactive shell

php > $redis = new Redis;
php > $redis->connect('127.0.0.1', 6379);
php > print $redis -> get( 'hello' );
world
php > print_r( $redis -> getKeys( '*' ) );
Array
(
    [0] => hello
)
Interactive shell

php > $redis = new Redis;
php > $redis->connect('127.0.0.1', 6379);
php > $redis -> setOption( Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP );
php > print $redis -> get( 'hello' );
world
php > print_r( $redis -> getKeys( '*' ) );
Segmentation fault: 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions