зеркало из https://github.com/mozilla/gecko-dev.git
minor fixes to prevent dereferencing NULL pointers
This commit is contained in:
Родитель
85d3749ac4
Коммит
da74cd1591
|
@ -716,7 +716,8 @@ PRInt32 nsNNTPProtocol::ParseURL(nsIURL * aURL, char ** aHostAndPort, PRBool * b
|
|||
if (host)
|
||||
hostAndPort = PL_strdup(host);
|
||||
|
||||
// mscott: I took out default code to generate host and port if the url didn't have any...add this later...
|
||||
// mscott: I took out default code to generate host and port
|
||||
// if the url didn't have any...add this later...
|
||||
if (!hostAndPort)
|
||||
{
|
||||
status = MK_NO_NEWS_SERVER;
|
||||
|
@ -837,11 +838,19 @@ PRInt32 nsNNTPProtocol::ParseURL(nsIURL * aURL, char ** aHostAndPort, PRBool * b
|
|||
PR_ASSERT (!message_id || message_id != group);
|
||||
if (status >= 0)
|
||||
{
|
||||
if (aHostAndPort)
|
||||
*aHostAndPort = hostAndPort;
|
||||
|
||||
if (aGroup) *aGroup = group;
|
||||
else PR_FREEIF(group);
|
||||
|
||||
if (aMessageID) *aMessageID = message_id;
|
||||
else PR_FREEIF(message_id);
|
||||
|
||||
if (aCommandSpecificData) *aCommandSpecificData = command_specific_data;
|
||||
else PR_FREEIF(command_specific_data);
|
||||
|
||||
HG45873
|
||||
*aGroup = group;
|
||||
*aMessageID = message_id;
|
||||
*aCommandSpecificData = command_specific_data;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1718,9 +1727,10 @@ PRInt32 nsNNTPProtocol::SendFirstNNTPCommand(nsIURL * url)
|
|||
*/
|
||||
char * slash;
|
||||
char * group_name;
|
||||
nsresult rv;
|
||||
nsresult rv=NS_ERROR_NULL_POINTER;
|
||||
|
||||
StrAllocCopy(command, "GROUP ");
|
||||
if (m_newsgroup)
|
||||
rv = m_newsgroup->GetName(&group_name);
|
||||
slash = PL_strchr(group_name, '/');
|
||||
m_firstArticle = 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче