Skip to content

Commit

Permalink
GopherRequest: fixes for null dereference
Browse files Browse the repository at this point in the history
CID 1249920
  • Loading branch information
stpere committed Jul 3, 2015
1 parent be61575 commit e04f294
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/kits/network/libnetapi/GopherRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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();
Expand Down

0 comments on commit e04f294

Please sign in to comment.