From b7be92e6a411d44dc0ca1ac9885fff97d851e2bd Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 17 Mar 2009 23:58:58 +0100 Subject: [PATCH] Fix possible NULL pointer dereference in afh_get_header(). --- afh_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afh_common.c b/afh_common.c index aa7f3d92..8c0eed27 100644 --- a/afh_common.c +++ b/afh_common.c @@ -256,9 +256,10 @@ uint32_t afh_get_largest_chunk_size(struct afh_info *afhi) */ void afh_get_header(struct afh_info *afhi, void *map, const char **buf, size_t *len) { - if (!map || !afhi || ! afhi->header_len) { + if (!map || !afhi || !afhi->header_len) { *buf = NULL; *len = 0; + return; } *len = afhi->header_len; *buf = map + afhi->header_offset; -- 2.39.5