[pcre-dev] [Bug 990] Crash after malloc failure

Top Page
Delete this message
Author: Philip Hazel
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 990] Crash after malloc failure
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=990




--- Comment #7 from Philip Hazel <ph10@???> 2010-06-03 19:31:29 ---
On Thu, 3 Jun 2010, eleventeen@??? wrote:

> the code is still wrong. You have added two checks:
>
> heapframe *newframe = ...
> if (heapframe == NULL) RRETURN(PCRE_ERROR_NOMEMORY);\
>
> heapframe *frame = ...
> if (frame == NULL) RRETURN(PCRE_ERROR_NOMEMORY);
>
> The second is correct - variable frame is checked. But the first check is
> incorrect - variable newframe may be assigned NULL pointer and check doesn't
> use that variable.


Oh, sorry! Yes indeed, what a stupid mistake. I wonder why the compiler
did not give an error, since heapframe is a type, not a variable? When I
try something similar in a small test, I do get a compiler error.

Anyway, I have now fixed it, just in time for the release candidate I am
about to start building. Thanks for checking this.

Philip


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email