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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0048087
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] A. Platformminorhave not tried2021-11-16 12:002021-12-14 15:30
ReporteralostaleView Statuspublic 
Assigned ToAugustoMauch 
PriorityimmediateResolutionfixedFixed in VersionPR21Q4.2
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget VersionPR21Q4.2
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

0048087: 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/ [^]
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0048070 closedplatform OOM compressing JS with certain regexp 

-  Notes
(0133142)
hgbot (developer)
2021-11-17 12:04

Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/460 [^]
(0133143)
hgbot (developer)
2021-11-17 12:21

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 07bf00b4d8801ed58efe664e37b4beb655cfcaa7
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-11-17T12:03:28+01:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/07bf00b4d8801ed58efe664e37b4beb655cfcaa7 [^]

fixed BUG-48087: 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
---
(0133144)
hgbot (developer)
2021-11-17 12:21

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

- Issue History
Date Modified Username Field Change
2021-11-17 10:43 AugustoMauch Type defect => backport
2021-11-17 10:43 AugustoMauch Target Version => PR21Q4.2
2021-11-17 12:04 hgbot Note Added: 0133142
2021-11-17 12:21 hgbot Resolution open => fixed
2021-11-17 12:21 hgbot Status scheduled => closed
2021-11-17 12:21 hgbot Fixed in Version => PR21Q4.2
2021-11-17 12:21 hgbot Note Added: 0133143
2021-11-17 12:21 hgbot Note Added: 0133144
2021-12-14 15:29 cberner Assigned To platform => alostale
2021-12-14 15:30 cberner Assigned To alostale => AugustoMauch


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker