diff options
Diffstat (limited to 'c_implementation')
-rw-r--r-- | c_implementation/src/ak_fs.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/c_implementation/src/ak_fs.c b/c_implementation/src/ak_fs.c index 07178bc..148f0ca 100644 --- a/c_implementation/src/ak_fs.c +++ b/c_implementation/src/ak_fs.c @@ -370,7 +370,12 @@ int ak_fs_cfm(akfs_map_v3* map) { sha512sum x; ak_fs_sha512sum_init(&x); - x = *(ak_fs_map_v3_get_root_hash(map)); - ak_fs_cat_file_from_root_hash(&x); - return 0; + sha512sum *rh_ptr = ak_fs_map_v3_get_root_hash(map); + if ( rh_ptr == NULL ) + { + ak_log_debug(__func__, "No root hash found on the map"); + return -1; + } + x = *rh_ptr; + return ak_fs_cat_file_from_root_hash(&x); } |