New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 630348 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

Shipping address index is off by one

Project Member Reported by dfalcant...@chromium.org, Jul 21 2016

Issue description

Fed a bunch of garbage into the PaymentRequest form when adding a Uzbekistan address on https://rsolomakhin.github.io/pr/us

 07-21 17:54:33.147 17593 17593 W System.err: java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2
 07-21 17:54:33.147 17593 17593 W System.err: at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
 07-21 17:54:33.147 17593 17593 W System.err: at java.util.ArrayList.get(ArrayList.java:308)
 07-21 17:54:33.157 17593 17593 W System.err: at org.chromium.chrome.browser.payments.ui.PaymentRequestSection$OptionSection.updateOptionList(PaymentRequestSection.java:1065)
 07-21 17:54:33.157 17593 17593 W System.err: at org.chromium.chrome.browser.payments.ui.PaymentRequestSection$OptionSection.update(PaymentRequestSection.java:944)
 07-21 17:54:33.157 17593 17593 W System.err: at org.chromium.chrome.browser.payments.ui.PaymentRequestUI.updateSection(PaymentRequestUI.java:581)
 07-21 17:54:33.157 17593 17593 W System.err: at org.chromium.chrome.browser.payments.ui.PaymentRequestUI$1.onResult(PaymentRequestUI.java:320)
 07-21 17:54:33.157 17593 17593 W System.err: at org.chromium.chrome.browser.payments.ui.PaymentRequestUI$1.onResult(PaymentRequestUI.java:314)
 07-21 17:54:33.157 17593 17593 W System.err: at org.chromium.chrome.browser.payments.PaymentRequestImpl.providePaymentInformation(PaymentRequestImpl.java:620)
 07-21 17:54:33.157 17593 17593 W System.err: at org.chromium.chrome.browser.payments.PaymentRequestImpl.updateWith(PaymentRequestImpl.java:448)
 07-21 17:54:33.157 17593 17593 W System.err: at org.chromium.mojom.payments.PaymentRequest_Internal$Stub.accept(PaymentRequest_Internal.java:210)
 07-21 17:54:33.157 17593 17593 W System.err: at org.chromium.mojo.bindings.RouterImpl.handleIncomingMessage(RouterImpl.java:238)
 07-21 17:54:33.157 17593 17593 W System.err: at org.chromium.mojo.bindings.RouterImpl.access$000(RouterImpl.java:21)
 07-21 17:54:33.157 17593 17593 W System.err: at org.chromium.mojo.bindings.RouterImpl$HandleIncomingMessageThunk.accept(RouterImpl.java:33)

After saving the address in the editor, it started to confirm the address, which added a view at the top of mOptionLayout, knocking the index required on line 1065 upward by one.

I think int currentRow = mOptionLayout.getChildCount(); should be mOptionRows.getChildCount() instead.
 
Labels: M-53
Labels: ReleaseBlock-Stable OS-Android
Other countries would definitely hit this.  Marking RBS
Project Member

Comment 3 by bugdroid1@chromium.org, Jul 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/80155b30015fca0ea8774117ee2a9b8d0d8da91d

commit 80155b30015fca0ea8774117ee2a9b8d0d8da91d
Author: dfalcantara <dfalcantara@chromium.org>
Date: Fri Jul 22 17:56:31 2016

[Payments] Use the correct index when checking addresses

We have an off-by-one error now that the mOptionLayout can have multiple children in it above the actual options.

* Use the correct index when indexing into the options layout.

* Add a test that checks for the crash and additionally checks that the "merchant doesn't accept address" string is
correctly displayed.

* Plumbs a new callback that indicates that the client has finished
checking the selection.

BUG= 630348 

Review-Url: https://codereview.chromium.org/2170603006
Cr-Commit-Position: refs/heads/master@{#407197}

[modify] https://crrev.com/80155b30015fca0ea8774117ee2a9b8d0d8da91d/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java
[modify] https://crrev.com/80155b30015fca0ea8774117ee2a9b8d0d8da91d/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
[modify] https://crrev.com/80155b30015fca0ea8774117ee2a9b8d0d8da91d/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestDynamicShippingMultipleAddressesTest.java
[modify] https://crrev.com/80155b30015fca0ea8774117ee2a9b8d0d8da91d/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java

Labels: Merge-Request-53

Comment 5 by dimu@chromium.org, Jul 25 2016

Labels: -Merge-Request-53 Merge-Approved-53 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M53 (branch: 2785)
Project Member

Comment 6 by bugdroid1@chromium.org, Jul 25 2016

Labels: -merge-approved-53 merge-merged-2785
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aeb73e31bf78992a0303c8325c4f1e3dcb26dc1b

commit aeb73e31bf78992a0303c8325c4f1e3dcb26dc1b
Author: Rouslan Solomakhin <rouslan@chromium.org>
Date: Mon Jul 25 01:16:55 2016

[Merge M-53] [Payments] Use the correct index when checking addresses

We have an off-by-one error now that the mOptionLayout can have multiple children in it above the actual options.

* Use the correct index when indexing into the options layout.

* Add a test that checks for the crash and additionally checks that the "merchant doesn't accept address" string is
correctly displayed.

* Plumbs a new callback that indicates that the client has finished
checking the selection.

BUG= 630348 

Review-Url: https://codereview.chromium.org/2170603006
Cr-Commit-Position: refs/heads/master@{#407197}
(cherry picked from commit 80155b30015fca0ea8774117ee2a9b8d0d8da91d)

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

Cr-Commit-Position: refs/branch-heads/2785@{#324}
Cr-Branched-From: 68623971be0cfc492a2cb0427d7f478e7b214c24-refs/heads/master@{#403382}

[modify] https://crrev.com/aeb73e31bf78992a0303c8325c4f1e3dcb26dc1b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java
[modify] https://crrev.com/aeb73e31bf78992a0303c8325c4f1e3dcb26dc1b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
[modify] https://crrev.com/aeb73e31bf78992a0303c8325c4f1e3dcb26dc1b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestDynamicShippingMultipleAddressesTest.java
[modify] https://crrev.com/aeb73e31bf78992a0303c8325c4f1e3dcb26dc1b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java

Status: Fixed (was: Started)
Verified in 53.0.2785.34 build
Components: -UI>Browser>Autofill>Payments UI>Browser>Payments

Sign in to add a comment