- Notifications
You must be signed in to change notification settings - Fork28
Commit1a2b203
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 parent4b2a254 commit1a2b203
1 file changed
+5
-4
lines changedLines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
169 | 169 |
| |
170 | 170 |
| |
171 | 171 |
| |
| 172 | + | |
172 | 173 |
| |
173 | 174 |
| |
174 |
| - | |
| 175 | + | |
175 | 176 |
| |
176 | 177 |
| |
177 | 178 |
| |
| |||
197 | 198 |
| |
198 | 199 |
| |
199 | 200 |
| |
200 |
| - | |
| 201 | + | |
201 | 202 |
| |
202 | 203 |
| |
203 | 204 |
| |
204 |
| - | |
| 205 | + | |
205 | 206 |
| |
206 | 207 |
| |
207 | 208 |
| |
| |||
374 | 375 |
| |
375 | 376 |
| |
376 | 377 |
| |
377 |
| - | |
| 378 | + | |
378 | 379 |
| |
379 | 380 |
| |
380 | 381 |
| |
|
0 commit comments
Comments
(0)