forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit78f79b6
committed
Fix NUMERIC field access macros to treat NaNs consistently.
Commit1453435 arranged to store numericNaN values as short-header numerics, but the field access macros did notget the memo: they thought only "SHORT" numerics have short headers.Most of the time this makes no difference because we don't access theweight or dscale of a NaN; but numeric_send does that. As pointed outby Andrew Gierth, this led to fetching uninitialized bytes.AFAICS this could not have any worse consequences than that; in particular,an unaligned stored numeric would have been detoasted by PG_GETARG_NUMERIC,so that there's no risk of a fetch off the end of memory. Still, the codeis wrong on its own terms, and it's not hard to foresee future changes thatmight expose us to real risks. So back-patch to all affected branches.1 parente50e2e0 commit78f79b6
1 file changed
+5
-4
lines changedLines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
168 | 168 |
| |
169 | 169 |
| |
170 | 170 |
| |
| 171 | + | |
171 | 172 |
| |
172 | 173 |
| |
173 |
| - | |
| 174 | + | |
174 | 175 |
| |
175 | 176 |
| |
176 | 177 |
| |
| |||
196 | 197 |
| |
197 | 198 |
| |
198 | 199 |
| |
199 |
| - | |
| 200 | + | |
200 | 201 |
| |
201 | 202 |
| |
202 | 203 |
| |
203 |
| - | |
| 204 | + | |
204 | 205 |
| |
205 | 206 |
| |
206 | 207 |
| |
| |||
361 | 362 |
| |
362 | 363 |
| |
363 | 364 |
| |
364 |
| - | |
| 365 | + | |
365 | 366 |
| |
366 | 367 |
| |
367 | 368 |
| |
|
0 commit comments
Comments
(0)