Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c4c1500

Browse files
authored
Merge pull request #5145 from pks-t/pks/hash-algo-uninit-return
hash: fix missing error return on production builds
2 parents 73427b9 + 7fd3f32 commit c4c1500

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/hash.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ int git_hash_init(git_hash_ctx *ctx)
4242
return git_hash_sha1_init(&ctx->sha1);
4343
default:
4444
assert(0);
45+
return -1;
4546
}
4647
}
4748

@@ -52,6 +53,7 @@ int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
5253
return git_hash_sha1_update(&ctx->sha1, data, len);
5354
default:
5455
assert(0);
56+
return -1;
5557
}
5658
}
5759

@@ -62,6 +64,7 @@ int git_hash_final(git_oid *out, git_hash_ctx *ctx)
6264
return git_hash_sha1_final(out, &ctx->sha1);
6365
default:
6466
assert(0);
67+
return -1;
6568
}
6669
}
6770

0 commit comments

Comments
 (0)