Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0048070
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2021-11-16 12:002021-11-26 10:54
ReporteralostaleView Statuspublic 
Assigned Toplatform 
PriorityimmediateResolutionfixedFixed in VersionPR22Q1
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression levelProduction - Confirmed Stable
Regression date2020-01-10
Regression introduced in release3.0PR20Q2
Regression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/b032fd12d0bc000fff7bd8a786b0238b4bb1824a [^]
Triggers an Emergency PackNo
Summary

0048070: OOM compressing JS with certain regexp

DescriptionIf the JavaScript included by ComponentProviders includes certain type of regular expressions, an OOM is thrown when it is tried to be compressed.

Note this OOM is captured and the original contents without compression is returned so this issue has no impact on the functionality.
Steps To Reproduce1. Include this line in any JavaScript:
  const letsCrash = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$/;

2. With no module in development serve the JavaScript containing that line:
ERROR in logs:
    at java.util.Arrays.copyOf(Arrays.java:3745) ~[?:?]
    at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:120) ~[?:?]
    at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:95) ~[?:?]
    at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:137) ~[?:?]
    at org.openbravo.client.kernel.JSMin.action(JSMin.java:188) ~[classes/:?]
    at org.openbravo.client.kernel.JSMin.jsmin(JSMin.java:295) ~[classes/:?]
    at org.openbravo.client.kernel.JSCompressor.compress(JSCompressor.java:57) [classes/:?]

Alternatively execute regexCompression test from MR [1].

---
[1] https://gitlab.com/openbravo/product/openbravo/-/merge_requests/457/ [^]
TagsNOR
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 0048087PR21Q4.2 closedAugustoMauch OOM compressing JS with certain regexp 
depends on backport 0048088PR21Q3.6 closedAugustoMauch OOM compressing JS with certain regexp 
caused by defect 0042475 closedalostale Openbravo JS minimizer does not work well with template literals 

-  Notes
(0133101)
hgbot (developer)
2021-11-16 12:04

Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/457 [^]
(0133139)
hgbot (developer)
2021-11-17 11:34

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 0156984e85daa0b57a2b3d5ea766cf09257509ac
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-11-17T11:33:29+01:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/0156984e85daa0b57a2b3d5ea766cf09257509ac [^]

fixed BUG-48070: OOM compressing JS with certain regexp

When trying to compress a JS containing a matching for a single
character which includes the / character followed by the ` character an
OOM was produced. Ie. /[/`]/

This was caused by incorrectly detecting the / chracter inside the
single character matching group as regexp termination instead of as /
single character.

Note that other cases including other matching other quotes agfter /
character would have thrown an UnterminatedStringLiteralException.

This is fixed by taking into account when a regexp is inside a single
character match not to consider / as regexp termination.

---
M modules/org.openbravo.client.kernel/src-test/org/openbravo/client/kernel/test/CompressionTest.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/JSMin.java
---
(0133140)
hgbot (developer)
2021-11-17 11:34

Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/457 [^]

- Issue History
Date Modified Username Field Change
2021-11-16 12:00 alostale New Issue
2021-11-16 12:00 alostale Assigned To => platform
2021-11-16 12:00 alostale Modules => Core
2021-11-16 12:00 alostale Triggers an Emergency Pack => No
2021-11-16 12:00 alostale Steps to Reproduce Updated View Revisions
2021-11-16 12:04 hgbot Note Added: 0133101
2021-11-16 12:05 alostale Steps to Reproduce Updated View Revisions
2021-11-16 12:51 alostale Relationship added caused by 0042475
2021-11-16 13:08 alostale Regression level => Production - Confirmed Stable
2021-11-16 13:08 alostale Regression date => 2020-01-10
2021-11-16 13:08 alostale Regression introduced in release => 3.0PR20Q2
2021-11-16 13:08 alostale Regression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/b032fd12d0bc000fff7bd8a786b0238b4bb1824a [^]
2021-11-16 13:17 alostale Priority normal => immediate
2021-11-17 10:43 AugustoMauch Status new => scheduled
2021-11-17 11:34 hgbot Resolution open => fixed
2021-11-17 11:34 hgbot Status scheduled => closed
2021-11-17 11:34 hgbot Fixed in Version => PR22Q1
2021-11-17 11:34 hgbot Note Added: 0133139
2021-11-17 11:34 hgbot Note Added: 0133140
2021-11-26 10:54 rafaroda Tag Attached: NOR


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker