#fixed code
                             public float getProcessorLoad() {
		Scanner in = null;
		try {
			in = new Scanner(new FileReader("/proc/stat"));
		} catch (FileNotFoundException e) {
			System.err.println("Problem with: /proc/stat");
			System.err.println(e.getMessage());
			return -1;
		}
		in.useDelimiter("\n");
		String[] result = in.next().split(" ");
		ArrayList<Float> loads = new ArrayList<Float>();
		for (String load : result) {
			if (load.matches("-?\\d+(\\.\\d+)?")) {
				loads.add(Float.valueOf(load));
			}
		}
		// ((Total-PrevTotal)-(Idle-PrevIdle))/(Total-PrevTotal) - see http://stackoverflow.com/a/23376195/4359897
		float totalCpuLoad = (loads.get(0) + loads.get(2))*100 / (loads.get(0) + loads.get(2) + loads.get(3));
		return FormatUtil.round(totalCpuLoad, 2);
	}
#vulnerable code 
                             public float getProcessorLoad() {

		// should be same as on Mac. Not tested.
		ArrayList<String> topResult = ExecutingCommand.runNative("top -l 1 -R -F -n1"); // cpu load is in [3]
		String[] idle = topResult.get(3).split(" "); // idle value is in [6]
		return 100 - Float.valueOf(idle[6].replace("%", ""));
	} 
                            #location 5 
                            #vulnerability type NULL_DEREFERENCE