Closed Bug 1683772 Opened 3 years ago Closed 3 years ago

nsAbBoolExprToLDAPFilter.cpp:111:10: warning: ‘rv’ may be used uninitialized in this function

Categories

(MailNews Core :: Address Book, defect)

x86_64
Linux
defect

Tracking

(thunderbird_esr78 wontfix)

RESOLVED FIXED
86 Branch
Tracking Status
thunderbird_esr78 --- wontfix

People

(Reporter: aceman, Assigned: aceman)

Details

Attachments

(1 file)

When compiling Thunderbird with GCC 10 I get the following compiler warning:

mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp: In static member function ‘static nsresult nsAbBoolExprToLDAPFilter::FilterExpressions(nsIAbLDAPAttributeMap*, nsTArray<RefPtr<nsISupports> >&, nsC
String&, int)’:
mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp:111:10: warning: ‘rv’ may be used uninitialized in this function [-Wmaybe-uninitialized]
4:43.61 111 | return rv;
4:43.61 | ^~

Attached patch 1683772.patchSplinter Review

If the 'expressions' array is empty, the 'rv' will not be initialized.

Assignee: nobody → acelists
Status: NEW → ASSIGNED
Attachment #9194297 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9194297 [details] [diff] [review]
1683772.patch

Review of attachment 9194297 [details] [diff] [review]:
-----------------------------------------------------------------

Great, thx! r=mkmelin
Attachment #9194297 - Flags: review?(mkmelin+mozilla) → review+
Target Milestone: --- → 86 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/4ffe654c743e
initialize rv in nsAbBoolExprToLDAPFilter::FilterExpressions to fix use of uninitialized variable. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: