• antirez's avatar
    Fix getKeysUsingCommandTable() in the case of nagative arity. · f9c2c1ac
    antirez authored
    This fixes a crash with Redis Cluster when OBJECT is mis-used, because
    getKeysUsingCommandTable() will call serverPanic() detecting we are
    accessing an invalid argument in the case "OBJECT foo" is called.
    
    This bug was introduced when OBJECT HELP was introduced, because the key
    argument is set fixed at index 2 in the command table, however now
    OBJECT may be called with an insufficient number of arguments to extract
    the key.
    
    The "Right Thing" would be to have a specific function to extract keys
    from the OBJECT command, however this is kinda of an overkill, so I
    preferred to make getKeysUsingCommandTable() more robust and just return
    no keys when it's not possible to honor the command table, because new
    commands are often added and also there are a number with an HELP
    subcommand violating the normal form, and crashing for this trivial
    reason or having many command-specific key extraction functions is not
    great.
    f9c2c1ac
db.c 48.4 KB