[comp.sys.atari.st] C-Kermit date bug -- Anyone else find this problem?

dag@per2.UUCP (Daniel A. Glasser) (01/02/90)

Two years ago, someone posted a version of C-Kermit in comp.binaries.atari.st
(I think it was volume 7) in an archive (kerm_exe.arc).  I no longer have the
clear text that was in the posting and there is no pointer to the author that
I can find in the files within the arc file.

There is a bug in this program that causes odd to fatal results when it
is used in December, or used to transfer files in December.  The source
problem is that the month array (declared either local to the function
"ztime", or static to the module that contains the function ztime) is
declared something like 
	char *months[12] = {"","January",...,"December"};
Note that there are 13 elements in the declaration list.  The problem is that
the C compiler used to compile this module allocated enough room in the months
array for only 12 pointers to char.  (It still stored all 13 strings.)  The
result is that when ztime is called to do something in December, it treats
the four bytes at &months[12] as a pointer, but these are the beginning
of the next bit of initialized data which happen to be a string.  The four
characters are passed in a long as a pointer to sprintf then to xprintf where
the "%s" in the format string causes an access to this bad value and BANG!

I was able to figure the above out without the source using the MWC symbolic
debugger since CKERMIT.TOS is not stripped and was built with the MWC compiler.
I looked at all the ST source archives I could find via FTP, and looked in the
Columbia University Kermit source archives and could not find the sources for
the ST C-Kermit.  I don't have the name of the author of this port.

If someone out there has these sources and can make the change, please do.
Also, I would like a copy of the sources myself if at all possible.  I would
like to add a few features to make it even more useful. (Full VT52 emulation,
vt100 emulation, etc.)
-- 
 _____________________________________________________________________________
    Daniel A. Glasser                 "Their brains were small and they died."
    uwvax.cs.wisc.edu!per2.uucp!dag
 ---Persoft, Inc.---------465 Science Drive-------Madison, WI 53711-----------