-
Bug
-
Resolution: Fixed
-
P4
-
8, 11, 13, 14
-
b11
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8245639 | 13.0.4 | Arthur Eubanks | P4 | Resolved | Fixed | b02 |
JDK-8234674 | 11.0.7-oracle | Ivan Gerasimov | P4 | Resolved | Fixed | b01 |
JDK-8231964 | 11.0.6 | Arthur Eubanks | P4 | Resolved | Fixed | b01 |
JDK-8246217 | openjdk8u262 | Arthur Eubanks | P4 | Resolved | Fixed | b05 |
JDK-8250729 | openjdk7u | Arthur Eubanks | P4 | Resolved | Fixed | master |
final boolean isInvalid() {
if (status == null) {
status = (this.path.indexOf('\u0000') < 0) ? PathStatus.CHECKED
: PathStatus.INVALID;
}
return status == PathStatus.INVALID;
}
If the reads to "status" are reordered and another thread writes to "status", the return value can be wrong.
Reading "status" to a local variable fixes the issue.
if (status == null) {
status = (this.path.indexOf('\u0000') < 0) ? PathStatus.CHECKED
: PathStatus.INVALID;
}
return status == PathStatus.INVALID;
}
If the reads to "status" are reordered and another thread writes to "status", the return value can be wrong.
Reading "status" to a local variable fixes the issue.
- backported by
-
JDK-8231964 java.io.File.isInvalid() is racy
-
- Resolved
-
-
JDK-8234674 java.io.File.isInvalid() is racy
-
- Resolved
-
-
JDK-8245639 java.io.File.isInvalid() is racy
-
- Resolved
-
-
JDK-8246217 java.io.File.isInvalid() is racy
-
- Resolved
-
-
JDK-8250729 java.io.File.isInvalid() is racy
-
- Resolved
-
- relates to
-
JDK-8003992 File and other classes in java.io do not handle embedded nulls properly
-
- Closed
-
(1 relates to)