[sheepdog] [PATCH] sheepfs/http: fix variable uninitialized in curl_get_object_size

Liu Yuan namei.unix at gmail.com
Tue Apr 22 08:17:08 CEST 2014


On Mon, Apr 21, 2014 at 06:37:08PM +0800, Ruoyu wrote:
> If curl_easy_init is failure, the variable content_length will be
> uninitialized. This will come into unexpected problem.
> 
> Signed-off-by: Ruoyu <liangry at ucweb.com>
> ---
>  sheepfs/http.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sheepfs/http.c b/sheepfs/http.c
> index 3732db3..0f26983 100644
> --- a/sheepfs/http.c
> +++ b/sheepfs/http.c
> @@ -74,7 +74,7 @@ static uint64_t curl_get_object_size(const char *url)
>  {
>  	CURL *curl;
>  	CURLcode res;
> -	double content_length;
> +	double content_length = 0;
>  
>  	curl = curl_easy_init();
>  	if (!curl) {
> -- 
> 1.8.3.2
> 
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog

Applied thanks

Yuan



More information about the sheepdog mailing list