#vulnerable code 
                                public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
	// return variable that accumulates replacements
	serverObjects prop = new serverObjects();

	//if (post == null) System.out.println("POST: NULL"); else System.out.println("POST: " + post.toString());

	prop.put("port", env.getConfig("port", "8080"));
	prop.put("peerName", env.getConfig("peerName", "nameless"));
	// set values
	String s;
	int pos;

	// admin password
	if (env.getConfig("adminAccountBase64", "").length() == 0) {
	    // no password has been specified
	    prop.put("adminuser","admin");
	} else {
	    s = env.getConfig("adminAccount", "admin:void");
	    pos = s.indexOf(":");
	    if (pos < 0) {
		prop.put("adminuser","admin");
	    } else {
		prop.put("adminuser",s.substring(0, pos));
	    }
	}

        // remote proxy
        prop.put("remoteProxyHost", env.getConfig("remoteProxyHost", ""));
        prop.put("remoteProxyPort", env.getConfig("remoteProxyPort", ""));
        prop.put("remoteProxyNoProxy", env.getConfig("remoteProxyNoProxy", ""));
        prop.put("remoteProxyUseChecked", ((String) env.getConfig("remoteProxyUse", "false")).equals("true") ? 1 : 0);

	// proxy access filter
	prop.put("proxyfilter", env.getConfig("proxyClient", "*"));

	// proxy password
	if (env.getConfig("proxyAccountBase64", "").length() == 0) {
	    // no password has been specified
	    prop.put("proxyuser","proxy");
	} else {
	    s = env.getConfig("proxyAccount", "proxy:void");
	    pos = s.indexOf(":");
	    if (pos < 0) {
		prop.put("proxyuser","proxy");
	    } else {
		prop.put("proxyuser",s.substring(0, pos));
	    }
	}

	// server access filter
	prop.put("serverfilter", env.getConfig("serverClient", "*"));

	// server password
	if (env.getConfig("serverAccountBase64", "").length() == 0) {
	    // no password has been specified
	    prop.put("serveruser","server");
	} else {
	    s = env.getConfig("serverAccount", "server:void");
	    pos = s.indexOf(":");
	    if (pos < 0) {
		prop.put("serveruser","server");
	    } else {
		prop.put("serveruser",s.substring(0, pos));
	    }
	}

	// clientIP
	prop.put("clientIP", (String) header.get("CLIENTIP", "<unknown>")); // read an artificial header addendum
	//seedFTPSettings
	prop.put("seedFTPServer", env.getConfig("seedFTPServer", ""));
	prop.put("seedFTPPath", env.getConfig("seedFTPPath", ""));
	prop.put("seedFTPAccount", env.getConfig("seedFTPAccount", ""));
	prop.put("seedFTPPassword", env.getConfig("seedFTPPassword", ""));
    prop.put("seedURL", env.getConfig("seedURL", ""));
        
    
    /*
     * Parser Configuration
     */
    plasmaSwitchboard sb = (plasmaSwitchboard)env;
    Hashtable enabledParsers = sb.parser.getEnabledParserList();
    Hashtable availableParsers = sb.parser.getAvailableParserList();
    
    // fetching a list of all available mimetypes
    List availableParserKeys = Arrays.asList(availableParsers.keySet().toArray(new String[availableParsers.size()]));
    
    // sort it
    Collections.sort(availableParserKeys);

    // loop through the mimeTypes and add it to the properties
    int parserIdx = 0;
    Iterator availableParserIter = availableParserKeys.iterator();
    while (availableParserIter.hasNext()) {
        String mimeType = (String) availableParserIter.next();
        
        prop.put("parser_" + parserIdx + "_mime", mimeType);
        prop.put("parser_" + parserIdx + "_name", availableParsers.get(mimeType));
        prop.put("parser_" + parserIdx + "_status", enabledParsers.containsKey(mimeType) ? 1:0);
        
        parserIdx++;
    }
    
    prop.put("parser", parserIdx);
    
	// return rewrite properties
	return prop;
    } 
                            #location 14 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
	// return variable that accumulates replacements
	serverObjects prop = new serverObjects();

	//if (post == null) System.out.println("POST: NULL"); else System.out.println("POST: " + post.toString());

	prop.put("port", env.getConfig("port", "8080"));
	prop.put("peerName", env.getConfig("peerName", "nameless"));
    prop.put("isTransparentProxy", env.getConfig("isTransparentProxy", "false").equals("true") ? 1 : 0);
    
	// set values
	String s;
	int pos;

	// admin password
	if (env.getConfig("adminAccountBase64", "").length() == 0) {
	    // no password has been specified
	    prop.put("adminuser","admin");
	} else {
	    s = env.getConfig("adminAccount", "admin:void");
	    pos = s.indexOf(":");
	    if (pos < 0) {
		prop.put("adminuser","admin");
	    } else {
		prop.put("adminuser",s.substring(0, pos));
	    }
	}

        // remote proxy
        prop.put("remoteProxyHost", env.getConfig("remoteProxyHost", ""));
        prop.put("remoteProxyPort", env.getConfig("remoteProxyPort", ""));
        prop.put("remoteProxyNoProxy", env.getConfig("remoteProxyNoProxy", ""));
        prop.put("remoteProxyUseChecked", ((String) env.getConfig("remoteProxyUse", "false")).equals("true") ? 1 : 0);

	// proxy access filter
	prop.put("proxyfilter", env.getConfig("proxyClient", "*"));

	// proxy password
	if (env.getConfig("proxyAccountBase64", "").length() == 0) {
	    // no password has been specified
	    prop.put("proxyuser","proxy");
	} else {
	    s = env.getConfig("proxyAccount", "proxy:void");
	    pos = s.indexOf(":");
	    if (pos < 0) {
		prop.put("proxyuser","proxy");
	    } else {
		prop.put("proxyuser",s.substring(0, pos));
	    }
	}

	// server access filter
	prop.put("serverfilter", env.getConfig("serverClient", "*"));

	// server password
	if (env.getConfig("serverAccountBase64", "").length() == 0) {
	    // no password has been specified
	    prop.put("serveruser","server");
	} else {
	    s = env.getConfig("serverAccount", "server:void");
	    pos = s.indexOf(":");
	    if (pos < 0) {
		prop.put("serveruser","server");
	    } else {
		prop.put("serveruser",s.substring(0, pos));
	    }
	}

	// clientIP
	prop.put("clientIP", (String) header.get("CLIENTIP", "<unknown>")); // read an artificial header addendum
	//seedFTPSettings
	prop.put("seedFTPServer", env.getConfig("seedFTPServer", ""));
	prop.put("seedFTPPath", env.getConfig("seedFTPPath", ""));
	prop.put("seedFTPAccount", env.getConfig("seedFTPAccount", ""));
	prop.put("seedFTPPassword", env.getConfig("seedFTPPassword", ""));
    prop.put("seedURL", env.getConfig("seedURL", ""));
        
    
    /*
     * Parser Configuration
     */
    plasmaSwitchboard sb = (plasmaSwitchboard)env;
    Hashtable enabledParsers = sb.parser.getEnabledParserList();
    Hashtable availableParsers = sb.parser.getAvailableParserList();
    
    // fetching a list of all available mimetypes
    List availableParserKeys = Arrays.asList(availableParsers.keySet().toArray(new String[availableParsers.size()]));
    
    // sort it
    Collections.sort(availableParserKeys);

    // loop through the mimeTypes and add it to the properties
    int parserIdx = 0;
    Iterator availableParserIter = availableParserKeys.iterator();
    while (availableParserIter.hasNext()) {
        String mimeType = (String) availableParserIter.next();
        
        prop.put("parser_" + parserIdx + "_mime", mimeType);
        prop.put("parser_" + parserIdx + "_name", availableParsers.get(mimeType));
        prop.put("parser_" + parserIdx + "_status", enabledParsers.containsKey(mimeType) ? 1:0);
        
        parserIdx++;
    }
    
    prop.put("parser", parserIdx);
    
	// return rewrite properties
	return prop;
    }