[Bf-committers] 50 ways to crash your blender

Kent Mein bf-committers@blender.org
Tue, 20 May 2003 15:32:21 -0500


In reply to Holger Haase (holgrhaase@web.de):
I'd say its a good idea.
I would suggest it be put in:
    blender/src/blender/source/blender/include/blendef.h

Just taking a quick look at that file since were on the topic :)
There is a /******************* MAX ***********************/
section that has a couple of other MAX values...
MAXFLOAT is not there though its at the top just before 
including float.h  Anyone see a problem with moving the MAX section
up on the code so its up there with MAXFLOAT?

Kent

> Hello all,
> 
> I played around with the sequencer, until blender crashed.
> I searched the sources and found out, that the cause was something, that
> might lead to crashes in other areas too.
> The problem is, that StripElem.name[40] can only keep 39 characters, but is
> supposed to store a filename.
> There are three constants concerning lengths of file related stuff:
>   FILE_MAXDIR  defined in util.c, BKE_utildefines.h, DNA_space_types.h
>   FILE_MAXFILE defined in   "           "                  "
>   MAXPATHLEN   defined via MAX_PATH from windows.h in the windows world
>                  and   via sys/param.h in the other worlds.
> 
> Do we really need three constants? As directorynames and filenames can be
> combined randomly, wouldn't it be enough to define MAXPATHLEN in a global
> header file and use this constant everywhere where directory- and/or
> filenames can be stored?
> 
> This global header file would be the ideal place to serve other
> system-dependent constants as well, like the SEPARATOR for directory- and
> filenames as a char and a string. I've already seen two places in the source
> where entire blocks were duplified instead of using a constant... OK, one is
> slightly different, but has the same function.
> 
> Perhaps anyone familiar with the naming scheme for the sources can put such
> a file into the cvs? Otherwise I'll feed blender with a directoryname of 254
> chars and a filename of 1 char, after that with a directoryname of 3 chars
> and a filename of 252 chars and report every crash in the bug-tracker :-))
> 
> -
>   holger
> 
> _______________________________________________
> Bf-committers mailing list
> Bf-committers@blender.org
> http://www.blender.org/mailman/listinfo/bf-committers

-- 
mein@cs.umn.edu
http://www.cs.umn.edu/~mein