Closed Bug 250322 Opened 20 years ago Closed 20 years ago

nsLDAPSyncQuery::GetQueryResults can return null + NS_OK for OOM

Categories

(Core :: Preferences: Backend, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: zbraniecki)

References

()

Details

Attachments

(1 file, 1 obsolete file)

527     if (!mResults.IsEmpty())
528         *_retval = ToNewUnicode(mResults);
529     return NS_OK;

I'd file this bug as unconfirmed, but it seems that i can't. Given that some
code in this function is willing to return error conditions, i think this should
return NS_ERROR_OUT_OF_MEMORY if ToNewUnicode fails.
Attached patch first try (obsolete) — Splinter Review
patch
Assignee: dmose → gandalf
Status: NEW → ASSIGNED
Attachment #164241 - Flags: superreview?(bienvenu)
Attachment #164241 - Flags: review?(bienvenu)
Comment on attachment 164241 [details] [diff] [review]
first try

switching review request to dmose
Attachment #164241 - Flags: review?(bienvenu) → review?(dmose)
Comment on attachment 164241 [details] [diff] [review]
first try

>Index: nsLDAPSyncQuery.cpp
>===================================================================
>RCS file: /cvsroot/mozilla/extensions/pref/autoconfig/src/nsLDAPSyncQuery.cpp,v
>retrieving revision 1.12
>diff -u -p -r1.12 nsLDAPSyncQuery.cpp
>--- nsLDAPSyncQuery.cpp	17 Sep 2004 13:03:32 -0000	1.12
>+++ nsLDAPSyncQuery.cpp	1 Nov 2004 23:26:39 -0000
>@@ -452,7 +452,7 @@ NS_IMETHODIMP nsLDAPSyncQuery::GetQueryR
>                                                PRUint32 aProtocolVersion,
>                                                PRUnichar **_retval)
> {
>-    nsresult rv;
>+    nsresult rv = NS_OK;

This is unnecessary, because rv will be immediately set by the call to
do_GetService().

Fix this, and you've got r=dmose.
Attachment #164241 - Flags: review?(dmose) → review-
Attached patch patch nr.2Splinter Review
Attachment #164241 - Attachment is obsolete: true
Attachment #167350 - Flags: superreview?(bienvenu)
Attachment #167350 - Flags: review?(dmose)
Attachment #164241 - Flags: superreview?(bienvenu)
Attachment #167350 - Flags: superreview?(bienvenu) → superreview+
Comment on attachment 167350 [details] [diff] [review]
patch nr.2

r=dmose
Attachment #167350 - Flags: review?(dmose) → review+
dmose: could You check this in, please?
Component: LDAP XPCOM SDK → Preferences: Backend
Product: Directory → Core
Version: other → Trunk
OS: Windows XP → All
Hardware: PC → All
ouch, timless checked it in at 2004-12-01 02:32.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: