[BUG] opening unix-written image files

Felix Franz fefr at gmx.net
Fri Jan 25 10:16:12 UTC 2002


Tim Rowledge wrote:

> For the first time ever, I've been bitten by a small bug in image
> reading - or more precisely image checking before reading. I _think_
> this also affect windows vms, based on a quick scan of the source code
> I have available to check.
> 
> Unix vms put the 512 byte pre-header at the front of images when wtiting
> them; I think this must be fairly recent since I've never had this
> problem before and I frequently move images from unix to acorn and back.
> When checking the passed in image name before actaully reading it, I use
> a quick check that reads the first word of the file to see if it isa
> plausible imagefile. You can see the problem immediately, I'm sure; with
> the unix added header, this test will fail.
> 
> Since the w32 vm appears to use the same piece of code (IsImage()), I
> suspect the same problem can occur.


yes, the same problem occurs on Windows (latest VM) also.

Cheers,

felix

> 
> The solution is reasonably simple, just make the IsImage check able to
> also see if the version token is at offset 512.
> 
> tim
> 





More information about the Squeak-dev mailing list