Skip to content

Commit

Permalink
Fix incorrect result of rdb_increment on overflow
Browse files Browse the repository at this point in the history
The rdb_increment used to return err_status_ok when overflow has happened, which results in undesirable consequences in other parts of the code.
  • Loading branch information
Lastique authored Apr 24, 2017
1 parent 6cae683 commit f2ae5c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crypto/replay/rdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ rdb_add_index(rdb_t *rdb, uint32_t p_index) {
err_status_t
rdb_increment(rdb_t *rdb) {

if (rdb->window_start++ > 0x7fffffff)
if (rdb->window_start >= 0x7fffffff)
return err_status_key_expired;
++rdb->window_start;
return err_status_ok;
}

Expand Down

0 comments on commit f2ae5c3

Please sign in to comment.