Re: RFR: 8303669: SelectVersion indexes past the end of the argv array [v2]

2023-05-19 Thread Adam Sotona
On Thu, 4 May 2023 09:17:05 GMT, Adam Sotona wrote: >> libjli/java.c's SelectVersion method receives argc and argv but ignores argc >> in some circumstances an instead checks if *argv == 0 in its while loop, >> which results in a segmentation fault if the provided array is not NULL >>

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array [v2]

2023-05-18 Thread Vicente Romero
On Thu, 4 May 2023 09:17:05 GMT, Adam Sotona wrote: >> libjli/java.c's SelectVersion method receives argc and argv but ignores argc >> in some circumstances an instead checks if *argv == 0 in its while loop, >> which results in a segmentation fault if the provided array is not NULL >>

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array [v2]

2023-05-04 Thread David Holmes
On Thu, 4 May 2023 07:19:39 GMT, Adam Sotona wrote: >> src/java.base/share/native/libjli/java.c line 1212: >> >>> 1210: *pret = 0; >>> 1211: >>> 1212: while (argc > 0 && *(arg = *argv) == '-') { >> >> AFAICS this loop terminates at line 1388 and nowhere in the loop body does >> argc

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array

2023-05-04 Thread Adam Sotona
On Thu, 4 May 2023 06:47:50 GMT, Alan Bateman wrote: > Also are you planning to add a test for this? I've added code to `exeJliLaunchTest.c` (executed by `JliLaunchTest`) to test non null terminated arguments. - PR Comment:

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array [v2]

2023-05-04 Thread Adam Sotona
> libjli/java.c's SelectVersion method receives argc and argv but ignores argc > in some circumstances an instead checks if *argv == 0 in its while loop, > which results in a segmentation fault if the provided array is not NULL > terminated. > > This patch counts down argc in the while loops

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array

2023-05-04 Thread Adam Sotona
On Thu, 4 May 2023 06:26:53 GMT, David Holmes wrote: >> libjli/java.c's SelectVersion method receives argc and argv but ignores argc >> in some circumstances an instead checks if *argv == 0 in its while loop, >> which results in a segmentation fault if the provided array is not NULL >>

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array

2023-05-04 Thread Alan Bateman
On Wed, 3 May 2023 12:03:34 GMT, Adam Sotona wrote: > libjli/java.c's SelectVersion method receives argc and argv but ignores argc > in some circumstances an instead checks if *argv == 0 in its while loop, > which results in a segmentation fault if the provided array is not NULL > terminated.

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array

2023-05-04 Thread David Holmes
On Wed, 3 May 2023 12:03:34 GMT, Adam Sotona wrote: > libjli/java.c's SelectVersion method receives argc and argv but ignores argc > in some circumstances an instead checks if *argv == 0 in its while loop, > which results in a segmentation fault if the provided array is not NULL > terminated.

RFR: 8303669: SelectVersion indexes past the end of the argv array

2023-05-03 Thread Adam Sotona
libjli/java.c's SelectVersion method receives argc and argv but ignores argc in some circumstances an instead checks if *argv == 0 in its while loop, which results in a segmentation fault if the provided array is not NULL terminated. This patch counts down argc in the while loops instead of