From nobody Thu Nov 03 06:28:31 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N2v343Z39z4h6VN for ; Thu, 3 Nov 2022 06:28:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N2v341frpz3vTQ for ; Thu, 3 Nov 2022 06:28:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N2v340dMDzQwL for ; Thu, 3 Nov 2022 06:28:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 2A36SWl1056131 for ; Thu, 3 Nov 2022 06:28:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2A36SWc6056130 for bugs@FreeBSD.org; Thu, 3 Nov 2022 06:28:32 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 267537] contrib/nvi: Fix core dump when tags file pattern has a trailing '\' Date: Thu, 03 Nov 2022 06:28:31 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: leres@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667456912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YtN94TPZpfx3Fd9/r8xStHHKlEFzhKPOWSo5QVgegnw=; b=iedieovBh/bsTCEg/JFyeBqqa8yqx5fxTDpvdsMofuAwPCqHO/zQrIIIdxMH7BWIyPAv+e ySKWAO1gPP37fubFF7ccgFBo5J7Zf+FTVB2qZIH1pIg253Fksdz1/sYl+c6gLupV2nhhG8 fdlSfPZNiSLiqDtbkWuS0sxtAj3BC1x1Sw7o2vciFuIdnxlJ/HgpwXiwSukF/11JXqf9gZ QWOLF+gm0KpWAB10z4bO/dT8Rf2Dnqdfk++eScjciaudxWjC9WUy+yrybSgOal8/Km3myq 7wsOGWZ2aBgz7v9/ZhecnU8zfMMtkjAzFqF3dKdJkeHI5s84c2PCpwrhWlWeSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667456912; a=rsa-sha256; cv=none; b=Yk2NmpDQybOwiJFG729P0+7a7gIQ6svy7ZTaLx+R3hemvNhND2t+MITDgVHhvariuArYTu EMX/kEiqJFCQopcYdbWwlyV7fqLXctN298OlMhq3l/2dHEPZHlaHWTaSibNNZQ5aAUbimE Urxj6VS3lpVS27RzAC1HFjYwZxdZHPqjVKpA5Us7Hs1uj/j0lAT4sesJy84cUOT2V0Tj99 Mdf6OZ58Pyb2Nnr3gd+mfRvUpB3BS7peCaSXeB+cATKeJgyFXIxqWwqpYutiL92zy3/UfM e6ip3WXIMbulV1RoRZt5LfHC3Sc9qSAFG/2hTeAjG6Zy+2InVy9S7RpD5u+sHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267537 Bug ID: 267537 Summary: contrib/nvi: Fix core dump when tags file pattern has a trailing '\' Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: leres@freebsd.org If you create a tags file of a macro that ends with a '\' and tag for it, vi dumps core. For example: zinc 76 % cat test.h #define LATIN2PLAIN(ch) (((u_char)ch) >=3D 0x80 ? \ pgm_read_byte_far(pgm_get_far_address(latin2plain) + \ (((u_char)ch) - 0x80)) : (isprint(ch) ? (ch) : '_')) zinc 77 % ctags test.h zinc 78 % vi -t LATIN2PLAIN Segmentation fault The problem is that the loop variable is unsigned (size_t) and it gets decremented twice: 1 -> 0 -> 4294967295 Here's the pull request that solves it for the github fork that the editors/nvi2 port uses: https://github.com/lichray/nvi2/pull/111 --=20 You are receiving this mail because: You are the assignee for the bug.=