Closed Bug 221643 Opened 21 years ago Closed 21 years ago

regression: escape sequences in pref name not handled correctly

Categories

(Core :: Preferences: Backend, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.6alpha

People

(Reporter: darin.moz, Assigned: darin.moz)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

pref regression with '\\' path delimiters, see bug 209110 comment #15:

>------- Additional Comment #15 From Jacek R. aka Yano  2003-10-08 03:30 -------
>
>On network printer path is the same:
>user_pref("print.printer_\\TREE\\printer-queue.print_bgimages", false);
>after next run is changed to:
>user_pref("print.printer_\\\\TREE\\\\printer-queue.print_bgimages", false);
>After few days my prefs.js had 23 megabytes of this junk!!!
Severity: normal → blocker
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla1.6alpha
Attached patch v1 patch (obsolete) — Splinter Review
add code to handle escape sequences found in the pref name.  this patch just
leverages the code that was already there to handle escape sequences found in a
pref string value.
Attachment #132946 - Flags: superreview?(brendan)
Attachment #132946 - Flags: review?(dougt)
Comment on attachment 132946 [details] [diff] [review]
v1 patch

>+        /* string escape sequence parsing */
>+        case PREF_PARSE_ESC_STRING:
>+            /* not necessary to resize buffer here since we are only
>+             * writing one character and the resize check would have
>+             * been done for us in the PREF_PARSE_STRING_VALUE state. */

"writing only" not "only writing", and shouldn't the last line refer to
PREF_PARSE_NAME or PREF_PARSE_VALUE, not PREF_PARSE_STRING_VALUE?

sr=brendan@mozilla.org with comment fixage.

/be
Attachment #132946 - Flags: superreview?(brendan) → superreview+
Attached patch v1.1 patchSplinter Review
revised patch with comment tweaks per brendan's review.
Attachment #132946 - Attachment is obsolete: true
Attachment #132946 - Flags: review?(dougt)
Attachment #132972 - Flags: review?(dougt)
Comment on attachment 132972 [details] [diff] [review]
v1.1 patch

r=me, noting sr=brendan
Attachment #132972 - Flags: superreview+
Attachment #132972 - Flags: review?(dougt)
Attachment #132972 - Flags: review+
fixed-on-trunk w/ r=timeless
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Summary: pref regression with '\\' path delimiters → regression: escape sequences in pref name not handled correctly
Comment on attachment 132972 [details] [diff] [review]
v1.1 patch

It seems that the following comment isn't quite true, although I for one won't
lose any sleep over it ;-)

>+            /* not necessary to resize buffer here since we are writing
>+             * only one character and the resize check would have been
>+             * done for us in the previous state. */
>+            switch (c) {
...
>+            default:
>+                NS_WARNING("preserving unexpected JS escape sequence");
>+                *ps->lbcur++ = '\\'; /* preserve the escape sequence */
>+                break;
>+            }
>+            *ps->lbcur++ = c;
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: