mirror of
https://github.com/postgres/postgres.git
synced 2025-05-28 00:03:23 -04:00
It was possible for the code to read out-of-bound data from the "day_tab" table with some crafted input data. Let's treat these as invalid input as the month number is incorrect. A test is added to test this case with a check on the errno returned by the decoding routine. A test close to the new one added in this commit was testing for a failure, but did not look at the errno generated, so let's use this commit to also change it, adding a check on the errno returned by DecodeDateTime(). Like the other test scripts, dt_test should likely be expanded to include more checks based on the errnos generated in these code paths. This is left as future work. This issue exists since 2e6f97560a83, so backpatch all the way down. Reported-by: Pavel Nekrasov Author: Bruce Momjian, Pavel Nekrasov Discussion: https://postgr.es/m/18614-6bbe00117352309e@postgresql.org Backpatch-through: 12
src/interfaces/ecpg/README.dynSQL descriptor statements have the following shortcomings - input descriptors (USING DESCRIPTOR <name>) are not supported Reason: to fully support dynamic SQL the frontend/backend communication should change to recognize input parameters. Since this is not likely to happen in the near future and you can cover the same functionality with the existing infrastructure (using s[n]printf), I'll leave the work to someone else.