forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8692f66
committed
Fix thinko introduced in6b423ec
As pointed out by Dean Rasheed, we really should be using tmp >-(PG_INTNN_MIN / 10) rather than tmp > (PG_INTNN_MAX / 10) for checkingfor overflows in the accumulation in the pg_strtointNN functions. Thisdoes happen to be the same number when dividing by 10, but there is apending patch which adds other bases and this is not the same number if wewere to divide by 2 rather than 10, for example. If the base 2 parsingwas to follow this example then we could accidentally think a stringcontaining the value of PG_INT32_MIN was an overflow in pg_strtoint32.Clearly that shouldn't overflow.This does not fix any actual live bugs, only some bad examples of overflowchecks for future bases.Reported-by: Dean RasheedDiscussion:https://postgr.es/m/CAEZATCVEtwfhdm-K-etZYFB0=qsR0nT6qXta_W+GQx4RYph1dg@mail.gmail.com1 parentd94f32d commit8692f66
1 file changed
+3
-3
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
122 | 122 |
| |
123 | 123 |
| |
124 | 124 |
| |
125 |
| - | |
| 125 | + | |
126 | 126 |
| |
127 | 127 |
| |
128 | 128 |
| |
| |||
200 | 200 |
| |
201 | 201 |
| |
202 | 202 |
| |
203 |
| - | |
| 203 | + | |
204 | 204 |
| |
205 | 205 |
| |
206 | 206 |
| |
| |||
278 | 278 |
| |
279 | 279 |
| |
280 | 280 |
| |
281 |
| - | |
| 281 | + | |
282 | 282 |
| |
283 | 283 |
| |
284 | 284 |
| |
|
0 commit comments
Comments
(0)