Skip to content

Commit

Permalink
Fixes radareorg#23930 - fix ssdeep formatting ##print
Browse files Browse the repository at this point in the history
  • Loading branch information
mattunleashed committed Feb 2, 2025
1 parent 3a17978 commit df46e00
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libr/crypto/hash/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,10 @@ R_API R_MUSTUSE char *r_hash_tostring(R_NULLABLE RHash *ctx, const char *name, c
digest_hex = calloc (digest_hex_size, 1);
snprintf (digest_hex, digest_hex_size, "%02.8f", ctx->entropy);
} else if (digest_size > 0) {
if (digest_size * 2 < digest_size) {
if (algo & R_HASH_SSDEEP) {
digest_hex = malloc (digest_size + 1);
snprintf (digest_hex, digest_size + 1, "%s", ctx->digest);
} else if (digest_size * 2 < digest_size) {
digest_hex = NULL;
} else {
digest_hex_size = (digest_size * 2) + 1;
Expand Down

0 comments on commit df46e00

Please sign in to comment.