demba90 / owasp-esapi-java

Automatically exported from code.google.com/p/owasp-esapi-java
Other
0 stars 0 forks source link

BaseValidationRule.assertValid(String context, String input) causes NPE if input is not valid. #195

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Invoke BaseValidationRule.assertValid(String context, String input)

What is the expected output? What do you see instead?
Expected output is either a successful return or a thrown ValidationException. 
Received output is a NullPointerException when input is not valid. 

Version: 2.0_rc10

Please provide any additional information below.

This problem is due to assertValid passing a null ValidationErrorList into the 
three argument getValid(String context, String input, ValidationErrorList 
errorList)- this method assumes that errorList is not null and will attempt to 
add the validation error to the list instead of throwing it. (See attached 
JUnit 4 Test Case) 

Original issue reported on code.google.com by datakn...@gmail.com on 30 Dec 2010 at 11:12

Attachments:

GoogleCodeExporter commented 8 years ago
I've attached what I think is an acceptable approach to resolving this issue.. 
sorry it's not in patch format. 

Original comment by datakn...@gmail.com on 30 Dec 2010 at 11:18

Attachments:

GoogleCodeExporter commented 8 years ago
Rethinking my suggestion... (Though it probably needs to be done anyways). 
assertValid should probably call getValid(String, String) instead of 
getValid(String, String, ValidationErrorList). 

Original comment by datakn...@gmail.com on 30 Dec 2010 at 11:37

GoogleCodeExporter commented 8 years ago

Original comment by kevin.w.wall@gmail.com on 23 Sep 2014 at 1:54

GoogleCodeExporter commented 8 years ago

Original comment by kevin.w.wall@gmail.com on 27 Sep 2014 at 3:12