#vulnerable code 
                              @Override
  public void init(ServletConfig servletConfig) throws ServletException {
    super.init(servletConfig);

    String doLogStr = servletConfig.getInitParameter(P_LOG);
    if (doLogStr != null) {
      this.doLog = Boolean.parseBoolean(doLogStr);
    }
    
    String doForwardIPString = servletConfig.getInitParameter(P_FORWARDEDFOR);
    if (doForwardIPString != null) {
      this.doForwardIP = Boolean.parseBoolean(doForwardIPString);
    }

    targetUri = servletConfig.getInitParameter(P_TARGET_URI);
    if (!(targetUri.contains("$") || targetUri.contains("{"))) {
      try {
        targetUriObj = new URI(targetUri);
      } catch (Exception e) {
        throw new RuntimeException("Trying to process targetUri init parameter: "+e,e);
      }
      targetUri = targetUriObj.toString();
    }
  
    HttpParams hcParams = new BasicHttpParams();
    readConfigParam(hcParams, ClientPNames.HANDLE_REDIRECTS, Boolean.class);
    proxyClient = createHttpClient(hcParams);
  } 
                            #location 16 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                              @Override
  public void init(ServletConfig servletConfig) throws ServletException {
    super.init(servletConfig);

    String doLogStr = servletConfig.getInitParameter(P_LOG);
    if (doLogStr != null) {
      this.doLog = Boolean.parseBoolean(doLogStr);
    }
    
    String doForwardIPString = servletConfig.getInitParameter(P_FORWARDEDFOR);
    if (doForwardIPString != null) {
    	this.doForwardIP = Boolean.parseBoolean(doForwardIPString);
    }

    try {
      targetUriObj = new URI(servletConfig.getInitParameter(P_TARGET_URI));
    } catch (Exception e) {
      throw new RuntimeException("Trying to process targetUri init parameter: "+e,e);
    }
    targetUri = targetUriObj.toString();

    HttpParams hcParams = new BasicHttpParams();
    readConfigParam(hcParams, ClientPNames.HANDLE_REDIRECTS, Boolean.class);
    proxyClient = createHttpClient(hcParams);
  }