postgresql/contrib/ltree
Tom Lane 95f7ddfdad Protect against overflow of ltree.numlevel and lquery.numlevel.
These uint16 fields could be overflowed by excessively long input,
producing strange results.  Complain for invalid input.

Likewise check for out-of-range values of the repeat counts in lquery.
(We don't try too hard on that one, notably not bothering to detect
if atoi's result has overflowed.)

Also detect length overflow in ltree_concat.

In passing, be more consistent about whether "syntax error" messages
include the type name.  Also, clarify the documentation about what
the size limit is.

This has been broken for a long time, so back-patch to all supported
branches.

Nikita Glukhov, reviewed by Benjie Gillam and Tomas Vondra

Discussion: https://postgr.es/m/CAP_rww=waX2Oo6q+MbMSiZ9ktdj6eaJj0cQzNu=Ry2cCDij5fw@mail.gmail.com
2020-03-28 17:09:51 -04:00
..
data
expected Protect against overflow of ltree.numlevel and lquery.numlevel. 2020-03-28 17:09:51 -04:00
sql Protect against overflow of ltree.numlevel and lquery.numlevel. 2020-03-28 17:09:51 -04:00
_ltree_gist.c Clean up newlines following left parentheses 2020-01-30 13:42:14 -03:00
_ltree_op.c
.gitignore
crc32.c
crc32.h
lquery_op.c Clean up newlines following left parentheses 2020-01-30 13:42:14 -03:00
ltree_gist.c Clean up newlines following left parentheses 2020-01-30 13:42:14 -03:00
ltree_io.c Protect against overflow of ltree.numlevel and lquery.numlevel. 2020-03-28 17:09:51 -04:00
ltree_op.c Protect against overflow of ltree.numlevel and lquery.numlevel. 2020-03-28 17:09:51 -04:00
ltree--1.0--1.1.sql
ltree--1.1.sql
ltree.control Mark some contrib modules as "trusted". 2020-02-13 15:02:35 -05:00
ltree.h Protect against overflow of ltree.numlevel and lquery.numlevel. 2020-03-28 17:09:51 -04:00
ltreetest.sql
ltxtquery_io.c
ltxtquery_op.c Clean up newlines following left parentheses 2020-01-30 13:42:14 -03:00
Makefile Remove support for upgrading extensions from "unpackaged" state. 2020-02-19 16:59:14 -05:00