Commit 2951db82 authored by simonb@chromium.org's avatar simonb@chromium.org

Set parcel data position to 0 when cloning the relro bundle.

Rename local variable from 'p' to 'parcel.  Call parcel.setDataPosition(0)
between write and read.  Fix a log message for punctuation.

Fixes (from logcat):
  E/Bundle  ( 5115): readBundle: bad magic number
  E/Bundle  ( 5115): readBundle: trace = java.lang.RuntimeException
  E/Bundle  ( 5115):      at android.os.Bundle.readFromParcelInner(Bundle.java:1677)
  E/Bundle  ( 5115):      at android.os.Bundle.readFromParcel(Bundle.java:1670)
  E/Bundle  ( 5115):      at org.chromium.base.library_loader.Linker.useSharedRelros(Linker.java:494)
  E/Bundle  ( 5115):      at org.chromium.content.app.ChildProcessService$1.setupConnection(ChildProcessService.java:100)
  E/Bundle  ( 5115):      at org.chromium.content.common.IChildProcessService$Stub.onTransact(IChildProcessService.java:57)
  E/Bundle  ( 5115):      at android.os.Binder.execTransact(Binder.java:388)
  E/Bundle  ( 5115):      at dalvik.system.NativeStart.run(Native Method)

BUG=388356

Review URL: https://codereview.chromium.org/371943003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282298 0039d316-1c4b-4281-b951-d872f2087c98
parent 96c31d37
...@@ -489,14 +489,15 @@ public class Linker { ...@@ -489,14 +489,15 @@ public class Linker {
if (bundle != null) { if (bundle != null) {
bundle.setClassLoader(LibInfo.class.getClassLoader()); bundle.setClassLoader(LibInfo.class.getClassLoader());
clonedBundle = new Bundle(LibInfo.class.getClassLoader()); clonedBundle = new Bundle(LibInfo.class.getClassLoader());
Parcel p = Parcel.obtain(); Parcel parcel = Parcel.obtain();
bundle.writeToParcel(p, 0); bundle.writeToParcel(parcel, 0);
clonedBundle.readFromParcel(p); parcel.setDataPosition(0);
p.recycle(); clonedBundle.readFromParcel(parcel);
parcel.recycle();
} }
if (DEBUG) { if (DEBUG) {
Log.i(TAG, "useSharedRelros() called with " + bundle + Log.i(TAG, "useSharedRelros() called with " + bundle +
",cloned " + clonedBundle); ", cloned " + clonedBundle);
} }
synchronized (Linker.class) { synchronized (Linker.class) {
// Note that in certain cases, this can be called before // Note that in certain cases, this can be called before
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment