[BUG] opening unix-written image files

Tim Rowledge tim at sumeru.stanford.edu
Fri Jan 25 02:08:43 UTC 2002


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.

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

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful Latin Phrases:- Fac ut vivas. = Get a life.




More information about the Squeak-dev mailing list