Need a way to enable JSOPTION_RELIMIT for an XPCOM component

RESOLVED WONTFIX

Status

()

Core
JavaScript Engine
--
enhancement
RESOLVED WONTFIX
8 years ago
5 years ago

People

(Reporter: Wladimir Palant (for Adblock Plus info Cc bugzilla@adblockplus.org), Unassigned)

Tracking

(Depends on: 1 bug, Blocks: 1 bug)

Trunk
x86
Windows XP
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Bug 330569 introduced a way to guard against exponential regular expressions. This would be very useful to catch mistakes made by Adblock Plus users (like bug 508542). Unfortunately, it seems that the javascript.options.relimit preference is only considered for JS contexts that are associated with a window. Similarly, there is nothing comparable to window._options.relimit on BackstagePass - so there is no way to enable this option for an XPCOM component (and neither for a JS module I guess). Ideally it would be possible to enable this option for a single XPCOM component so that waiting for bug 452451 isn't necessary.

Comment 1

6 years ago
My recent tests with FF 7.0.1 suggest that the problem might have been resolved--at least as far as Bug 508542 is concerned.
I cannot confirm that. The regexp engine is a lot faster than it was in Firefox 3.0 but javascript.options.relimit doesn't seem to have any effect at all in Firefox 7.0.1 - no matter what regular expression I try it doesn't throw. This is even true if I run the following:

/a*a*a*a*a*a*a*b/.test("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

This will hang (especially if I make the tested string longer) but it doesn't throw an exception. For me it looks like bug 330569 regressed.
Depends on: 696723

Comment 3

5 years ago
JSOPtION_RELIMIT has been removed. Bug 803358.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.