From a48fd0e2fc96e53fa2521d0e11e1c48b2b348849 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sat, 18 Oct 2025 02:30:27 +0300 Subject: [fs] Adds validity check on dencoding --- lib/_ak_fs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/_ak_fs b/lib/_ak_fs index b216e55..3d5ed71 100755 --- a/lib/_ak_fs +++ b/lib/_ak_fs @@ -630,11 +630,16 @@ function _ak_fs_net_cat(){ counter="$(expr $counter + 1)" done base64 -d output > output.d + if [ $? -ne 0 ] + then + _ak_log_error "Fatal error during dencoding." + exit 1 + fi shaout="$(sha512sum output.d | awk '{print $1}')" expHash="$2" if [ "$shaout" == "$expHash" ] then - base64 -d output + cat output.d _ak_log_info "Recreation of $treeRootHash succeeded!" else _ak_log_error "Recreation of $treeRootHash failed!" -- cgit v1.2.3