You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by pengjianhua <pe...@zte.com.cn> on 2018/01/04 09:42:31 UTC

Review Request 64944: RANGER-1946:if args.length=2 will case java.lang.ArrayIndexOutOfBoundsException in HdfsClient.class

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64944/
-----------------------------------------------------------

Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan Neethiraj, Velmurugan Periasamy, and Qiang Zhang.


Bugs: RANGER-1946
    https://issues.apache.org/jira/browse/RANGER-1946


Repository: ranger


Description
-------

"if args.length=2 " the following code 
"String fileNameToMatch = (args.length == 2 ? null : args[2]);"
will case java.lang.ArrayIndexOutOfBoundsException in HdfsClient.class
Chang from "if (args.length < 2) " to "if (args.length < 3) "


Diffs
-----

  hdfs-agent/src/main/java/org/apache/ranger/services/hdfs/client/HdfsClient.java 55f5980 


Diff: https://reviews.apache.org/r/64944/diff/1/


Testing
-------

Tested it


Thanks,

pengjianhua


Re: Review Request 64944: RANGER-1946:if args.length=2 will case java.lang.ArrayIndexOutOfBoundsException in HdfsClient.class

Posted by Colm O hEigeartaigh <co...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64944/#review194768
-----------------------------------------------------------



I think that changing the args length check to 3 is not correct, as the 3rd parameter "filenameToMatch" is optional.

- Colm O hEigeartaigh


On Jan. 4, 2018, 9:42 a.m., pengjianhua wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64944/
> -----------------------------------------------------------
> 
> (Updated Jan. 4, 2018, 9:42 a.m.)
> 
> 
> Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan Neethiraj, Velmurugan Periasamy, and Qiang Zhang.
> 
> 
> Bugs: RANGER-1946
>     https://issues.apache.org/jira/browse/RANGER-1946
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> "if args.length=2 " the following code 
> "String fileNameToMatch = (args.length == 2 ? null : args[2]);"
> will case java.lang.ArrayIndexOutOfBoundsException in HdfsClient.class
> Chang from "if (args.length < 2) " to "if (args.length < 3) "
> 
> 
> Diffs
> -----
> 
>   hdfs-agent/src/main/java/org/apache/ranger/services/hdfs/client/HdfsClient.java 55f5980 
> 
> 
> Diff: https://reviews.apache.org/r/64944/diff/1/
> 
> 
> Testing
> -------
> 
> Tested it
> 
> 
> Thanks,
> 
> pengjianhua
> 
>