Opened on 01/17/2017 at 09:51:32 PM

Closed on 03/15/2017 at 06:30:37 PM

Last modified on 05/09/2017 at 11:24:18 AM

#4813 closed defect (fixed)

UTFDataFormatException while serializing filter

Reported by: diegocarloslima Assignee: diegocarloslima
Priority: P2 Milestone: Adblock-Plus-for-Samsung-Browser-1.1.0
Module: Adblock-Plus-for-Samsung-Browser Keywords:
Cc: Blocked By:
Blocking: Platform: Samsung Browser
Ready: yes Confidential: no
Tester: Scheer Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29372653/

Description

Serializing/deserializing a filter might throw an UTFDataFormatException if the filter rule has more than 65535 bytes.

Environment

ABP for Samsung Internet 1.0.4
Samsung Galaxy S7 Edge
Android 6.0.1

How to reproduce

  1. Perform a fresh install of ABP for Samsung Internet
  2. Wait a while until the app downloads the latest exceptionrules.txt subscription

Observed behaviour

The following exception log is printed:

E/EventHandler: Event processing failed: String more than 65535 UTF bytes long java.io.UTFDataFormatException: String more than 65535 UTF bytes long
at java.nio.charset.ModifiedUtf8.countBytes(ModifiedUtf8.java:86)
at java.nio.charset.ModifiedUtf8.encode(ModifiedUtf8.java:119)
at java.io.DataOutputStream.writeUTF(DataOutputStream.java:197)
at org.adblockplus.sbrowser.contentblocker.engine.Subscription.serializeFilters(Subscription.java:439)
at org.adblockplus.sbrowser.contentblocker.engine.Subscription.updateSubscription(Subscription.java:633)
at org.adblockplus.sbrowser.contentblocker.engine.Subscriptions.updateSubscription(Subscriptions.java:271)
at org.adblockplus.sbrowser.contentblocker.engine.Engine$EventHandler.run(Engine.java:645)

Expected behaviour

The serialization/deserialization should complete without errors, even for filter rules that exceeds 65535 bytes.

Attachments (0)

Change History (4)

comment:1 Changed on 01/18/2017 at 01:37:21 PM by diegocarloslima

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed on 03/15/2017 at 06:24:03 PM by abpbot

A commit referencing this issue has landed:
Issue 4813 - UTFDataFormatException while serializing filter

comment:3 Changed on 03/15/2017 at 06:30:37 PM by diegocarloslima

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:4 Changed on 05/09/2017 at 11:24:18 AM by scheer

  • Tester changed from Unknown to Scheer
  • Verified working set
  • The following exception log is not printed when the steps above are followed:
E/EventHandler: Event processing failed: String more than 65535 UTF bytes long java.io.UTFDataFormatException: String more than 65535 UTF bytes long
at java.nio.charset.ModifiedUtf8.countBytes(ModifiedUtf8.java:86)
at java.nio.charset.ModifiedUtf8.encode(ModifiedUtf8.java:119)
at java.io.DataOutputStream.writeUTF(DataOutputStream.java:197)
at org.adblockplus.sbrowser.contentblocker.engine.Subscription.serializeFilters(Subscription.java:439)
at org.adblockplus.sbrowser.contentblocker.engine.Subscription.updateSubscription(Subscription.java:633)
at org.adblockplus.sbrowser.contentblocker.engine.Subscriptions.updateSubscription(Subscriptions.java:271)
at org.adblockplus.sbrowser.contentblocker.engine.Engine$EventHandler.run(Engine.java:645)

adblockplussbrowser-release-signed-1
Samsung Galaxy S7
Android 7.0

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from diegocarloslima.
 
Note: See TracTickets for help on using tickets.