Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wwayi-0024bW-1E for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Aug 2026 07:44:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wwayg-0023b8-0u for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Aug 2026 07:44:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wwayf-0023b0-2w for pgsql-hackers@lists.postgresql.org; Wed, 19 Aug 2026 07:44:51 +0000 Received: from meesny.iki.fi ([195.140.195.201]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wwaye-00000001MAB-2Wqn for pgsql-hackers@postgresql.org; Wed, 19 Aug 2026 07:44:50 +0000 Received: from [10.0.2.15] (unknown [75.125.238.37]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id 4hPz9j462ZzyRf; Wed, 19 Aug 2026 10:44:41 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1787125481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oBOQ0l/htrBHPJ6oIbJ632ZBgK2jVGyE2WZagZRMQDM=; b=kDqqtaTrUoZBk5KQ3u0xDNpKljy9kJuzLk1d5oomwzGJNT4n07ca0FW3vP4X3Dm32cp2Mc 1Y11/Yeb1vDMf9a/ueSKZUl/kOBuer1Ii3JwA6wSZ1qyRNyS0mjmQORhaBhyePgEF6vqv1 WCkuOmnqkL2fw5kppg8oJp7Tixrl18Y= ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=meesny; cv=none; t=1787125481; b=O0V+nARl1eZyVbn6c67054Ghapx07ZH7uGRFO8TD8hcfe1QWIiUszIPxVsv8o3zVC89F+0 Mdrwh2rxyMN/izGA3m4H8+3yJQ70fI27mIp1Ro2VfFSsipRO8e0xAI+jJBFD3EtXrvx1jF pB33Mtsu9bP11lzRC6cvK73yvlOQ/EA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1787125481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oBOQ0l/htrBHPJ6oIbJ632ZBgK2jVGyE2WZagZRMQDM=; b=bdqEfRq38JM6eIcYm8JNdL/vyTarKPXvczl+xRtL6LoVFN+Fifr66UqUbHm5X7PKqspO3i 9KOmOcgLlUXYd5Fjqv59D9XXBsbL8fo18kZntbrm5A7BDNyVdbZddmMr2eY5cXrY3yyLjD xgBJI1y8hFMfDKboyynA2fSLl+dJNh8= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi Message-ID: Date: Wed, 19 Aug 2026 10:44:36 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Fix for fragile code in ltree/crc32.c To: Jeff Davis , pgsql-hackers@postgresql.org References: <2cfbc37ae8deccd3825e36b7f31c391cbf8ff9b8.camel@j-davis.com> Content-Language: en-US From: Heikki Linnakangas In-Reply-To: <2cfbc37ae8deccd3825e36b7f31c391cbf8ff9b8.camel@j-davis.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 19/08/2026 03:05, Jeff Davis wrote: > The buffer in ltree_crc32_sz() is more than large enough in practice, > but it didn't explicitly leave room for the NUL byte. Patch attached. Makes sense. Looking at pg_strfold() (and other similar functions), there's no indication that there's an upper bound on the destination size like this. Does UNICODE_CASEMAP_BUFSZ work for all collation providers and locales? How about adding a comment in pg_strfold() and friends about that? - Heikki