]> git.tue.mpg.de Git - paraslash.git/commitdiff
Fix possible NULL pointer dereference in afh_get_header().
authorAndre Noll <maan@systemlinux.org>
Tue, 17 Mar 2009 22:58:58 +0000 (23:58 +0100)
committerAndre Noll <maan@systemlinux.org>
Tue, 17 Mar 2009 22:58:58 +0000 (23:58 +0100)
afh_common.c

index aa7f3d92444faddf9d193aa6c2b86fe04b697d14..8c0eed2731837da4e8d3847d1d3d6caeddfe5102 100644 (file)
@@ -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;