From 499ac84ac05889543f80f5be9d9870efeb948651 Mon Sep 17 00:00:00 2001 From: Darryl Miles Date: Mon, 30 Sep 2024 06:11:54 +0100 Subject: [PATCH] database/DBio.c: Redundant null check due to previous dereference Fix code scanning alert no. 132: Redundant null check due to previous dereference (#39) * Update DBio.c * AI wanted to move guard 'pathptr != NULL' up to 1953, but it is assigned to guaranteed non-null in every assignment above and only incremented or dereferenced. --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- database/DBio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/DBio.c b/database/DBio.c index 889f7ba0..330afcda 100644 --- a/database/DBio.c +++ b/database/DBio.c @@ -2148,7 +2148,7 @@ badTransform: /* default path but the new cell has a (different) path. */ /* The paths only match if pathptr is the CWD. */ - else if ((pathptr != NULL) && (*pathptr != '\0')) + else if (*pathptr != '\0') { bool pathOK = FALSE; char *cwddir = getenv("PWD");