Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0048087 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
backport | [Openbravo ERP] A. Platform | minor | have not tried | 2021-11-16 12:00 | 2021-12-14 15:30 | |||
Reporter | alostale | View Status | public | |||||
Assigned To | AugustoMauch | |||||||
Priority | immediate | Resolution | fixed | Fixed in Version | PR21Q4.2 | |||
Status | closed | Fix in branch | Fixed in SCM revision | |||||
Projection | none | ETA | none | Target Version | PR21Q4.2 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | approved | |||||||
Review Assigned To | ||||||||
OBNetwork customer | Gold | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | Production - Confirmed Stable | |||||||
Regression date | 2020-01-10 | |||||||
Regression introduced in release | 3.0PR20Q2 | |||||||
Regression introduced by commit | https://code.openbravo.com/erp/devel/pi/rev/b032fd12d0bc000fff7bd8a786b0238b4bb1824a [^] | |||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0048087: OOM compressing JS with certain regexp | |||||||
Description | If 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 Reproduce | 1. 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/ [^] | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
||||||||
|
![]() |
|
(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 [^] |
![]() |
|||
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 |