Mantis - Quercus
Viewing Issue Advanced Details
4077 minor always 06-12-10 04:07 07-09-10 07:38
domdorn  
domdorn  
normal  
resolved 4.0.9  
fixed  
none    
none  
0004077: NPE in Env during cleanup
it is possible to generate a NPE in Env.java in the cleanup method:

    AbstractFunction []fun = _fun;
    _fun = null;
    if (fun != null) {
      boolean isUsed = false;

      if (_page.setRuntimeFunction(fun)) {
        isUsed = true;
      }

here it is not checked if _page is null, which could be the case if the Class is created with the Constructor(QuercusContext) where everything except the context is null.

I propose to change the line to
      if (_page != null && _page.setRuntimeFunction(fun)) {

 

There are no notes attached to this issue.