Skip to content

Commit

Permalink
Merge pull request #293 from Lastique/patch-1
Browse files Browse the repository at this point in the history
Fix incorrect result of rdb_increment on overflow
  • Loading branch information
pabuhler authored May 2, 2017
2 parents 6cae683 + f2ae5c3 commit fffad9f
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 fffad9f

Please sign in to comment.