aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/tsvector_parser.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-12-27 11:40:01 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2022-12-27 11:40:01 -0500
commiteb8312a22a84c33fc405ae9b497113973f552f90 (patch)
tree3d7a135bafd3fd06750a6586e69225447743caae /src/backend/utils/adt/tsvector_parser.c
parent63c844a0a5d70cdbd6ae0470d582d39e75ad8d66 (diff)
downloadpostgresql-eb8312a22a84c33fc405ae9b497113973f552f90.tar.gz
postgresql-eb8312a22a84c33fc405ae9b497113973f552f90.zip
Detect bad input for types xid, xid8, and cid.
Historically these input functions just called strtoul or strtoull and returned the result, with no error detection whatever. Upgrade them to reject garbage input and out-of-range values, similarly to our other numeric input routines. To share the code for this with type oid, adjust the existing "oidin_subr" to be agnostic about the SQL name of the type it is handling, and move it to numutils.c; then clone it for 64-bit types. Because the xid types previously accepted hex and octal input by reason of calling strtoul[l] with third argument zero, I made the common subroutine do that too, with the consequence that type oid now also accepts hex and octal input. In view of 6fcda9aba, that seems like a good thing. While at it, simplify the existing over-complicated handling of syntax errors from strtoul: we only need one ereturn not three. Discussion: https://postgr.es/m/3526121.1672000729@sss.pgh.pa.us
Diffstat (limited to 'src/backend/utils/adt/tsvector_parser.c')
0 files changed, 0 insertions, 0 deletions