From 6d205e8095d553fdb5bfbc2077ef6130cae161b9 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 23 Nov 2020 07:21:02 +0200 Subject: [PATCH] kiss: fix UB around find --- kiss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kiss b/kiss index cc40ced..d684e6e 100755 --- a/kiss +++ b/kiss @@ -535,7 +535,11 @@ pkg_manifest() ( # contents. # sed: Remove the first character in each line (./dir -> /dir) and # remove all lines which only contain '.'. - find . -type d -exec printf '%s/\n' {} + -o -print | sort -r | + { + find . -type d -exec printf '%s/\n' {} + + find . ! -type d -print + + } | sort -r | sed '/^\.\/$/d;ss.ss' > "${2:-$pkg_dir}/$1/$pkg_db/$1/manifest" )