Hi Wolfgang,

> -     return !!gunzip((void *) dst, dst_len, (void *) src, &src_len);
> +     rc = gunzip((void *) dst, dst_len, (void *) src, &src_len);
> +
> +     printf("Uncompressed size: %ld = 0x%lX\n", src_len, src_len);
> +     sprintf(buf, "%lX", src_len);
> +     setenv("filesize", buf);
> +
> +     return !!rc;

What about:
if (rc)
        return rc;

printf("Uncompressed size: %ld = 0x%lX\n", src_len, src_len);
sprintf(buf, "%lX", src_len);
setenv("filesize", buf);

return 0;


This will prevent printing and setting of bogus values when an invalid
or overly large image is unzipped.

Best,
Peter

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to