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 1w9oCh-001mFh-19 for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Apr 2026 17:57:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9oCf-00AzZe-2P for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Apr 2026 17:57:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w9oCf-00AzZW-1R for pgsql-hackers@lists.postgresql.org; Mon, 06 Apr 2026 17:57:37 +0000 Received: from mail-qv1-xf29.google.com ([2607:f8b0:4864:20::f29]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w9oCd-00000000wKJ-15gR for pgsql-hackers@lists.postgresql.org; Mon, 06 Apr 2026 17:57:37 +0000 Received: by mail-qv1-xf29.google.com with SMTP id 6a1803df08f44-8a4b8c3a30bso57573376d6.3 for ; Mon, 06 Apr 2026 10:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775498253; cv=none; d=google.com; s=arc-20240605; b=akLijEwfHmSSsIYaR1h6RuIPK0MGJjkYrYtsGjKCDgX2gPTKxi34tTFP03MI/3i8vW 4vW92GXmPwidgawJs2J2LZhA4Mw4DiRCb84Nx/MO/OjxzC/+OK+D1qfNWoWied2HMtpY aP8YYtdey9YMmVk4qr0jW9iObjphFXdZFHK7PAYlvpRxaoiYGUGW2MF8yUSNfK+QWZqN uKVk5bxZ8GmLw9t8ylWqryrOxTq2yLMw1F3XHKBgngPEPzZW+phXOF9UOOS4gBS9hDzO 1rEsk79OS7InkB/LQD6U5/gQ95EoplvgwjDkq092aSDBit3M7ylJvwGU6PyDg/b/PMAq uygw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kYSCJgo34A3vqIRiOU0l9yASWlvIQRATN5a/OJmCvOk=; fh=53MoPutANNnX8LYPgnBPlWQiRYGWmDa/tChl7r9Ho0g=; b=lhjy0aJXrNQ0bQNk4PpJ/iysmU93KL8/l4m7mGHaTyN/mPOpOOKlAE1RXss3KJH/1t +NPMmsrW4JcLWYxCPlPlQvL/sxdLOQho7kZFw9Elbz5yJCaGHE3JdSVRt4iDoFLKoY08 QzqRBT0chB1E1Yhk/1NMpx2lZphElLOO5Dr32DNvRDkSr9l8RpAu7kx+Q3hkgfEd3apd k8MeJoAo74WUa9bg0bq2d0DYTBaVNDtrydU4MaWrye7MQBkTxknx5Q2qoM0cXRHTgstl pPAf99x9poDD2BNoS6ZbQ8tv/W2j4Pgs0pDHlZYatvpi64yQFWnQYjP3ImAmVXvqWOCq ZO+g==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1775498253; x=1776103053; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=kYSCJgo34A3vqIRiOU0l9yASWlvIQRATN5a/OJmCvOk=; b=Vyp9nLW862Ql6iF7Gwd2+30BmDdzrLh7y9H3jt+nXtbAZElUZi1lWnEzAAAboFHWfb 9ev0Am0voJB0fQeOiy5zP0qxywZ8PEa1aR2TiQflk5C78+xQz/A4VP1XRPZOhh5gn9J0 Ci0bFPOTBi//4Cvm98/Njiir7fzMpwJFB5vrzmW2bqxquRtozFU2IFYqDLb1KM98GPmQ vZf4iR8hCZrUyKRDLl/O6Jb+J24N8IXwLpZB/1KTsrfqB4fmdPDwlsKvRi4pMrLAPbck c1Ylh2y7XrGYHnXbZKwYbxNkUksID43HMwidMysfVaTqzCCbZdXXNbAwjxGU6DDqEi/t S4OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775498253; x=1776103053; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=kYSCJgo34A3vqIRiOU0l9yASWlvIQRATN5a/OJmCvOk=; b=dwo3RJlwMCd7KR4BPr8iinPcxn/LI9FnVBZ98NRNVGHtweJkBwyXiux2QTkY75DJ2I CHRa3L4XlVp9KiLJryH08yk+soJgRB4+KDBNsDtndC3MwmyshnlXuTeDL/iiT9PFgu7u BA+z55KKZ89Vi63f0SkDRXuzsG1H9z77kBW5dk8hqtXNAi7SC2eueQSu+/R8MiN6VIao ifuWAGnVfUELIkJ7H+yq8JgtqZcnsr0EUgDYEDJWQrFhhiCevFO3sIqcbCg8JN8Xit6r NGdUTNHJVrokgRu3lnbP7VXQvvNL507nEXT5uryO5MdILkbF+Pg08PbCYv7bErYZGlkc SzUA== X-Forwarded-Encrypted: i=1; AJvYcCX7LcmNzLQM08wxVlVet33Ui6XF9hQpIk9LF1OVhY7uyVaYSzW3OHgSuUry76G0py0LC/6UubjSNc1KUufl@lists.postgresql.org X-Gm-Message-State: AOJu0Yychl6CHKXFcU/BCxtwlKLR6BTgMjqrWgLZC4RbUlNqkGcFsiF/ u04UtcNAuGgR6sLRq6RsJih/0nBUK4K/Yuex8CtZsZ8/LGkVf7c5oPk+pRnSHJMrvZ7JcvhWJlx h1l1uZvL4UMXt+jpi8ObKQn2fTaePGKcuUtrhmWHv X-Gm-Gg: AeBDievJcHgcbw+JeJTZW1L5EfEmBYdVeNLTmIUu8xGeKLllbs7ryH8Py6hRsX/oLzc JoLyDp2NTlTJe2a0BvO/rUepjtDKAWsL0CqSYsBe3HvoWPvwUxyeq/b1unm7xn5ivU/O6IMryx9 lwv/9en1KA5vyd7sxFLqzqBDvoUfYskg5Jr/dvUHlsyJ6hUmnws1L98llRgBbpT4ly3C6fSSvc4 s7ZVGAcUPxrBVe1Bx8a7fOHly2plRL11QMAjjjgKbKadRUsy5GcNUmU10Eup5AKbcOqqjEBGpHF zxyukujnl+uFSTB6vbF7 X-Received: by 2002:a05:6214:4113:b0:8a0:44bd:57d8 with SMTP id 6a1803df08f44-8a7048cbcbdmr228258606d6.50.1775498253074; Mon, 06 Apr 2026 10:57:33 -0700 (PDT) MIME-Version: 1.0 References: <0b32e30f2fb94ae3b7f4ee15bbb072c0@rutoken.ru> <107eb23a-8ebb-42bc-99c0-ca551733e94e@proxel.se> In-Reply-To: <107eb23a-8ebb-42bc-99c0-ca551733e94e@proxel.se> From: Jacob Champion Date: Mon, 6 Apr 2026 10:57:22 -0700 X-Gm-Features: AQROBzBurvgg4yOYo_2GEQQJAirCllhngjYiic4KounLG5XJQcgF5x5FoPOLCDo Message-ID: Subject: Re: DEREF_AFTER_NULL: src/common/jsonapi.c:2529 To: Andreas Karlsson Cc: =?UTF-8?B?0JPQsNC70LrQuNC9INCh0LXRgNCz0LXQuQ==?= , "pgsql-hackers@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Apr 6, 2026 at 4:59=E2=80=AFAM Andreas Karlsson = wrote: > The code is correct but a bit confusing. Yeah, it's not great. The need for this (security-critical!) code to wrangle three separate allocation conventions is error-prone, to say the least. > If someone has a patch improving readability Suggestions? > adding this noop NULL check to silence a false positive from a > static analyzer does not seem like an improvement. We do occasionally merge code to silence false positives, and we could maybe do something with pg_assume() here, but I agree that it'd be better to refactor it so that it's obviously correct. --Jacob