From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jan Stranik via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#53333: Fix for crash in ebrowse Date: Tue, 18 Jan 2022 20:32:55 -0500 Message-ID: <878rvc1pdk.fsf@stranik.org> References: <87fspm0z47.fsf@stranik.org> <835yqgvru9.fsf@gnu.org> Reply-To: Jan Stranik Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29683"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cc: 53333@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 19 02:41:12 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 1n9zyK-0007bA-A5 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Jan 2022 02:41:12 +0100 Original-Received: from localhost ([::1]:58716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9zyB-0006Bx-SM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Jan 2022 20:41:04 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9zrW-00034F-VD for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 20:34:11 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59110) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n9zrO-00039n-Be for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 20:34:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n9zrO-0008PO-1E for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 20:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jan Stranik Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Jan 2022 01:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53333 X-GNU-PR-Package: emacs Original-Received: via spool by 53333-submit@debbugs.gnu.org id=B53333.164255598532251 (code B ref 53333); Wed, 19 Jan 2022 01:34:01 +0000 Original-Received: (at 53333) by debbugs.gnu.org; 19 Jan 2022 01:33:05 +0000 Original-Received: from localhost ([127.0.0.1]:52013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9zqS-0008O6-GL for submit@debbugs.gnu.org; Tue, 18 Jan 2022 20:33:05 -0500 Original-Received: from stranik.org ([95.216.183.163]:46471) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9zqN-0008Na-5R for 53333@debbugs.gnu.org; Tue, 18 Jan 2022 20:33:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stranik.org ; s=2020nix; h=Subject:To:From; bh=00hJJoQMznj89lUbc2wGyRt31f9DNfAbtzG3jiSnW3o=; b=Bf2EyEG2ISUCCa05B8wHUhNPuN WfgEG16iz+jW09fk9W16aRiHjeu1w47kn8m97fGYVkA2i8f8Rn+b3TLk/VIGeQ5iVRPVus5PJbMmH 5h8YqrZy87NnNOtAccI31zU7oZVBPKRXecIlKWp3b26KHfwleTA5ydUQPUWJ6+JyLFz8=; Original-Received: from ool-2f14040e.dyn.optonline.net ([47.20.4.14] helo=localhost) by stranik.org with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1n9zqL-00094B-4u; Wed, 19 Jan 2022 01:32:57 +0000 In-Reply-To: <835yqgvru9.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 18 Jan 2022 20:09:18 +0200") X-Spam_score: -0.1 X-Spam_score_int: 0 X-Spam_bar: / X-Spam_report: Action: no action Symbol: ARC_NA(0.00) Symbol: RCVD_VIA_SMTP_AUTH(0.00) Symbol: FROM_HAS_DN(0.00) Symbol: TO_DN_SOME(0.00) Symbol: TO_MATCH_ENVRCPT_ALL(0.00) Symbol: MIME_GOOD(-0.10) Symbol: RCPT_COUNT_TWO(0.00) Symbol: RCVD_COUNT_ONE(0.00) Symbol: FROM_EQ_ENVFROM(0.00) Symbol: MIME_TRACE(0.00) Symbol: ASN(0.00) Symbol: RCVD_TLS_ALL(0.00) Symbol: MID_RHS_MATCH_FROM(0.00) Message-ID: 878rvc1pdk.fsf@stranik.org 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" Xref: news.gmane.io gmane.emacs.bugs:224537 Archived-At: > > Thanks, but can you explain the need for this part: > >> ! else { >> ! s++; >> ! break; >> ! } >> ! } > > Why do we need to advance the pointer 's' in the 'else' clause? why > not leave it alone? The identifier is copied from end to the buffer. As we are copying, we want to escape quote and backslash characters. Normally if we encounter any of these characters we just prepend \ to in front. If there is not enough space in the buffer to insert the \, we should increase the s, to back-out the character that we wanted to escape. If we would not do that, the first character might not be escaped. If that character were a quote, it would break the lisp expressions written later to the BROWSE file. > Or maybe I will understand the reason if you show some simple code > that hits this problem (which would be a good thing of its own, as > we'd then have a test to add to our test suite)? I encountered this in a c++ header file with very long identifiers that just filled the buffer but the first character had to be escaped. -- Jan Stranik