Skip to content

Commit 2a1ef30

Browse files
committed
Prevent infinite loop in ln_var() due to roundoff error.
Per report from Dave Marin.
1 parent 6c4996f commit 2a1ef30

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/utils/adt/numeric.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* 1998 Jan Wieck
77
*
8-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.57 2003/03/11 21:01:33 tgl Exp $
8+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.58 2003/03/14 00:15:32 tgl Exp $
99
*
1010
* ----------
1111
*/
@@ -3872,6 +3872,9 @@ ln_var(NumericVar *arg, NumericVar *result)
38723872
break;
38733873

38743874
add_var(result, &elem, result);
3875+
3876+
if (elem.weight < (result->weight - 2 * global_rscale))
3877+
break;
38753878
}
38763879

38773880
/* Compensate for argument range reduction, round to caller's rscale */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy