
11 Feb
2011
11 Feb
'11
8:21 p.m.
Dear Peter Tyser,
In message 1297443439.965.1208.camel@petert you wrote:
- 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.
Good point, will fix. Thanks!
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
HANDLE WITH EXTREME CARE: This Product Contains Minute Electrically
Charged Particles Moving at Velocities in Excess of Five Hundred
Million Miles Per Hour.