Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oHCGx-0005Ad-1n for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Jul 2022 22:46:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oHCGv-0001NT-U7 for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Jul 2022 22:46:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oHCGv-0001NK-IU for pgsql-hackers@lists.postgresql.org; Thu, 28 Jul 2022 22:46:25 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oHCGs-0002VZ-Vv for pgsql-hackers@lists.postgresql.org; Thu, 28 Jul 2022 22:46:25 +0000 Received: by mail-pl1-x629.google.com with SMTP id t2so3042322ply.2 for ; Thu, 28 Jul 2022 15:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cj1VjYXVM5PX37vLPJzYG99wtamkq0Xtt0bEGVsRW/Y=; b=BdNWl+nmF9nJDzg1vhDZB/FPHkPh+maWbQSJMGHPIFY/FF8aae9jmoofmFXzBcWrZe kYj5HTZdZYfoZ3+ZQ4RTpHIw6wF9qIDTrxRC6/oFmNbm+/eQx4c4ai2z8lOFofk5rLlQ W+UGc/9PC3CvW5vO6QLtA6pY7zVME+Dm5p5BhMvNWTcdGH4uk1PBORUHOTbPdbvCykac +HBm6gU755nI6G6+z+bvZWtV17Nbj+jTMYF2801LNoY2sX6uEqZe0o8FldtItKwRQzqp 4/941VV3sL9re+VEk8eQ0XhsHb+mtwb3WfOM1cN4k+wMvkFI/ZXF4CLhE2Dyb/Wsqh+C JiVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cj1VjYXVM5PX37vLPJzYG99wtamkq0Xtt0bEGVsRW/Y=; b=bbKVwWZ+xeON74fKKOJpGZ5zXgtCzPac1q6ZYY1NPh8cAWl38xcVXQrPHhxZ+HF/AO dg4PTn6P+xEozJbjQGR9uRqew34xqejCR2V05/oS34NGg/qwkWKyswduWViuwahBbv8u b3M5Uzw88YkdSw8CjORANijvjEuirY0yqVDut41jhbH6J+4rut+xaav4NGUcx71u1LE2 UPfde75KPSb4iljjYLHjcdMay8Lr1jwF9OznDAaEseq1zvF0PkzXgKB+jThtdcwAcRI3 2CRWvrhkhZdbJxb1zabWEiRYSiRoNmzwkwSRXbdrz0svwUmGayA/74UCIdH0cJwpRT7K ErtA== X-Gm-Message-State: ACgBeo2+t9aO3UW41vCXvg7HMv0uvsRJJx6SH+CjJcLVdFOsqYXy6ncA nwi0pHrpmXNXX6wSTN3Ye0l3z0V11FE= X-Google-Smtp-Source: AA6agR4KjjRb9kPviHt7F+gnyLOClFuTAWO1lqlOXkU0L/6uhMrGxs3FO6foghFj4e7xoDksp5UskQ== X-Received: by 2002:a17:903:2406:b0:16d:6b7a:57c6 with SMTP id e6-20020a170903240600b0016d6b7a57c6mr1028200plo.149.1659048380618; Thu, 28 Jul 2022 15:46:20 -0700 (PDT) Received: from nathanxps13 ([50.54.155.70]) by smtp.gmail.com with ESMTPSA id z20-20020a170903409400b0016a33177d3csm1840115plc.160.2022.07.28.15.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jul 2022 15:46:20 -0700 (PDT) Date: Thu, 28 Jul 2022 15:46:18 -0700 From: Nathan Bossart To: Martin Kalcher Cc: PostgreSQL Hackers Subject: Re: [Patch] Fix bounds check in trim_array() Message-ID: <20220728224618.GA412680@nathanxps13> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jul 25, 2022 at 04:40:51PM +0200, Martin Kalcher wrote: > +SELECT trim_array(ARRAY[]::int[], 1); -- fail > +ERROR: number of elements to trim must be between 0 and 0 Can we improve the error message? Maybe it should look something like ERROR: number of elements to trim must be 0 for this case. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com