Closed Bug 550892 Opened 15 years ago Closed 15 years ago

unreachable code in nsCrypto::SignText

Categories

(Core Graveyard :: Security: UI, defect)

x86
Linux
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: timeless, Assigned: timeless)

References

()

Details

(Keywords: coverity)

Attachments

(1 file)

2569 for (i = 2; i < argc; ++i) { 2570 JSString *caName = JS_ValueToString(cx, argv[i]); 2571 NS_ENSURE_TRUE(caName, NS_ERROR_OUT_OF_MEMORY); after this point, caName must be non null 2574 if (!caName) { so this code isn't reachable 2575 aResult.Append(internalError); 2576 2577 return NS_OK; 2578 }
Attached patch proposalSplinter Review
Assignee: kaie → timeless
Status: NEW → ASSIGNED
Attachment #431178 - Flags: review?(kaie)
I believe your patch changes semantic, we'll no longer return "out of memory", but an error string (and isn't there a chance that appending an error string will fail, given we're already out of memory?). I'd rather prefer: PRUint32 i; for (i = 2; i < argc; ++i) { JSString *caName = JS_ValueToString(cx, argv[i]); NS_ENSURE_TRUE(caName, NS_ERROR_OUT_OF_MEMORY); - argv[i] = STRING_TO_JSVAL(caName); - if (!caName) { - aResult.Append(internalError); - - return NS_OK; - } + argv[i] = STRING_TO_JSVAL(caName); caNames[i - 2] = JS_GetStringBytes(caName); } Do you agree?
Comment on attachment 431178 [details] [diff] [review] proposal r-, please see my comment
Attachment #431178 - Flags: review?(kaie) → review-
bug 610198 fixed this
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: