Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bv99z-0003Qz-VG for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Oct 2016 20:32:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bv99z-000240-I5 for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Oct 2016 20:32:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bv98b-0000WX-Cl for pgsql-hackers@postgresql.org; Fri, 14 Oct 2016 20:31:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bv98Y-0006uB-Ey for pgsql-hackers@postgresql.org; Fri, 14 Oct 2016 20:31:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u9EKVK3h030240; Fri, 14 Oct 2016 16:31:20 -0400 From: Tom Lane To: Andreas Seltenreich cc: pgsql-hackers@postgresql.org Subject: Re: [sqlsmith] Infinite recursion in bitshift In-reply-to: <877f9azpv1.fsf@credativ.de> References: <87d1j2zqtz.fsf@credativ.de> <17165.1476473076@sss.pgh.pa.us> <877f9azpv1.fsf@credativ.de> Comments: In-reply-to Andreas Seltenreich message dated "Fri, 14 Oct 2016 21:34:42 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30238.1476477079.1@sss.pgh.pa.us> Date: Fri, 14 Oct 2016 16:31:19 -0400 Message-ID: <30239.1476477079@sss.pgh.pa.us> X-Pg-Spam-Score: -2.3 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andreas Seltenreich writes: > Tom Lane writes: >> Seems sane, though I wonder if it'd be better to use -INT_MAX rather >> than -VARBITMAXLEN. > I am undecided between those two. -INT_MAX might be a more precise fix > for the problem, but the extra distance to the danger zone was kind of > soothing :-). Yeah, might as well use the tighter limit. Poking around in varbit.c, I noticed some other places that were assuming that a typmod couldn't exceed VARBITMAXLEN. anybit_typmodin() enforces that, but there are places where a user can shove in an arbitrary integer, eg regression=# select "bit"(42, 2147483647); ERROR: invalid memory alloc request size 18446744073441116169 I fixed those too and pushed it. Thanks for the report! regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers