From 95f7ddfdad99c5ea0500d90ce52075814e10ed8c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 28 Mar 2020 17:09:51 -0400 Subject: 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 --- doc/src/sgml/ltree.sgml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ltree.sgml b/doc/src/sgml/ltree.sgml index b4e07f65109..0c74aa705e9 100644 --- a/doc/src/sgml/ltree.sgml +++ b/doc/src/sgml/ltree.sgml @@ -37,8 +37,7 @@ A label path is a sequence of zero or more labels separated by dots, for example L1.L2.L3, representing a path from the root of a hierarchical tree to a particular node. The - length of a label path must be less than 65kB, but keeping it under 2kB is - preferable. + length of a label path cannot exceed 65535 labels. -- cgit v1.2.3