[Static Analysis][Missing varargs init or cleanup] In function ReportOnCallerUTF8

RESOLVED FIXED in Firefox 52

Status

()

Core
XPConnect
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: andi, Assigned: andi)

Tracking

(Blocks: 1 bug, {coverity})

Trunk
mozilla52
coverity
Points:
---

Firefox Tracking Flags

(firefox52 fixed)

Details

(Whiteboard: CID 1373500, CID 1373499)

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
The Static Analysis tool Coverity detected that va_end is not called in function that uses va_list with va_start:

>>    va_list ap;
>>    va_start(ap, format);
>>
>>    char* buf = JS_vsmprintf(format, ap);
>>    if (!buf) {
>>        return NS_ERROR_OUT_OF_MEMORY;
>>    }
>>
>>    JS_ReportErrorUTF8(callerContext, "%s", buf);
>>    JS_smprintf_free(buf);
>>
>>    return NS_OK;

va_end(ap) should be called on if branch but also on the normal return path.
Comment hidden (mozreview-request)
(Assignee)

Updated

2 years ago
Attachment #8799366 - Flags: review?(bobbyholley)

Comment 2

2 years ago
mozreview-review
Comment on attachment 8799366 [details]
Bug 1308884 - clean return from functions that use variable number of arguments.

https://reviewboard.mozilla.org/r/84560/#review83204
Attachment #8799366 - Flags: review?(bobbyholley) → review+

Comment 3

2 years ago
Pushed by bpostelnicu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/68706d567be6
clean return from functions that use variable number of arguments. r=bholley

Comment 4

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/68706d567be6
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox52: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.