> +        } else if (!num) {
> +            error_report("Unexpected end of image");
> +            return 0;

I think this test can miss some case of Unexpected end of image.

For example supose that in map_is_allocated the first bdrv_is_allocated
actually succeed then *pnum = num. Then the bottom loop has exit on failure
and the function return.

in map_f &num is map_is_allocated *pnum so map_f's num != 0 and this very test
fails to see the unexpected end of image error.

Best regards

Benoît

>          }
>  
>          retstr = ret ? "    allocated" : "not allocated";
> -- 
> 2.0.4
> 
> 

Reply via email to