From nobody Tue Jan 25 16:01:13 2022 X-Original-To: dev-commits-src-all@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 DFA0F196E57E; Tue, 25 Jan 2022 16:01:13 +0000 (UTC) (envelope-from git@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 4Jjs615zfqz3ndj; Tue, 25 Jan 2022 16:01:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643126473; 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=nt7+rA9SZnCfGIJsnf5I/4Pd4m5Khk+Au2YK1T2b4NE=; b=JVBlgcd1GAHGAck+v2qcXftSG6Rc9AqfYs8wQ8XmgBK5Fc5R/OgMhtfYjmapHM9xQNiyou 3HwgClx4WZR15g60rzB9HTYzYMxlGme/jDZyXIwifVgDEN2MpCPFQJOmQdMHE6vP3X8SIK da/fyFKF0kJkxIxjcUijSMI9rlOoj4doHGZbEu7FMJIuwNSfidI1uJKkJmwSys2UE8NC3N AGFIUpCncO1Ht6F2gt9G0q173i31WRRtJTWNr1ntr6dKejk83CA1WRDuY1URwsRqIwqxGF OdyE14DemtUhiHWpJdyXPfxoqwhvotE/eQlQ/kDYjX85Wg6G89mDDL7oAUZiHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 ADB984B62; Tue, 25 Jan 2022 16:01:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20PG1DTD004988; Tue, 25 Jan 2022 16:01:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20PG1Dh4004987; Tue, 25 Jan 2022 16:01:13 GMT (envelope-from git) Date: Tue, 25 Jan 2022 16:01:13 GMT Message-Id: <202201251601.20PG1Dh4004987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: b7a74bbc41b3 - main - stop on error and display the statstics anyway List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7a74bbc41b38fc7f43d66ba868e22a97f08f660 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643126473; 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=nt7+rA9SZnCfGIJsnf5I/4Pd4m5Khk+Au2YK1T2b4NE=; b=vaH3xOtkD4rBy61IG9NNNiUr5ec63KGlxgOnnK7W+YF+3wK1A+GVORT3UhPiGM8/77srtp DGyMgI65vV8eDgi0YcidKFiMcwoW2+n/D9x5aQhcogMdWsI3folpmEtkEf+7rT1GXFoink Rri9fePcYgPuzBnNCIb+VM9xmov4D7GhcRSWrKBOi6G8zb5V+UgX3MISmyciqldNe6GVNw M+6OXQrRnrp8nT1xt6XyRqQVD1G6/1QxfjRkd+GgzN1UwSTckYIEdAvuTtBc9EqnmpdJ2s /dKlM5oACN7OMJopD7MdjB9lreJCx/IMOw1oxNJGjM1Dw/oQFZKa6PwJMrJIVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643126473; a=rsa-sha256; cv=none; b=JWTcnWhhuFUh5iTxlaUw6ruljc+ViNT8Tc9r4D4YEVyfEGijpNTifM3pbwsuI18OLKnKK2 IzgGWO0rlhL6tp1zJSIzvV93lkbQg9ds068RW8Ia2fbhz6KVClag8msz28Ft4v8ExZ7Mui o+hVkvG3RYhj7GIttLIv1WMvTOL7vuCYDTPslfU6HKr1+S3wmZlAjj7BFzh/7Uo2cJx/Fk h9cdPjjtMAiQ34kDctFccweCa0w/+CsnbKAyBYLWLF8tmmGRAIp+yJIiyi0wUf+uDxZGJR W5Q1qHjRUJC8wfXtKAZWoSFR5KGdlyPD7DB9EBcNeFGR16z54JwKebw3IteNzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=b7a74bbc41b38fc7f43d66ba868e22a97f08f660 commit b7a74bbc41b38fc7f43d66ba868e22a97f08f660 Author: Wolfram Schneider AuthorDate: 2022-01-25 15:58:29 +0000 Commit: Wolfram Schneider CommitDate: 2022-01-25 15:59:41 +0000 stop on error and display the statstics anyway PR: 32686 --- usr.bin/locate/locate/fastfind.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c index b230f93439fd..67d22bfca7b7 100644 --- a/usr.bin/locate/locate/fastfind.c +++ b/usr.bin/locate/locate/fastfind.c @@ -66,6 +66,12 @@ statistic (fp, path_fcodes) } else count += c - OFFSET; + if (count < 0 || count > MAXPATHLEN) { + /* stop on error and display the statstics anyway */ + warnx("corrupted database: %s", path_fcodes); + break; + } + for (p = path + count; (c = getc(fp)) > SWITCH; size++) if (c < PARITY) { if (c == UMLAUT) {