From: Andre Noll Date: Tue, 17 Mar 2009 22:58:58 +0000 (+0100) Subject: Fix possible NULL pointer dereference in afh_get_header(). X-Git-Tag: v0.3.4~30 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=b7be92e6a411d44dc0ca1ac9885fff97d851e2bd;p=paraslash.git Fix possible NULL pointer dereference in afh_get_header(). --- 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;