From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0cc3MEPpW2kwZS0AWB0awg (envelope-from ) for ; Mon, 05 Jan 2026 11:39:31 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=YVzROFIW; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B89881E08D; Mon, 05 Jan 2026 11:39:31 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B674C1E08D for ; Mon, 05 Jan 2026 11:39:30 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 3B26C4BA2E1F for ; Mon, 5 Jan 2026 16:39:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3B26C4BA2E1F Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=YVzROFIW Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id 3EEC64BA2E07 for ; Mon, 5 Jan 2026 16:39:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3EEC64BA2E07 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3EEC64BA2E07 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767631143; cv=none; b=EdzhiSOFWZaHc/D9vMg64SAeJxEUOwJheXcYPZPdzKsfz8tjnh2l1fogDI/eeSkq01VnHq++IzUpeGpM71KVHzPTNcRZZLumpHl7Co+tZ5mIU2v7NfE2TWbVzvQAZC37rNpsIZcpeIZMXtBxzDu4gO40q8H7nmE3q9sEpOJ1/uY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767631143; c=relaxed/simple; bh=uLu/bwXgMJawn57E8lh4muf4PrdSIV6+c1RNrkFnLS0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=KX42gF8oUhgvGZY4IuJy/lAFw9dgbbd+s92eJfd9vorip4eabGcea9MamnniCokX4VhT1Jqrt6ZPIjCzxsBLqvOo19NbmRD1+f+rDWc+NMcDRX3YeTMDgE7NI7Cx1Edbp/jjbjIOrZqwGL/2/NPLLaDgOwuKxZno+zLqhmmQgZU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3EEC64BA2E07 Received: from eig-obgw-5003b.ext.cloudfilter.net ([10.0.29.155]) by cmsmtp with ESMTPS id cdJxvYfDfipkCcnbivw5yy; Mon, 05 Jan 2026 16:39:02 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id cnbhvNWgK2l0kcnbhvRkX6; Mon, 05 Jan 2026 16:39:01 +0000 X-Authority-Analysis: v=2.4 cv=UfRRSLSN c=1 sm=1 tr=0 ts=695be925 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=vUbySO9Y5rIA:10 a=ItBw4LHWJt0A:10 a=ZRG8EQ905dP3oCx6zLcA:9 a=zZCYzV9kfG8A:10 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=LyyjuROL1ybhocB0DL5waBBjgUVPPJ63kHGSYmqQLYc=; b=YVzROFIWNkpKRdsqy1bzkMYOeA Zaxvx6E/zNaeK2ELz4RIDPoqjDFMCYbTqP7sfGU8cCth/z6Zu9VoXdwopkvJgvMK7lk2T0SbP3H9v nmIb8bP82RqfmN3de/aFTXk07; Received: from 75-166-246-134.hlrn.qwest.net ([75.166.246.134]:50388 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vcnbg-00000000LwN-3szx; Mon, 05 Jan 2026 09:39:01 -0700 From: Tom Tromey To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb] Fix heap-buffer-overflow in args_complete_p In-Reply-To: <20260103145559.2722584-1-tdevries@suse.de> (Tom de Vries's message of "Sat, 3 Jan 2026 15:55:59 +0100") References: <20260103145559.2722584-1-tdevries@suse.de> X-Attribution: Tom Date: Mon, 05 Jan 2026 09:38:59 -0700 Message-ID: <87jyxwxbdo.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.246.134 X-Source-L: No X-Exim-ID: 1vcnbg-00000000LwN-3szx X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-246-134.hlrn.qwest.net (bapiya) [75.166.246.134]:50388 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfJFbo8c35hU3FaRnIlE37GQyz8JIum3VKtryV03rLuoA9cJSRv3OSJISZYhQi8Nv5oKGpH8yvdsP1XG001WznSucLNjRj+wOfEES2cwDKNuQpWkd6k4g k6tZ4eg46prthazhc5qyVrdIEiV4ECIhPqoJgUB5ZlwhLADw4IcL+oPGY3ALKZog49v5Qxf6q07Uumd17SArc4O7mr2IQ/T1/zg= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >>>>> "Tom" == Tom de Vries writes: Tom> + auto at = [&] (const char *s) Tom> + { Tom> + return s > end ? '\0' : *s; Tom> + }; I think it would better to avoid stepping off the end at the points where the pointer is incremented. Tom> + while (at (input) != '\0') Like this could be for (input = skip_spaces (input); *input != '\0'; input = skip_spaces (input)) and then there's like one or two spots to check in the loop. Tom