Skip to content

Commit

Permalink
fix(ob-sql-parser): ob-sql-parser's timeout setting may overflow (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
yhilmare authored Nov 22, 2023
1 parent 79d66ad commit 93ab846
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public TimeoutTokenStream(TokenSource tokenSource, long timeoutMillis) {
if (timeoutMillis <= 0) {
this.timeoutTimestamp = Long.MAX_VALUE;
} else {
this.timeoutTimestamp = System.currentTimeMillis() + timeoutMillis;
long target = System.currentTimeMillis() + timeoutMillis;
this.timeoutTimestamp = target < 0 ? Long.MAX_VALUE : target;
}
}

Expand Down

0 comments on commit 93ab846

Please sign in to comment.