Re: [HACKERS] numeric access out of bounds

2015-01-27 Thread Tom Lane
I wrote: > Andrew Gierth writes: >> I can see two possible fixes: one to correct the assumptions in the >> macros, the other to check for NaN before calling init_var_from_num in >> numeric_send (all the other functions seem to do this check explicitly). >> Which would be preferable? > I'm incline

Re: [HACKERS] numeric access out of bounds

2015-01-24 Thread Tom Lane
Andrew Gierth writes: > I can see two possible fixes: one to correct the assumptions in the > macros, the other to check for NaN before calling init_var_from_num in > numeric_send (all the other functions seem to do this check explicitly). > Which would be preferable? I'm inclined to think specia

[HACKERS] numeric access out of bounds

2015-01-24 Thread Andrew Gierth
Happened to notice this: postgres=# select numeric_send('NaN'); numeric_send \x7f7ec000 (1 row) 7f7e obviously screams "accessing memory beyond the end of data", and indeed this is so: init_var_from_num, when passed a NaN, accesses two bytes after the input.