Skip to content

Commit 55b4e46

Browse files
author
D. Richard Hipp
committed
Limit the size of the exponent input in the second argument to the
ieee754() SQL function, to avoid integer overflow. Ticket [22dea1cfdb9151e4].
1 parent 2f0ab90 commit 55b4e46

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/misc/ieee754.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@ static void ieee754func(
167167
int isNeg = 0;
168168
m = sqlite3_value_int64(argv[0]);
169169
e = sqlite3_value_int64(argv[1]);
170+
171+
/* Limit the range of e. Ticket 22dea1cfdb9151e4 2021-03-02 */
172+
if( e>10000 ){
173+
e = 10000;
174+
}else if( e<-10000 ){
175+
e = -10000;
176+
}
177+
170178
if( m<0 ){
171179
isNeg = 1;
172180
m = -m;

0 commit comments

Comments
 (0)