commit a23861332aad80bc62a1552d7fe2d081b2a40999
parent ef6e00c85cfc24f59382bce460d98e946820b3cf
Author: Peter Zmanovsky <48548636+peter15914@users.noreply.github.com>
Date: Thu, 19 Dec 2024 12:26:32 +0500
Check NULL from abspath()
abspath() returns NULL in some cases and its return value is always checked for NULL.
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/nnn.c b/src/nnn.c
@@ -8759,6 +8759,11 @@ int main(int argc, char *argv[])
close(fd);
selpath = abspath(optarg, NULL, NULL);
+ if (!selpath) {
+ xerror();
+ return EXIT_FAILURE;
+ }
+
unlink(selpath);
}
break;