Closed
Bug 110665
Opened 24 years ago
Closed 24 years ago
Leak imap password if it's blank
Categories
(MailNews Core :: Networking: IMAP, defect)
MailNews Core
Networking: IMAP
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: Bienvenu, Assigned: Bienvenu)
Details
(Keywords: memory-leak)
Attachments
(2 files)
|
2.17 KB,
patch
|
sspitzer
:
superreview+
|
Details | Diff | Splinter Review |
|
1.26 KB,
patch
|
Details | Diff | Splinter Review |
If we don't have an imap password yet, we leak the one byte string we get back
from ToNewCString (probably a result of jag's string changes). Fix (to use
nsXPIDLCString so we'll be less vulnerable to people messing up our code with
string changes) coming up.
| Assignee | ||
Comment 1•24 years ago
|
||
Comment 2•24 years ago
|
||
why did you remove all the null-checks? I know because I have fixed
crashes which use similar constructs, please check for null.
| Assignee | ||
Comment 3•24 years ago
|
||
Navin, an automatic nsXPIDLCString can't be null.
Updated•24 years ago
|
Attachment #58287 -
Flags: superreview+
Comment 4•24 years ago
|
||
Comment on attachment 58287 [details] [diff] [review]
proposed fix
sr=sspitzer
| Assignee | ||
Comment 5•24 years ago
|
||
I changed this to use IsEmpty instead of looking at the length. I tried it with
an empty password and didn't crash. Navin, could you elaborate more on why you
feel null checks are needed?
Comment 6•24 years ago
|
||
ok, r=naving
Comment 7•24 years ago
|
||
They keep changing strings. A couple of months back I was made to check for
null for pop3 GetPassword.
| Assignee | ||
Comment 8•24 years ago
|
||
Yeah, it's a pain the way they keep changing the string classes. Are you
referring to this code? :
nsXPIDLString passwordTitle;
mStringService->GetStringByID(POP3_ENTER_PASSWORD_PROMPT_TITLE,
getter_Copies(passwordTitle));
if (passwordPromptString)
{
if (passwordTitle)
rv = server->GetPasswordWithUI(passwordPromptString,
passwordTitle.get(),
aMsgWindow, okayValue, aPassword);
nsTextFormatter::smprintf_free(passwordPromptString);
}
this looks wrong to me - I think you should be checking
!passwordTitle.IsEmpty(). Are they equivalent, Seth?
Comment 9•24 years ago
|
||
yes, i was referring to this code.
if (passwordTitle) checks if PRUnichar* is null, which i believe is the same
thing as IsEmpty --> Length() == 0
| Assignee | ||
Comment 10•24 years ago
|
||
fix checked in.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 11•24 years ago
|
||
Stephen, can you help for verifying this bug? Thanks. :-)
QA Contact: huang → stephend
This is VERIFIED FIXED, but check out bug 99140 for some window-leaking
nastiness!
Status: RESOLVED → VERIFIED
Updated•21 years ago
|
Product: MailNews → Core
Updated•17 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•