Uninitialised value at nsImapIncomingServer::PromptForPassword()

RESOLVED WORKSFORME

Status

MailNews Core
Networking: IMAP
RESOLVED WORKSFORME
9 years ago
6 years ago

People

(Reporter: stransky, Assigned: jhorak)

Tracking

1.9.1 Branch
x86
Linux

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
Valgrind says:

==8114== Conditional jump or move depends on uninitialised value(s)
==8114==    at 0x57722C2: nsImapIncomingServer::PromptForPassword(nsACString_internal&, nsIMsgWindow*) (nsImapIncomingServer.c
==8114==    by 0x41D288E: NS_InvokeByIndex_P (in /usr/lib/thunderbird-3.0b3pre/libxpcom_core.so)
==8114==    by 0x41C9B98: nsProxyObjectCallInfo::Run() (nsProxyEvent.cpp:181)
==8114==    by 0x41C439F: nsThread::ProcessNextEvent(int, int*) (nsThread.cpp:510)
==8114==    by 0x418EFD7: NS_ProcessNextEvent_P(nsIThread*, int) (nsThreadUtils.cpp:227)
==8114==    by 0x5E13340: nsBaseAppShell::Run() (nsBaseAppShell.cpp:170)
==8114==    by 0x5EB5101: nsAppStartup::Run() (nsAppStartup.cpp:193)
==8114==    by 0x4144A7B: XRE_main (nsAppRunner.cpp:3298)
==8114==    by 0x804943D: main (nsMailApp.cpp:103)

from nsImapIncomingServer.cpp file:
----------------------------------------------------
nsImapIncomingServer::PromptForPassword()
{
  ...   
  ...

  NS_ENSURE_SUCCESS(rv,rv);
  rv =  GetPasswordWithUI(passwordText, passwordTitle, aMsgWindow,
                          &okayValue, aPassword);
  return (okayValue) ? rv : NS_MSG_PASSWORD_PROMPT_CANCELLED;
}
-----------------------------------------------------

It's because outcoming argument okayValue of nsMsgIncomingServer::GetPasswordWithUI() is not set. I think it could have some default value (TRUE?) even if the password prompt dialog is not shown.
(Reporter)

Comment 1

9 years ago
Created attachment 379678 [details] [diff] [review]
simple fix
Component: General → Networking: IMAP
Product: Thunderbird → MailNews Core
QA Contact: general → networking.imap
Version: Trunk → 1.9.1 Branch
Assignee: nobody → stransky
Attachment #379678 - Flags: review?(bienvenu)

Comment 2

9 years ago
Comment on attachment 379678 [details] [diff] [review]
simple fix

Thx for looking into this. It's a bit more complicated than this, unfortunately. IDL methods aren't supposed to set out params in error conditions, and callers aren't supposed to trust out params in error cases, so I think this should be fixed in nsImapIncomingServer::PromptForPassword by initializing okayValue there (and I think PR_TRUE is OK, though the code is a bit complicated).
Attachment #379678 - Flags: review?(bienvenu) → review-
(Reporter)

Comment 3

8 years ago
Passing to Jan...
Assignee: stransky → jhorak

Comment 4

6 years ago
Is anybody from Redhat working on this?
Or should I refresh the patch?
The function no longer exists, and has been reworked:

http://hg.mozilla.org/comm-central/annotate/ed69c6a773d6/mailnews/imap/src/nsImapIncomingServer.cpp#l2184

Hence, I think we can call this WFM.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.