Mike Williams wrote:

> There are some uses of vim_realloc() that can lead to a memory leak and 
> possibly an immediate crash if the call to vim_realloc() fails.  A 
> little ironic to be leaking memory when failing trying to allocate some.
> 
> Attached is a diff against 7.4.622.

Thanks.  It's good to handle low memory situations gracefully, we don't
want Vim to crash.

> There is one occurrence I didn't fix, in regexp_nfa.c in addstate().  I 
> know this is very sensitive code with no obvious memory error handling 
> for me to work off.  One for someone more comfortable in this file to fix.

Yeah, addstate() has grown into a complex beast while implementing all
the corner cases.  Handling addstate() returning NULL is going to be
quite a bit of work.  Perhaps a longjmp would be a better solution?
It adds a fixed overhead instead of "if (p != NULL)" in many places.

-- 
hundred-and-one symptoms of being an internet addict:
200. You really believe in the concept of a "paperless" office.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui