From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#59544: [PATCH] Fixed lib-src/etags.c command execute vulnerability Date: Sat, 26 Nov 2022 15:21:49 +0200 Message-ID: <83y1rxsvf6.fsf@gnu.org> References: <837czkw7sl.fsf@gnu.org> <8335a8w643.fsf@gnu.org> <83fse7ut10.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3168"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59544@debbugs.gnu.org, stefankangas@gmail.com To: lux Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 26 14:22:50 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyv8q-0000Yk-ND for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Nov 2022 14:22:48 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyv8G-0001Y8-Ub; Sat, 26 Nov 2022 08:22:12 -0500 Original-Received: from [2001:470:142:3::10] (helo=eggs.gnu.org) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyv8F-0001RW-9z for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 08:22:11 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyv89-00038b-0n for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 08:22:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oyv87-0001Hl-T5 for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 08:22:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Nov 2022 13:22:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59544 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: security patch Original-Received: via spool by 59544-submit@debbugs.gnu.org id=B59544.16694689004841 (code B ref 59544); Sat, 26 Nov 2022 13:22:03 +0000 Original-Received: (at 59544) by debbugs.gnu.org; 26 Nov 2022 13:21:40 +0000 Original-Received: from localhost ([127.0.0.1]:38169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyv7k-0001G1-Gu for submit@debbugs.gnu.org; Sat, 26 Nov 2022 08:21:40 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyv7g-0001Fc-RT for 59544@debbugs.gnu.org; Sat, 26 Nov 2022 08:21:39 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyv7V-0002xy-Pd; Sat, 26 Nov 2022 08:21:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=B1HnU5WmngwEoH48rUNuOowQh84NvBlM7Tim5p2RcW0=; b=bBDpnTwt3lH/ 6mW1GJrtEgL2tjoggv6WEFMaWd3MOER9XpIUdpZzvww2k3orRzAc7vltv12NXezJs8TyCMmyBJtI5 uNDGIDiHfULkkhbvmkf/ibto42VGPbQNhD7uXFZU1iAsTzUt5fNA1xrRR7PhcKOnqr21Vl65ers3M Se7+L+0MMIlDLwC/v0wG6TO+h6uFANEqe1xTjzR2M9hiGss1QZ1zXeATNveIzTl1GfzkHYOxZqjtN 1sR6/5jn6mmIB1tX2AJr9+bnziK1nxlpV5KpQu5s9pmcKCjiyoOA2mpY6RDDFIBZBaHZpcc+5rhJL UwHoluaCJ23Tj2a3w5i0wg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyv7U-0006El-GZ; Sat, 26 Nov 2022 08:21:25 -0500 In-Reply-To: (message from lux on Sat, 26 Nov 2022 11:09:26 +0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249084 Archived-At: > Date: Sat, 26 Nov 2022 11:09:26 +0800 > Cc: 59544 <59544@debbugs.gnu.org> > From: lux > > + linebuffer line; > + linebuffer_init (&line); > + while (readline_internal (&line, tag_f, tagfile) > 0) This needs a minor adjustment: readline_internal removes the CR characters from CR-LF end-of-lines, so I think using it unaltered will convert files with DOS-style EOLs to Unix-style EOLs, because we write them with a single newline at the end. I think the best fix is to add one more argument to readline_internal, which, if non-zero, will cause it to avoid removing the CR characters. > +ctags_update: CTAGS.good_update ${infiles} > + echo > CTAGS This "echo" command creates an empty CTAGS file. It would be better to have at least a few lines there, so we could make sure the new code actually removes some lines from its input. Thanks.