Re: RFR: JDK-8262199: issue in jli args.c [v4]

2021-02-25 Thread Matthias Baesken
> Sonar reports a finding in args.c, where a file check is done . > Stat performs a check on file, and later fopen is called on the file . > > The coding could be slightly rewritten so that the potential issue is removed > (however I do not think that it is such a big issue). M

Re: RFR: JDK-8262199: issue in jli args.c [v3]

2021-02-25 Thread Matthias Baesken
> Sonar reports a finding in args.c, where a file check is done . > Stat performs a check on file, and later fopen is called on the file . > > The coding could be slightly rewritten so that the potential issue is removed > (however I do not think that it is such a big issue). M

Re: RFR: JDK-8262199: issue in jli args.c [v2]

2021-02-25 Thread Matthias Baesken
On Tue, 23 Feb 2021 19:24:31 GMT, Alan Bateman wrote: > This function is "optionally report, optionally fclose, and then exit". Have > you tried reducing it to reportAndExit and fclose inline in expandArgFile to > avoid it doing 3 things? hi Alan , thanks for your remark , I did not do that

Re: RFR: JDK-8262199: TOCTOU in jli args.c [v2]

2021-02-23 Thread Matthias Baesken
ly rewritten so that the potential TOCTOU is > removed (however I do not think that it is such a big issue). Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision: Small changes - Changes: - all: https://git.openjdk.java.net/j

Re: RFR: JDK-8262199: TOCTOU in jli args.c

2021-02-23 Thread Matthias Baesken
On Tue, 23 Feb 2021 14:05:15 GMT, Christoph Langer wrote: > This looks good in general. Do you know whether there's a jtreg test that > stresses arg files? There are tests dealing with args files at test/jdk/tools/launcher/ , e.g. there is test/jdk/tools/launcher/ArgsFileTest.java . Best

RFR: JDK-8262199: TOCTOU in jli args.c

2021-02-23 Thread Matthias Baesken
Sonar reports a finding in args.c, where a file check is done . Stat performs a check on file, and later fopen is called on the file : https://sonarcloud.io/project/issues?id=shipilev_jdk=c=AXck8CL0BBG2CXpcnhtM=false=VULNERABILITY The coding could be slightly rewritten so that the potential

Integrated: JDK-8261422: Adjust problematic String.format calls in jdk/internal/util/Preconditions.java outOfBoundsMessage

2021-02-16 Thread Matthias Baesken
On Tue, 9 Feb 2021 14:33:22 GMT, Matthias Baesken wrote: > JDK-8261422: Adjust problematic String.format calls in > jdk/internal/util/Preconditions.java outOfBoundsMessage This pull request has now been integrated. Changeset: 219b115e Author:Matthias Baesken URL:

Re: RFR: JDK-8261422: Adjust problematic String.format calls in jdk/internal/util/Preconditions.java outOfBoundsMessage

2021-02-09 Thread Matthias Baesken
On Tue, 9 Feb 2021 15:38:29 GMT, Alan Bateman wrote: >> JDK-8261422: Adjust problematic String.format calls in >> jdk/internal/util/Preconditions.java outOfBoundsMessage > > src/java.base/share/classes/jdk/internal/util/Preconditions.java line 212: > >> 210:

RFR: JDK-8261422: Adjust problematic String.format calls in jdk/internal/util/Preconditions.java outOfBoundsMessage

2021-02-09 Thread Matthias Baesken
JDK-8261422: Adjust problematic String.format calls in jdk/internal/util/Preconditions.java outOfBoundsMessage - Commit messages: - JDK-8261422 Changes: https://git.openjdk.java.net/jdk/pull/2483/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk=2483=00 Issue:

Re: RFR: JDK-8261422: Adjust problematic String.format calls in jdk/internal/util/Preconditions.java outOfBoundsMessage

2021-02-09 Thread Matthias Baesken
On Tue, 9 Feb 2021 14:33:22 GMT, Matthias Baesken wrote: > JDK-8261422: Adjust problematic String.format calls in > jdk/internal/util/Preconditions.java outOfBoundsMessage The method outOfBoundsMessage has a few problematic calls to String.format. Those calls use "%d" howev

Integrated: JDK-8261237: remove isClassPathAttributePresent method

2021-02-09 Thread Matthias Baesken
On Fri, 5 Feb 2021 15:23:59 GMT, Matthias Baesken wrote: > Hello, > Currently in jdk/internal/vm/VMSupport.java , we create a JarFile without a > related finally clause or try with resources. That should better be changed. > See also the Sonar check result : > > https://son

Re: RFR: JDK-8261237: isClassPathAttributePresent use try with resources with JarFile [v2]

2021-02-09 Thread Matthias Baesken
On Mon, 8 Feb 2021 16:41:44 GMT, Claes Redestad wrote: >> Seems you're right. My search for "isClassPathAttributePresent" also didn't >> yield anything. So why not remove it altogether...? > > Removing it sounds good. hi, I removed isClassPathAttributePresent . - PR:

Re: RFR: JDK-8261237: isClassPathAttributePresent use try with resources with JarFile [v2]

2021-02-09 Thread Matthias Baesken
8sPJZZzON5qG=false=BLOCKER=BUG > > public static boolean isClassPathAttributePresent(String path) { > try { > Manifest man = (new JarFile(path)).getManifest(); > Use try-with-resources or close this "JarFile" in a "finally" clause. Matthi

RFR: JDK-8261237: isClassPathAttributePresent use try with resources with JarFile

2021-02-05 Thread Matthias Baesken
Hello, Currently in jdk/internal/vm/VMSupport.java , we create a JarFile without a related finally clause or try with resources. That should better be changed. See also the Sonar check result : https://sonarcloud.io/project/issues?id=shipilev_jdk=java=AXcqM8zf8sPJZZzON5qG=false=BLOCKER=BUG

Re: RFR: 8256427: Test com/sun/jndi/dns/ConfigTests/PortUnreachable.java does not work on AIX [v2]

2020-11-17 Thread Matthias Baesken
On Tue, 17 Nov 2020 05:02:07 GMT, Christoph Langer wrote: >> The test com/sun/jndi/dns/ConfigTests/PortUnreachable.java is not working on >> AIX. >> >> It tests that when a DNS server is unreachable it fails quickly with a >> PortUnreachableException due to ICMP Destination Unreachable

<    1   2