From unknown Fri Aug 15 20:51:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34373: 26.1; Missing range check in rx-submatch-n Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Feb 2019 18:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34373 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 34373@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154956253124084 (code B ref -1); Thu, 07 Feb 2019 18:03:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Feb 2019 18:02:11 +0000 Received: from localhost ([127.0.0.1]:38617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gro03-0006GN-0y for submit@debbugs.gnu.org; Thu, 07 Feb 2019 13:02:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gro00-0006GB-SQ for submit@debbugs.gnu.org; Thu, 07 Feb 2019 13:02:09 -0500 Received: from lists.gnu.org ([209.51.188.17]:33084) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grnzv-0004TB-AV for submit@debbugs.gnu.org; Thu, 07 Feb 2019 13:02:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grnzp-0005bR-RH for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2019 13:02:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grnzn-0004KV-S2 for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2019 13:01:57 -0500 Received: from mail224c50.megamailservers.eu ([91.136.10.234]:48770 helo=mail33c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grnzl-000458-SS for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2019 13:01:55 -0500 X-Authenticated-User: mattiase@bredband.net Received: from [192.168.0.4] (c83-251-8-17.bredband.comhem.se [83.251.8.17]) (authenticated bits=0) by mail33c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x17I1YQM003821 for ; Thu, 7 Feb 2019 18:01:36 +0000 From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Message-Id: Date: Thu, 7 Feb 2019 19:01:33 +0100 X-Mailer: Apple Mail (2.3445.102.3) X-CTCH-RefID: str=0001.0A0B020C.5C5C7280.0029, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=D4Rp1MZj c=1 sm=1 tr=0 a=NAHmi3I8mP0S/Y8gRKeQyA==:117 a=NAHmi3I8mP0S/Y8gRKeQyA==:17 a=kj9zAlcOel0A:10 a=h55ZjLXlAAAA:8 a=Max8-NvjCakVG6xwARYA:9 a=CjuIK1q_8ugA:10 a=bVIcrEQjCtdAe-SrG74p:22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.234 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) `rx' should protect its own abstractions and never generate an invalid = regexp, but will if given a bad submatch number: (rx (group-n 0 "x")) =3D> "\\(?0:x\\)" It's a missing range check in rx-submatch-n. In GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 = Version 10.10.5 (Build 14F2511)) of 2018-05-31 built on builder10-10.porkrind.org Windowing system distributor 'Apple', version 10.3.1671 From unknown Fri Aug 15 20:51:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34373: Acknowledgement (26.1; Missing range check in rx-submatch-n) Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Feb 2019 18:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34373 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 34373@debbugs.gnu.org Received: via spool by 34373-submit@debbugs.gnu.org id=B34373.154956291024668 (code B ref 34373); Thu, 07 Feb 2019 18:09:01 +0000 Received: (at 34373) by debbugs.gnu.org; 7 Feb 2019 18:08:30 +0000 Received: from localhost ([127.0.0.1]:38622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gro69-0006Pn-RB for submit@debbugs.gnu.org; Thu, 07 Feb 2019 13:08:30 -0500 Received: from mail233c50.megamailservers.eu ([91.136.10.243]:56946 helo=mail37c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gro67-0006Pf-JV for 34373@debbugs.gnu.org; Thu, 07 Feb 2019 13:08:28 -0500 X-Authenticated-User: mattiase@bredband.net Received: from [192.168.0.4] (c83-251-8-17.bredband.comhem.se [83.251.8.17]) (authenticated bits=0) by mail37c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x17I8OWP020688 for <34373@debbugs.gnu.org>; Thu, 7 Feb 2019 18:08:26 +0000 From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Content-Type: multipart/mixed; boundary="Apple-Mail=_01B149E7-0EB8-473B-9D99-E99A2EB26BFD" Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Date: Thu, 7 Feb 2019 19:08:24 +0100 References: In-Reply-To: Message-Id: <92032ECD-6C45-4820-829F-55194CEC885E@acm.org> X-Mailer: Apple Mail (2.3445.102.3) X-CTCH-RefID: str=0001.0A0B020A.5C5C741A.0040, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=POghB8iC c=1 sm=1 tr=0 a=NAHmi3I8mP0S/Y8gRKeQyA==:117 a=NAHmi3I8mP0S/Y8gRKeQyA==:17 a=Z2r6JAP30GX68kRhCWMA:9 a=CjuIK1q_8ugA:10 a=MeWz5FykRwu6c_VwvhcA:9 a=B2y7HmGcmWMA:10 a=tclcd6dtLQvEqt9_mmAA:9 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --Apple-Mail=_01B149E7-0EB8-473B-9D99-E99A2EB26BFD Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Patch. --Apple-Mail=_01B149E7-0EB8-473B-9D99-E99A2EB26BFD Content-Disposition: attachment; filename=0001-Check-validity-of-rx-submatch-n-number.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Check-validity-of-rx-submatch-n-number.patch" Content-Transfer-Encoding: quoted-printable =46rom=20cc7bbab39595b117f6f2ed2bcf5ea1782060e574=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Thu,=207=20Feb=202019=2019:05:06=20+0100=0A= Subject:=20[PATCH]=20Check=20validity=20of=20rx=20submatch-n=20number=0A=0A= *=20lisp/emacs-lisp/rx.el=20(rx-submatch):=20Type=20and=20range=20check=20= (Bug#34373).=0A---=0A=20lisp/emacs-lisp/rx.el=20|=202=20++=0A=201=20file=20= changed,=202=20insertions(+)=0A=0Adiff=20--git=20a/lisp/emacs-lisp/rx.el=20= b/lisp/emacs-lisp/rx.el=0Aindex=208b4551d0d3..d47beed975=20100644=0A---=20= a/lisp/emacs-lisp/rx.el=0A+++=20b/lisp/emacs-lisp/rx.el=0A@@=20-705,6=20= +705,8=20@@=20FORM=20is=20either=20`(repeat=20N=20FORM1)'=20or=20= `(repeat=20N=20M=20FORMS...)'."=0A=20(defun=20rx-submatch-n=20(form)=0A=20= =20=20"Parse=20and=20produce=20code=20from=20FORM,=20which=20is=20= `(submatch-n=20N=20...)'."=0A=20=20=20(let=20((n=20(nth=201=20form)))=0A= +=20=20=20=20(unless=20(and=20(integerp=20n)=20(>=20n=200))=0A+=20=20=20=20= =20=20(error=20"rx=20`submatch-n'=20argument=20must=20be=20positive"))=0A= =20=20=20=20=20(concat=20"\\(?"=20(number-to-string=20n)=20":"=0A=20=09=20= =20=20=20(if=20(=3D=203=20(length=20form))=0A=20=09=09;;=20Only=20one=20= sub-form.=0A--=20=0A2.17.2=20(Apple=20Git-113)=0A=0A= --Apple-Mail=_01B149E7-0EB8-473B-9D99-E99A2EB26BFD Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_01B149E7-0EB8-473B-9D99-E99A2EB26BFD-- From unknown Fri Aug 15 20:51:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34373: Acknowledgement (26.1; Missing range check in rx-submatch-n) In-Reply-To: Resent-From: Andy Moreton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Feb 2019 15:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34373 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 34373@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154963837431140 (code B ref -1); Fri, 08 Feb 2019 15:07:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Feb 2019 15:06:14 +0000 Received: from localhost ([127.0.0.1]:40037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gs7jJ-00086C-Ok for submit@debbugs.gnu.org; Fri, 08 Feb 2019 10:06:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59251) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gs7jI-000861-Nw for submit@debbugs.gnu.org; Fri, 08 Feb 2019 10:06:12 -0500 Received: from lists.gnu.org ([209.51.188.17]:37679) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gs7jD-00046l-M3 for submit@debbugs.gnu.org; Fri, 08 Feb 2019 10:06:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gs7jC-0001hn-N9 for bug-gnu-emacs@gnu.org; Fri, 08 Feb 2019 10:06:07 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_20,FREEMAIL_FROM, RDNS_NONE,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gs7jC-000458-1f for bug-gnu-emacs@gnu.org; Fri, 08 Feb 2019 10:06:06 -0500 Received: from [195.159.176.226] (port=35490 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gs7jB-000443-RD for bug-gnu-emacs@gnu.org; Fri, 08 Feb 2019 10:06:05 -0500 Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1gs7j9-000UAO-Lh for bug-gnu-emacs@gnu.org; Fri, 08 Feb 2019 16:06:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ From: Andy Moreton Date: Fri, 08 Feb 2019 15:05:57 +0000 Message-ID: References: <92032ECD-6C45-4820-829F-55194CEC885E@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) Cancel-Lock: sha1:y9X3FVd2HA29wrOVNcLY+gViHD8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Thu 07 Feb 2019, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= wrote: > Patch. > > From cc7bbab39595b117f6f2ed2bcf5ea1782060e574 Mon Sep 17 00:00:00 2001 > From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= > Date: Thu, 7 Feb 2019 19:05:06 +0100 > Subject: [PATCH] Check valid [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: acm.org] 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (andrewjmoreton[at]gmail.com) 1.0 FORGED_GMAIL_RCVD 'From' gmail.com does not match 'Received' headers 0.1 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.1 (/) On Thu 07 Feb 2019, Mattias EngdegÄrd wrote: > Patch. > > From cc7bbab39595b117f6f2ed2bcf5ea1782060e574 Mon Sep 17 00:00:00 2001 > From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= > Date: Thu, 7 Feb 2019 19:05:06 +0100 > Subject: [PATCH] Check validity of rx submatch-n number > > * lisp/emacs-lisp/rx.el (rx-submatch): Type and range check (Bug#34373). > --- > lisp/emacs-lisp/rx.el | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el > index 8b4551d0d3..d47beed975 100644 > --- a/lisp/emacs-lisp/rx.el > +++ b/lisp/emacs-lisp/rx.el > @@ -705,6 +705,8 @@ FORM is either `(repeat N FORM1)' or `(repeat N M FORMS...)'." > (defun rx-submatch-n (form) > "Parse and produce code from FORM, which is `(submatch-n N ...)'." > (let ((n (nth 1 form))) > + (unless (and (integerp n) (> n 0)) > + (error "rx `submatch-n' argument must be positive")) > (concat "\\(?" (number-to-string n) ":" > (if (= 3 (length form)) > ;; Only one sub-form. You could use (natnump n) instead. AndyM From unknown Fri Aug 15 20:51:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34373: Acknowledgement (26.1; Missing range check in rx-submatch-n) Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Feb 2019 11:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34373 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 34373@debbugs.gnu.org Received: via spool by 34373-submit@debbugs.gnu.org id=B34373.155031565432152 (code B ref 34373); Sat, 16 Feb 2019 11:15:02 +0000 Received: (at 34373) by debbugs.gnu.org; 16 Feb 2019 11:14:14 +0000 Received: from localhost ([127.0.0.1]:50026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1guxvC-0008MV-CL for submit@debbugs.gnu.org; Sat, 16 Feb 2019 06:14:14 -0500 Received: from mail85c50.megamailservers.eu ([91.136.10.95]:34222 helo=mail18c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1guxv9-0008MM-VM for 34373@debbugs.gnu.org; Sat, 16 Feb 2019 06:14:13 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1550315650; bh=21x0M0GQNCLVRpfBO5FwDCHYYcaAjzUIQqrcLW9TxPE=; h=From:Subject:Date:References:To:In-Reply-To:From; b=nak6quyA1hlPMH9Q33ctgy+xa4Qo4monWeqqDijLqwsqy3Xz21zNTLv/G19pM8pni s7/mksNG8Wsj43p3NDm8Byfa0XvtMrlbb1HmrNHVjaQPaz04hnA51YnXob+ZcQo6pY nVGkkmfPQNZ8M+/cJgr2c7g4fpRGWps1m7LwFczs= Feedback-ID: mattiase@acm.or Received: from [192.168.0.4] (c83-251-8-17.bredband.comhem.se [83.251.8.17]) (authenticated bits=0) by mail18c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x1GBE8vr012470 for <34373@debbugs.gnu.org>; Sat, 16 Feb 2019 11:14:10 +0000 From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Date: Sat, 16 Feb 2019 12:14:08 +0100 References: <92032ECD-6C45-4820-829F-55194CEC885E@acm.org> In-Reply-To: <92032ECD-6C45-4820-829F-55194CEC885E@acm.org> Message-Id: X-Mailer: Apple Mail (2.3445.102.3) X-CTCH-RefID: str=0001.0A0B0210.5C67F082.0027, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=KOR08mNo c=1 sm=1 tr=0 a=NAHmi3I8mP0S/Y8gRKeQyA==:117 a=NAHmi3I8mP0S/Y8gRKeQyA==:17 a=kj9zAlcOel0A:10 a=eokE8JUsiTKcchvxugEA:9 a=CjuIK1q_8ugA:10 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) No, natnump is true for zero but we only want positive integers here. From unknown Fri Aug 15 20:51:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34373: Acknowledgement (26.1; Missing range check in rx-submatch-n) Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Jun 2019 18:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34373 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Cc: 34373@debbugs.gnu.org Received: via spool by 34373-submit@debbugs.gnu.org id=B34373.15613140432444 (code B ref 34373); Sun, 23 Jun 2019 18:21:01 +0000 Received: (at 34373) by debbugs.gnu.org; 23 Jun 2019 18:20:43 +0000 Received: from localhost ([127.0.0.1]:54558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf76Y-0000dM-N1 for submit@debbugs.gnu.org; Sun, 23 Jun 2019 14:20:42 -0400 Received: from quimby.gnus.org ([80.91.231.51]:44984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf76W-0000dA-Kn for 34373@debbugs.gnu.org; Sun, 23 Jun 2019 14:20:41 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hf76S-0000QQ-HS; Sun, 23 Jun 2019 20:20:38 +0200 From: Lars Ingebrigtsen References: <92032ECD-6C45-4820-829F-55194CEC885E@acm.org> Date: Sun, 23 Jun 2019 20:20:36 +0200 In-Reply-To: <92032ECD-6C45-4820-829F-55194CEC885E@acm.org> ("Mattias \=\?utf-8\?Q\?Engdeg\=C3\=A5rd\=22's\?\= message of "Thu, 7 Feb 2019 19:08:24 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= writes: > * lisp/emacs-lisp/rx.el (rx-submatch): Type and range check (Bug#34373). [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mattias Engdeg=C3=A5rd writes: > * lisp/emacs-lisp/rx.el (rx-submatch): Type and range check (Bug#34373). [...] > (defun rx-submatch-n (form) > "Parse and produce code from FORM, which is `(submatch-n N ...)'." > (let ((n (nth 1 form))) > + (unless (and (integerp n) (> n 0)) > + (error "rx `submatch-n' argument must be positive")) This looks like an eminently reasonable sanity check to me, but I'm quite unfamiliar with the rx machinery. Just push the change? --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Fri Aug 15 20:51:22 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Subject: bug#34373: closed (Re: bug#34373: Acknowledgement (26.1; Missing range check in rx-submatch-n)) Message-ID: References: X-Gnu-PR-Message: they-closed 34373 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 34373@debbugs.gnu.org Date: Sun, 23 Jun 2019 18:35:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1561314903-12678-1" This is a multi-part message in MIME format... ------------=_1561314903-12678-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #34373: 26.1; Missing range check in rx-submatch-n which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 34373@debbugs.gnu.org. --=20 34373: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D34373 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1561314903-12678-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 34373-done) by debbugs.gnu.org; 23 Jun 2019 18:34:18 +0000 Received: from localhost ([127.0.0.1]:54585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf7Ji-0003Gv-AM for submit@debbugs.gnu.org; Sun, 23 Jun 2019 14:34:18 -0400 Received: from mail1421c50.megamailservers.eu ([91.136.14.21]:35210 helo=mail102c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf7Jg-0003Ge-6m for 34373-done@debbugs.gnu.org; Sun, 23 Jun 2019 14:34:16 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1561314849; bh=r5IyJEaWenPxIvAr2b3eiQIYVajePu0Ofn3eX6zIKs8=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=gWFBfBikqOgCPVZUV87HaOG6PM4uF7kLDkylPoILPyMEML/F5AqpNpp4LS1ezzXAj /IJKO84Kk6lfEgoQmREyoJJ/ggzOCvDSdF6ktLzdUz4IuXz3h0axeAVzgEWZtPPRKg 9y26He8DN3Rz90AAzYfEva1AahgyLnlKgOto5Yu0= Feedback-ID: mattiase@acm.or Received: from [192.168.0.4] ([188.150.171.71]) (authenticated bits=0) by mail102c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x5NIY7bI021474; Sun, 23 Jun 2019 18:34:09 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: bug#34373: Acknowledgement (26.1; Missing range check in rx-submatch-n) From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: Date: Sun, 23 Jun 2019 20:34:07 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <92032ECD-6C45-4820-829F-55194CEC885E@acm.org> To: Lars Ingebrigtsen X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B0215.5D0FC621.0036, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=RfS+9Wlv c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=OocQHUDgAAAA:8 a=LyNo7SN9nkQkgWpQ9coA:9 a=CjuIK1q_8ugA:10 a=3fbLLLLNgwQA:10 a=xUZTl98r3Qw_uB5NK3jt:22 X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 34373-done Cc: 34373-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 23 juni 2019 kl. 20.20 skrev Lars Ingebrigtsen : > > This looks like an eminently reasonable sanity check to me, but I'm > quite unfamiliar with the rx machinery. Just push the change? Thank you, pushed. ------------=_1561314903-12678-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 7 Feb 2019 18:02:11 +0000 Received: from localhost ([127.0.0.1]:38617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gro03-0006GN-0y for submit@debbugs.gnu.org; Thu, 07 Feb 2019 13:02:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gro00-0006GB-SQ for submit@debbugs.gnu.org; Thu, 07 Feb 2019 13:02:09 -0500 Received: from lists.gnu.org ([209.51.188.17]:33084) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grnzv-0004TB-AV for submit@debbugs.gnu.org; Thu, 07 Feb 2019 13:02:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grnzp-0005bR-RH for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2019 13:02:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grnzn-0004KV-S2 for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2019 13:01:57 -0500 Received: from mail224c50.megamailservers.eu ([91.136.10.234]:48770 helo=mail33c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grnzl-000458-SS for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2019 13:01:55 -0500 X-Authenticated-User: mattiase@bredband.net Received: from [192.168.0.4] (c83-251-8-17.bredband.comhem.se [83.251.8.17]) (authenticated bits=0) by mail33c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x17I1YQM003821 for ; Thu, 7 Feb 2019 18:01:36 +0000 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: 26.1; Missing range check in rx-submatch-n Message-Id: Date: Thu, 7 Feb 2019 19:01:33 +0100 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3445.102.3) X-CTCH-RefID: str=0001.0A0B020C.5C5C7280.0029, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=D4Rp1MZj c=1 sm=1 tr=0 a=NAHmi3I8mP0S/Y8gRKeQyA==:117 a=NAHmi3I8mP0S/Y8gRKeQyA==:17 a=kj9zAlcOel0A:10 a=h55ZjLXlAAAA:8 a=Max8-NvjCakVG6xwARYA:9 a=CjuIK1q_8ugA:10 a=bVIcrEQjCtdAe-SrG74p:22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.234 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) `rx' should protect its own abstractions and never generate an invalid = regexp, but will if given a bad submatch number: (rx (group-n 0 "x")) =3D> "\\(?0:x\\)" It's a missing range check in rx-submatch-n. In GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 = Version 10.10.5 (Build 14F2511)) of 2018-05-31 built on builder10-10.porkrind.org Windowing system distributor 'Apple', version 10.3.1671 ------------=_1561314903-12678-1--