forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8eb1e9d
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 parent61fb800 commit8eb1e9d
1 file changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | | - | |
| 173 | + | |
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
202 | | - | |
| 203 | + | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
| |||
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
353 | | - | |
| 354 | + | |
354 | 355 | | |
355 | 356 | | |
356 | 357 | | |
| |||
0 commit comments
Comments
(0)