POV-Ray : Newsgroups : povray.programming : Possible problem in Mac source : Re: Possible problem in Mac source Server Time
29 Jul 2024 00:24:00 EDT (-0400)
  Re: Possible problem in Mac source  
From: Jon A  Cruz
Date: 14 Nov 1999 02:24:08
Message: <382E63E2.44D8BD9E@geocities.com>
Thorsten Froehlich wrote:

> In article <382DD8EA.259EDEF8@compuserve.com> , Chris Huff
> <Chr### [at] compuservecom>  wrote:
>
> > I have been trying to compile a Mac version of UVPov, but the compile
> > crashes immediately on startup. The crash does not occur when I compile
> > for the POV.PPC-dbg target, but does happen for the POV.PPC target. I
> > have not tested any others.
>
> The problem is the too long version string macro POV_RAY_VERSION which is
> copied into just 16 bytes of memory in function CreateSplashScreen in
> SplashScreen.c. Just change the size of povVers to 32.
>

NO NONO NONONONONONONNO!!!!!!!!
aaaaaaaaaaaaaahhhhhhhhhhhhhh!!!!!!!!!!!!!!!!!!!

(sorry, but I sometimes panic at potentially dangerous code)  :-)

Wouldn't it be safer to change it to something like

[taking a wild guess without having the mac sources around]

char povVers[ sizeof(POV_RAY_VERSION) + 1 ];
or
char *povVers = (char *)malloc( sizeof(POV_RAY_VERSION) + 1 );

?

--
"My new computer's got the clocks, it rocks
But it was obsolete before I opened the box" - W.A.Y.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.