Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Unified Diff: base/android/java/src/org/chromium/base/library_loader/Linker.java

Issue 538543002: [chromium linker] Check for null ParcelFileDescriptor before using it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/library_loader/Linker.java
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 15968adc2a7c29d4c13c6223c7b858c8bc001ccc..d09572a559ac3efa2723e366c4884e2f5e71c13c 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();
simonb (inactive) 2014/09/03 16:32:37 Maybe reverse the condition so that the 'exception
whywhat 2014/09/03 16:38:29 Sorry,I've already checked the commit box :) I've
}
// from Parcelable
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698