Skip to content

Invoking JedisConnection.expire during transaction/pipelining can cause NPE [DATAREDIS-564] #1139

@spring-projects-issues

Description

@spring-projects-issues

Mark Paluch opened DATAREDIS-564 and commented

A NullPointerException can occur when calling JedisConnection.expire during a transaction or pipelining and seconds is greater than Integer.MAX_VALUE. This is, because a call to time() and using the result without checking the result.

Jedis' expire method accepts only int so pExpire delegates to pExpireAt if seconds is greater than Integer.MAX_VALUE. pExpireAt requires a timestamp that is calculated by calling time() and adding the number of seconds to the timestamp.

This issue could be fixed by using pExpire as Jedis now accepts long types in pexpire.


Affects: 1.5.2 (Fowler SR2)

Issue Links:

Referenced from: pull request #228

Backported to: 1.8 GA (Ingalls), 1.7.7 (Hopper SR7)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions