Closed Bug 112247 Opened 23 years ago Closed 23 years ago

bad JS takes down entire browser

Categories

(Core :: Networking: Cookies, defect)

x86
Linux
defect
Not set
critical

Tracking

()

VERIFIED DUPLICATE of bug 110560

People

(Reporter: hans_k_97, Assigned: morse)

Details

(Keywords: crash)

Attachments

(1 file)

Apologies, my Javascript isn't good enough to say exactly what's going on here-
The following javascript crashes the entire browser when the cookie isn't
present.  Even if there's an error, it shouldn't take down the whole program...

function getCookie(name) {
 var cname = name + "=";
 var dc = document.cookie;
 if (dc.length != 0) {
  begin = dc.indexOf(cname);
  if (begin != -1) {
   begin += cname.length;
   end = dc.indexOf(";", begin);
   if (end == -1) end = dc.length;
   return unescape(dc.substring(begin, end));
  }
 }
 return null; 
}
var visitsCookie = getCookie('Visits');
This JS seems to work fine on the original page, but crashes locally I would
assume because of the missing cookie.
Reporter: Please always specify the Build ID (as found in the title bar).

Also, a crash should have the severity level "critical".

Thank you.

Possibly related to Bug 110560 ? Reporter: can you reproduce the crash
using a recent build?
Sorry- crash is with 2001112600, Mandrake Linux 8.1.
Attachment #59386 - Attachment mime type: text/plain → text/html
wfm with win2k build 20011127..

This should be a dupe of bug 110560
Reporter: Can you try it with the latest nightly build (20011127) or can you
give us a talkback ID of that crash ?

Severity: normal → critical
Keywords: crash
Reassigning to Cookies for parity with suggested dupe.
Assignee: rogerl → morse
Component: Javascript Engine → Cookies
QA Contact: pschwartau → tever
WORKSFORME using Mozilla trunk binaries 2001-11-26-xx Mac9.1,
2001-12-03-xx WinNT, Linux. I can load attachment 59386 [details] just fine;
I do not crash. I also do not crash if I save that HTML and
load it locally. 

Don't know whether to mark this as WORKSFORME or as a duplicate
of bug 110560; the Cookies component will know best. 

hans_k_97@hotmail.com: can you try it with the latest nightly build
and see if you still crash? 
I would say this is definitely a dup of bug 110560, especially considering the 
comment "work fine on the original page, but crashes locally".  That was exactly 
what bug 110560 was doing.

Reopen if you are still seeing this with a recent build.

*** This bug has been marked as a duplicate of 110560 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
yup, WFM.
thanks.
VERFIED/dupe
Status: RESOLVED → VERIFIED
QA Contact: tever → cookieqa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: