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 1wjzng-000PWO-3A for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Jul 2026 13:37:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wjznf-007SF4-2v for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Jul 2026 13:37:23 +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 1wjznf-007SEp-1g for pgsql-bugs@lists.postgresql.org; Wed, 15 Jul 2026 13:37:23 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wjznd-00000000KZi-0S1C for pgsql-bugs@lists.postgresql.org; Wed, 15 Jul 2026 13:37:22 +0000 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-6984169c126so9983571a12.1 for ; Wed, 15 Jul 2026 06:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=garret-ru.20251104.gappssmtp.com; s=20251104; t=1784122638; x=1784727438; darn=lists.postgresql.org; h=content-transfer-encoding:content-type:subject:from:to :content-language:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to:content-type; bh=Rhh7HReliQNeFxQjlpR7fjql9mxnpnu4uYS8dra6lRQ=; b=zRLXma+CaIjGm/SHRl9mpeN2NEWUq6GC+9Pbgv6etXFBPIwZVcbciRt6fOFMpA1J8o sigvTeoLVuEUNNbztwtUbzwkvJY0/wXUnAA+2JgkuZaGfv9kfRFwwuA9iW+HtgFjZbeP bHyyMFEMI1CsckUkPx+O5MWFeTpdoCqv2tB4qY903pdQnYydL62fGC65tJmfJELByB7g L6J6RlYIPBcXT2rmGjZzk7MSQ87rK9N/AY15Gc3sAgGw33yqwm3xQSW9AiHuKByjofnu C8m295L8hpkYPlz387i6gYHG0/5yvtEsJ5Nh6FZixURXcbecuLZYskuYMnkQ44e7lgUO ouLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784122638; x=1784727438; h=content-transfer-encoding:content-type:subject:from:to :content-language:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Rhh7HReliQNeFxQjlpR7fjql9mxnpnu4uYS8dra6lRQ=; b=KxgkIo05upIi3feBAgi9QNd4gXwuzl+kHjKxGxxPxTAz7ZTDOK8MK1GrfK4//VID/h NkH4neive3ulD9nvcLeMgfTASrFVBzCiCeOTutauvTiR52uNFPA6aOo+5jN5xRtppGj1 VxBksIDs2dnSqtTnaCpDmU8dL0QSd/dEcFKaqIW1HXnKDz3gOZjyOTJg4BK1BgEk1/Ho Qp1T7tTRLmg06S0HV3H8jQeu7af083vng/sqCDps6xRnFacbtz27LWtqrbNU/TO/9i+f XdxcYjNMena760zXNNs3YAeWDg41kzq+CJF3Omk0YfCMlsY/C0ZWfKVjgwWchtXaf9oG Ylhg== X-Gm-Message-State: AOJu0YyuVXyvJN16yXNIOTYJPu+pZqmyTRiaDNx4odncqjHexLXp/JqQ wrSuBETVwk8icoZceH5jvlDLSajWsNZyjgJzz9sbw3Wy3KNyCTrL1x/1+u//iI0SUwvZ88ZVk93 hft8rTA== X-Gm-Gg: AfdE7cmo3uiKIg2T5dhBO3lpCXtOiXg4S/Aqg/lKFP5jIPbySc2cdx9vbc2BC+AqDDY 9sYEgqJsh/oUG1HJciovKts6SghfMfmSDCP9OGdrY+e2GmchJZtA0c7f/6eIY4Pd0qF7gkjloLG kKzhn51CBceG02vBN0toOcH5ZpukHNwPgjGcZ330X0iBLiw8d0DKgbQ8g07S/mQ+j9Mj7SGUJym SfDC0YuDA1SNG/OdqwJ3X5C0tzhx3hYEMnxyCOmRMK+LaZuPFEZqUmjwppQUiMVxqNbWZ0FM0Oh Q713SJD1mEsAAbU5YBJLarO9CGLvmU4ekC3HfcNGO8cHhx2alIgWG1zaKLbTqFhh73nU7EYqoxe lFdvgjYi17v2WazVn7dVSO8htAaWNIPGesk1Y8vY9Pk3YxgBItxv2tKtWQTAb1A9BA2j4EJGyGS FRacvJQ1JyJ87xmGKifbDhEZqckA== X-Received: by 2002:a05:6402:5108:b0:695:822c:1083 with SMTP id 4fb4d7f45d1cf-69e199df9d7mr1631405a12.28.1784122638271; Wed, 15 Jul 2026 06:37:18 -0700 (PDT) Received: from [10.248.56.12] ([130.41.208.1]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-69cd2878eaesm3089506a12.2.2026.07.15.06.37.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jul 2026 06:37:17 -0700 (PDT) Message-ID: <87c7d8a4-3a82-4334-bee6-e8c2ad3f3293@garret.ru> Date: Wed, 15 Jul 2026 16:37:16 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: PostgreSQL mailing lists , Peter Geoghegan From: Konstantin Knizhnik Subject: Bug in heap_get_root_tuples Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Commit c7aeb775df895db240dcd6f47242f7e08899adfb contains the following change: -                       /* Sanity check */ -                       if (nextoffnum < FirstOffsetNumber || nextoffnum > maxoff) +                       /* Sanity check (pure paranoia) */ +                       if (offnum < FirstOffsetNumber) +                               break; + +                       /* +                        * An offset past the end of page's line pointer array is possible +                        * when the array was truncated +                        */ +                       if (offnum > maxoff)                                 break;                         lp = PageGetItemId(page, nextoffnum); So it checks `offnum` and uses `nextoffnum`.