[comp.sys.mac] BinHex4 bug?

jrk@sys.uea.ac.uk (Richard Kennaway) (06/18/89)

I recently had problems decoding Font Harmony Updater, Font & Sound Valet
Updater, and Suitcase II Updater that were recently posted to
comp.binaries.mac.  All three gave CRC errors from BinHex4.  I posted a
message to comp.sys.mac (uk only) asking if anyone had good copies.  I
heard from one person who had also found errors, and one who had not.
From the latter I obtained a fresh copy of the Suitcase II Updater binhex,
but it was identical to the one I already had.

So how did he decode it?  With the Decode BinHex feature of Stuffit.  I
tried Stuffit, and all three files decoded and unpacked successfully.

Then I tried reencoding the .SIT files with BinHex4, and decoding the
resulting files with BinHex4.  Result: each encoded successfully, and
produced a CRC error on decoding.  Looks like a bug in BinHex4.

Is this a known bug?  Is there a fix?  (Cheaper, that is, than buying
Stuffit - up to now, I've used the freeware BinHex4 and UnStuffit.)

Can anyone tell me the format of BinHex4 files, so I can take a closer look
at these errors?
--
Richard Kennaway          SYS, University of East Anglia, Norwich, U.K.
uucp:  ...mcvax!ukc!uea-sys!jrk		Janet:  kennaway@uk.ac.uea.sys

jklee@phoenix.Princeton.EDU (James Kin Wah Lee) (06/19/89)

In article <610@sys.uea.ac.uk> jrk@uea-sys.UUCP (Richard Kennaway) writes:
>
>I recently had problems decoding Font Harmony Updater, Font & Sound Valet
>Updater, and Suitcase II Updater that were recently posted to

I had exactly the same problems.  I have not, however, had any problems
with BinHex4 before.  Could it be some mysterious glitch that somehow
got into the uploaded files?

JIM
--------------------------------------------------------------------------
Jim Lee (jklee@phoenix.Princeton.EDU)    * * * * * * * * * * * * * * * * *
Dept. of Geol. & Geophys. Sci.           * THERE ARE STRANGE THINGS DONE *
Princeton University                     *   IN THE MIDNIGHT SUN .....   *
Princeton, NJ      08544                 * * * * * * * * * * * * * * * * *
--------------------------------------------------------------------------

ephraim@think.COM (Ephraim Vishniac) (06/19/89)

In article <610@sys.uea.ac.uk> jrk@uea-sys.UUCP (Richard Kennaway) writes:

>I recently had problems decoding Font Harmony Updater, Font & Sound Valet
>Updater, and Suitcase II Updater that were recently posted to
>comp.binaries.mac.

Note the relatively long file names.

>All three gave CRC errors from BinHex4.

Yup, they'll do that.

>So how did he decode it?  With the Decode BinHex feature of Stuffit.  I
>tried Stuffit, and all three files decoded and unpacked successfully.

>Then I tried reencoding the .SIT files with BinHex4, and decoding the
>resulting files with BinHex4.  Result: each encoded successfully, and
>produced a CRC error on decoding.  Looks like a bug in BinHex4.

It is.

>Is this a known bug?  Is there a fix?

There is a known bug in BinHex 4.0, which causes it to overrun an
internal buffer when decoding files with long names.  (Over 28
characters, I think.)  There's no fixed version of BinHex 4, but there
are several alternatives.  One is to use StuffIt, another is to use
xbin on your friendly :-) local UNIX box.

The source code for BinHex 4.0, including some notes about this bug,
is available via anonymous ftp from sumex-aim.stanford.edu, under the
info-mac directory.  So, the ultimate alternative is to fix the source
code and release a new version.

Ephraim Vishniac                        One of the flaws in the anarchic
Thinking Machines Corporation           bopper society was the ease with
245 First Street, Cambridge, MA 02142-1214      which such crazed rumors
Internet: ephraim@think.com   AppleLink: ThinkingCorp      could spread.

dplatt@coherent.com (Dave Platt) (06/21/89)

In article <610@sys.uea.ac.uk> jrk@uea-sys.UUCP (Richard Kennaway) writes:
>
> Is this a known bug?  Is there a fix?  (Cheaper, that is, than buying
> Stuffit - up to now, I've used the freeware BinHex4 and UnStuffit.)
> 

It's a known bug.  I first heard about it when people had trouble
decoding part of my MandelZot fractal-application posting earlier this
year.  One of the files could be decoded with StuffIt, but not with
BinHex 4.0.

Somebody followed up on the problem by contacting the author of BinHex
4.0, and learned that there is indeed a bug in BinHex.  It rears its
head when the length of the encoded filename exceeds some limit (longer
than 27 characters, I think)... BinHex becomes confused and won't decode
the file.

I doubt that BinHex will ever be fixed... we'll simply have to live with
the problem, avoiding it by using shorter filenames or working around it
by using StuffIt to decode files.

-- 
Dave Platt    FIDONET:  Dave Platt on 1:204/444        VOICE: (415) 493-8805
  UUCP: ...!{ames,sun,uunet}!coherent!dplatt     DOMAIN: dplatt@coherent.com
  INTERNET:   coherent!dplatt@ames.arpa,  ...@uunet.uu.net 
  USNAIL: Coherent Thought Inc.  3350 West Bayshore #205  Palo Alto CA 94303