output: #fixed code
                               public static void main(String[] args) throws Throwable{
  		Certificate[] certificates = getCertificates("fireflySSLkeys.jks", "fireflySSLkeys");
  		for(Certificate certificate : certificates) {
  			System.out.println(certificate);
  		}
  		certificates = getCertificates("fireflykeys", "fireflysource");
  		for(Certificate certificate : certificates) {
  			System.out.println(certificate);
  		}
  	}
input: #vulnerable code 
                               public static void main(String[] args) throws Throwable {
  		FileInputStream in = null;
  		ByteArrayOutputStream out = null;
  		try {
  			in = new FileInputStream(new File("/Users/qiupengtao", "fireflykeys"));
  			out = new ByteArrayOutputStream();
  			
  			byte[] buf = new byte[1024];
  			
  			for (int i = 0; (i = in.read(buf)) != -1;) {
  				byte[] temp = new byte[i];
  				System.arraycopy(buf, 0, temp, 0, i);
  				out.write(temp);
  			}
  			
  			byte[] ret = out.toByteArray();
  //			System.out.println(ret.length);
  			System.out.println(Arrays.toString(ret));
  			
  		} finally {
  			in.close();
  			out.close();
  		}
  	} 
                              #location 21 
                              #vulnerability type NULL_DEREFERENCE