Closed Bug 631423 Opened 13 years ago Closed 13 years ago

crash [@ mozilla::places::GenerateRandomBytes]

Categories

(Toolkit :: Places, defect)

defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla2.0b12
Tracking Status
blocking2.0 --- final+

People

(Reporter: mak, Assigned: sdwilsh)

Details

(Keywords: crash, Whiteboard: [softblocker])

Crash Data

Attachments

(1 file)

I've found only 1 report for this in the last 2 weeks, but I think it could make sense

275   BOOL rc = CryptAcquireContext(&cryptoProvider, 0, 0, PROV_RSA_FULL,
276                                 CRYPT_VERIFYCONTEXT | CRYPT_SILENT);
277   if (rc) {
278     rc = CryptGenRandom(cryptoProvider, aSize, _buffer);
279   }
280   (void)CryptReleaseContext(cryptoProvider, 0);

if CryptAcquireContext fails there is no valid assumption on cryptoProvider, we should not try to call CryptReleaseContext or at least null check cryptoProvider.
(In reply to comment #0)
> if CryptAcquireContext fails there is no valid assumption on cryptoProvider, we
> should not try to call CryptReleaseContext or at least null check
> cryptoProvider.
Except that CryptReleaseContext can handle NULL (it'd just return ERROR_INVALID_HANDLE).  We could certain move it, but it's not going to change anything here.
Although we don't initialize the value, so we could crash there.  Yes, we should fix this (by either initializing the value, or moving it inside the if.
blocking2.0: --- → final+
Whiteboard: [softblocker]
well, I don't know what CryptAcquireContext does when it fails, so it's even possible that we try to Release a half baked context regardless what we init. I'd prefer moving it inside the if.
Assignee: nobody → mak77
Status: NEW → ASSIGNED
Severity: normal → critical
Keywords: crash
Attached patch v1.0Splinter Review
Assignee: mak77 → sdwilsh
Attachment #509795 - Flags: review?(mak77)
Attachment #509795 - Flags: review?(mak77) → review+
Whiteboard: [softblocker] → [softblocker][can land]
http://hg.mozilla.org/mozilla-central/rev/fa598dd31ac6
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [softblocker][can land] → [softblocker]
Target Milestone: --- → mozilla2.0b12
Crash Signature: [@ mozilla::places::GenerateRandomBytes]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: