Program: 42295
Project: 42295
Buggy source:
@Override protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  OutputStream out=null;
  InputStream in=null;
  Shell shell=null;
  try {
    String spath=request.getServletPath();
    String path=spath.substring(1);
    if (Util.isBlank(path) || path.equals("String_Node_Str"))     path="String_Node_Str";
    XVariable xp=parseParams(request);
    XVariable headers=parseHeaders(request);
    List<XValue> vargs=new ArrayList<XValue>();
    shell=new Shell(false);
    shell.setCurdir(new File(mRoot));
    Enumeration<?> names=request.getParameterNames();
    XEnvironment env=shell.getEnv();
    while (names.hasMoreElements()) {
      String name=(String)names.nextElement();
      String value=(String)request.getParameter(name);
      env.setVar(name,value,false);
    }
    ICommand script=CommandFactory.getInstance().getScript(shell,path,true,null);
    if (script != null) {
      ByteArrayOutputStream bos=new ByteArrayOutputStream();
      env.setStdout(new StreamOutputPort(bos,false));
      env.setStderr(new StreamOutputPort(new NullOutputStream(),false));
      InputStream is=readInput(request.getInputStream());
      env.setStdin(is);
      if (xp != null)       env.setVar(xp,false);
      if (headers != null)       env.setVar(headers,false);
      ManagedHttpSession mhs=new ManagedHttpSession(request.getSession());
      shell.getSession().setVar("String_Node_Str",mhs);
      mhs.release();
      int ret=script.run(shell,path,vargs);
      String ct=shell.getSerializeOpts().getContent_type() + "String_Node_Str" + shell.getSerializeOpts().getEncoding();
      response.setContentType(ct);
      OutputStream os=response.getOutputStream();
      Util.copyStream(new ByteArrayInputStream(bos.toByteArray()),os);
    }
  }
 catch (  Exception e) {
    throw new ServletException(e);
  }
 finally {
    if (shell != null)     shell.close();
  }
}

Fixed version (ground truth):
@Override protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  OutputStream out=null;
  InputStream in=null;
  Shell shell=null;
  try {
    String spath=request.getServletPath();
    String path=spath.substring(1);
    if (Util.isBlank(path) || path.equals("String_Node_Str"))     path="String_Node_Str";
    XVariable xp=parseParams(request);
    XVariable headers=parseHeaders(request);
    List<XValue> vargs=new ArrayList<XValue>();
    shell=new Shell(false);
    shell.setCurdir(new File(mRoot));
    Enumeration<?> names=request.getParameterNames();
    XEnvironment env=shell.getEnv();
    while (names.hasMoreElements()) {
      String name=(String)names.nextElement();
      String value=(String)request.getParameter(name);
      env.setVar(name,value,false);
    }
    ICommand script=CommandFactory.getInstance().getScript(shell,path,true,null);
    if (script != null) {
      ByteArrayOutputStream bos=new ByteArrayOutputStream();
      env.setStdout(new StreamOutputPort(bos,false));
      env.setStderr(new StreamOutputPort(new NullOutputStream(),false));
      InputStream is=readInput(request.getInputStream());
      env.setStdin(is);
      if (xp != null)       env.setVar(xp,false);
      if (headers != null)       env.setVar(headers,false);
      ManagedHttpSession mhs=new ManagedHttpSession(request.getSession());
      shell.getSession().setVar("String_Node_Str",mhs);
      mhs.release();
      @SuppressWarnings("String_Node_Str") int ret=script.run(shell,path,vargs);
      String ct=shell.getSerializeOpts().getContent_type() + "String_Node_Str" + shell.getSerializeOpts().getEncoding();
      response.setContentType(ct);
      OutputStream os=response.getOutputStream();
      Util.copyStream(new ByteArrayInputStream(bos.toByteArray()),os);
    }
  }
 catch (  Exception e) {
    throw new ServletException(e);
  }
 finally {
    if (shell != null)     shell.close();
  }
}