From e04f294fe87ce7d5ec5b46516309afe614ed2223 Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Fri, 3 Jul 2015 13:35:08 -0400 Subject: [PATCH] GopherRequest: fixes for null dereference CID 1249920 --- src/kits/network/libnetapi/GopherRequest.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/kits/network/libnetapi/GopherRequest.cpp b/src/kits/network/libnetapi/GopherRequest.cpp index ac3a1271a6..28f55635fb 100644 --- a/src/kits/network/libnetapi/GopherRequest.cpp +++ b/src/kits/network/libnetapi/GopherRequest.cpp @@ -354,8 +354,10 @@ BGopherRequest::_ProtocolLoop() _ParseInput(receiveEnd); else if (fInputBuffer.Size()) { // send input directly - fListener->DataReceived(this, (const char *)fInputBuffer.Data(), - fPosition, fInputBuffer.Size()); + if (fListener != NULL) { + fListener->DataReceived(this, (const char *)fInputBuffer.Data(), + fPosition, fInputBuffer.Size()); + } fPosition += fInputBuffer.Size(); @@ -373,7 +375,8 @@ BGopherRequest::_ProtocolLoop() if (fPosition > 0) { fResult.SetLength(fPosition); - fListener->DownloadProgress(this, fPosition, fPosition); + if (fListener != NULL) + fListener->DownloadProgress(this, fPosition, fPosition); } fSocket->Disconnect();