From nobody Tue Sep 06 23:22:38 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 4MMhHy3mdFz4bwQc; Tue, 6 Sep 2022 23:22:38 +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 4MMhHy3GfGz448F; Tue, 6 Sep 2022 23:22:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662506558; 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=bm9KVwHrqLCQFwX7Bgzdk3Qu28k7XKPC3DTNrH+qZEY=; b=L88nya3EeaWts2kOi9VRuAuZfhBa34zEsgbWzwyqxnfJvMDHAP64SOaU5fojzt//PvIzTX dkF3UySNCTGIyBpYa+pycnOKe6yNE9iFeNTHgeNfaR6GqwNJFeIcAr56/AKZN1XccmnPbP SM5U9DvN3fF/c4fCOhGncsF86VwKMlNmiFyGNfVPRrVkXCaHKZV0kzdrYSQ57HEQz06Efh O2mdxCv890inrcTe+VuOKUKTQWIAbNZITPAdIig+O8y0+jUYy7C8kGzg03wX2zBlxbKx6s 7HeaGTqeWz315LRYKl0ZicSUMUxET1G0kJx5Gi5GGpp5nveuhQFqstw1yqFcIA== 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 4MMhHy2KBWzL3D; Tue, 6 Sep 2022 23:22:38 +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 286NMcIw031076; Tue, 6 Sep 2022 23:22:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 286NMcqp031075; Tue, 6 Sep 2022 23:22:38 GMT (envelope-from git) Date: Tue, 6 Sep 2022 23:22:38 GMT Message-Id: <202209062322.286NMcqp031075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 2567b60f6253 - main - Fix for f4fc389. 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: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2567b60f62534bf5b243972f85b4921bba837439 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662506558; 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=bm9KVwHrqLCQFwX7Bgzdk3Qu28k7XKPC3DTNrH+qZEY=; b=v3vTsYpFaHjwzVwCEFAJ/IF1/RASYpfYyfnXgCByy7660KR6C1k2VouIy+DoWk+WpcmGa2 MVkLbP1EOS5zmFpsrYRDjcy9bUs7u8fV7eNVvJKeqyWKhR5Ey683kvUh+nF8JloCJ78wAC r1x+87Ec0QUBkE/335F9W4tjS5LGa1sFTk10mC4XsdcvVFzRsKAvXk2lnAhv+/pYEUzPOD T3CyyNV4n3OqkLCDvqWQ6sME3qsxVVBJBeyV3pz7Qasb9Y0sRQb/jntlVj1nl0ZkKSRm9a /3abVCw6B5WIklUs4FXJTOoudmpqSHzaczCxE+nxB40/hyRju79ApTDHiIxY9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662506558; a=rsa-sha256; cv=none; b=xlIyHuCVOW+GgiIUZ8a0UurpqCiaB0H2m+LNJ+69AOcUzR8Cq0AAR3vodbehmvLP1zdzzD gYqLN19YbaOHazfrRDswxnclt7O1ha/r88MtsnWNjMUFPq9f6ybLvNGKI5HYW8xyvdqK8q YpUKTtL7Kam1x4EPZ3IZmt1TQ5lXDBQhQFlwruhp/L0j21fFVkFQf4kbWTafTD/5Z8TIj4 w6kZ1JM1JpvSLAq02pU99RaxusW2Qk+6ZKlDCeyUjJZZ5Eoia8GlWWfmkkNCR9Bw0S6ME9 mlNgjQ7pzyiIKCZZU/L/Ly3c+YaVRs7T4Aqju3ey1ta8I+ByRbp3aLKR62gqXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=2567b60f62534bf5b243972f85b4921bba837439 commit 2567b60f62534bf5b243972f85b4921bba837439 Author: Kirk McKusick AuthorDate: 2022-09-06 23:22:03 +0000 Commit: Kirk McKusick CommitDate: 2022-09-06 23:22:03 +0000 Fix for f4fc389. Need to check for NULL pointer before using. Reported by: Peter Holm Sponsored by: The FreeBSD Foundation --- sbin/fsck_ffs/dir.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c index 87e3e34cc1ad..ba286a965513 100644 --- a/sbin/fsck_ffs/dir.c +++ b/sbin/fsck_ffs/dir.c @@ -583,7 +583,8 @@ linkup(ino_t orphan, ino_t parentdir, char *name) inoinfo(lfdir)->ino_linkcnt++; pwarn("DIR I=%lu CONNECTED. ", (u_long)orphan); inp = getinoinfo(parentdir); - if (parentdir != (ino_t)-1 && (inp->i_flags & INFO_NEW) == 0) { + if (parentdir != (ino_t)-1 && inp != NULL && + (inp->i_flags & INFO_NEW) == 0) { printf("PARENT WAS I=%lu\n", (u_long)parentdir); /* * If the parent directory did not have to @@ -840,8 +841,7 @@ allocdir(ino_t parent, ino_t request, int mode) irelse(&ip); return (0); } - if ((inp = getinoinfo(ino)) == NULL) - inp = cacheino(dp, ino); + inp = cacheino(dp, ino); inp->i_parent = parent; inp->i_dotdot = parent; inoinfo(ino)->ino_state = inoinfo(parent)->ino_state;