#vulnerable code 
                             @Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		//payPackage 的商品信息，总价可以通过前端传入

		Unifiedorder unifiedorder = new Unifiedorder();
		unifiedorder.setAppid(appid);
		unifiedorder.setMch_id(mch_id);
		unifiedorder.setNonce_str(UUID.randomUUID().toString().replace("-", ""));

		unifiedorder.setBody("商品信息");
		unifiedorder.setOut_trade_no("123456");
		unifiedorder.setTotal_fee("1");//单位分
		unifiedorder.setSpbill_create_ip(request.getRemoteAddr());//IP
		unifiedorder.setNotify_url("http://mydomain.com/test/notify");
		unifiedorder.setTrade_type("JSAPI");//JSAPI，NATIVE，APP，WAP

		UnifiedorderResult unifiedorderResult = PayMchAPI.payUnifiedorder(unifiedorder,key);
		
		//@since 2.8.5  API返回数据签名验证
		if(unifiedorderResult.getSign_status() !=null && unifiedorderResult.getSign_status()){
			String json = PayUtil.generateMchPayJsRequestJson(unifiedorderResult.getPrepay_id(), appid, key);
			
			//将json 传到jsp 页面
			request.setAttribute("json", json);
			//示例jsp
			request.getRequestDispatcher("pay_example.jsp").forward(request,response);
		}
	} 
                            #location 21 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             @Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		//payPackage 的商品信息，总价可以通过前端传入

		Unifiedorder unifiedorder = new Unifiedorder();
		unifiedorder.setAppid(appid);
		unifiedorder.setMch_id(mch_id);
		unifiedorder.setNonce_str(UUID.randomUUID().toString().replace("-", ""));

		unifiedorder.setBody("商品信息");
		unifiedorder.setOut_trade_no("123456");
		unifiedorder.setTotal_fee("1");//单位分
		unifiedorder.setSpbill_create_ip(request.getRemoteAddr());//IP
		unifiedorder.setNotify_url("http://mydomain.com/test/notify");
		unifiedorder.setTrade_type("JSAPI");//JSAPI，NATIVE，APP，MWEB

		UnifiedorderResult unifiedorderResult = PayMchAPI.payUnifiedorder(unifiedorder,key);
		
		//@since 2.8.5  API返回数据签名验证
		if(unifiedorderResult.getSign_status() !=null && unifiedorderResult.getSign_status()){
			String json = PayUtil.generateMchPayJsRequestJson(unifiedorderResult.getPrepay_id(), appid, key);
			
			//将json 传到jsp 页面
			request.setAttribute("json", json);
			//示例jsp
			request.getRequestDispatcher("pay_example.jsp").forward(request,response);
		}
	}