From: Alien999999999 <ali...@us...> - 2004-07-22 16:04:31
|
Op donderdag 22 juli 2004 16:36, schreef Michael Roitzsch: > Hi James, > > > Also check for any buffers placed on the stack, and replace them with > > heap storage. > > Let me know if there is an easy way to do this. To me, this proposal sounds > like weeks of work... > > And I don't think that > char *string = (char *)malloc(10); > is much safer than > char string[10]; > > The former might be harder to expoit, but it will introduce a whole lot of > memleaks. > > The real problem is making sure the buffer is large enough. You have this > problem equally on the stack and on the heap. > > Michael I feel a bit against limited buffers... I myself, if i have the chance, will allways make buffers unlimited in size and add growing (or controlled growing). in http://oriongame.sourceforge.net/ (a project of which i'm the main developer) I have used http://dynarr.sourceforge.net/ (of which i'm the project maintainer), which has libdynarr (growing threadsafe arrays) and libbuffer, (growing threadsafe buffers (LIFO and FIFO)). I'm not saying you have to do this, but in most cases, I feel that it's better not to have actual limits, and use growing wherever needed. maybe this is an idea for post 1.0 ? -- Alien is my name and head-biting is my game |