summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authoravayvod <avayvod@chromium.org>2014-09-03 10:37:24 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-03 17:41:59 +0000
commit43fb252a05ebeb21097abb816d2ccea1ec84dbbc (patch)
tree5974a225b491b1f6971a6abfd1ce79855b021138 /base
parent8a6f83680adcb4bbc43651de92b3e4b260ef97e1 (diff)
downloadchromium_src-43fb252a05ebeb21097abb816d2ccea1ec84dbbc.zip
chromium_src-43fb252a05ebeb21097abb816d2ccea1ec84dbbc.tar.gz
chromium_src-43fb252a05ebeb21097abb816d2ccea1ec84dbbc.tar.bz2
[chromium linker] Check for null ParcelFileDescriptor before using it.
When CreateSharedRelro fails, the file descriptor read by LibInfo from the parcel will be null, but the child processes are trying to call its methods anyway. Added a check to avoid NPE. BUG=409826 Review URL: https://codereview.chromium.org/538543002 Cr-Commit-Position: refs/heads/master@{#293164}
Diffstat (limited to 'base')
-rw-r--r--base/android/java/src/org/chromium/base/library_loader/Linker.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/base/android/java/src/org/chromium/base/library_loader/Linker.java b/base/android/java/src/org/chromium/base/library_loader/Linker.java
index 15968ad..d09572a 100644
--- a/base/android/java/src/org/chromium/base/library_loader/Linker.java
+++ b/base/android/java/src/org/chromium/base/library_loader/Linker.java
@@ -953,7 +953,8 @@ public class Linker {
mRelroStart = in.readLong();
mRelroSize = in.readLong();
ParcelFileDescriptor fd = in.readFileDescriptor();
- mRelroFd = fd.detachFd();
+ // If CreateSharedRelro fails, the OS file descriptor will be -1 and |fd| will be null.
+ mRelroFd = (fd == null) ? -1 : fd.detachFd();
}
// from Parcelable