[haiku-commits] haiku: hrev49358 - in src: kits/network/libnetapi servers/mail apps/cortex/MediaRoutingView apps/deskbar

  • From: stpere@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 3 Jul 2015 20:17:23 +0200 (CEST)

hrev49358 adds 4 changesets to branch 'master'
old head: 8108282b325dba0e69234014f919486dc7d49977
new head: bd97c88ac35fee3e5758f70366b2b0f28703287f
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=bd97c88ac35f+%5E8108282b325d

----------------------------------------------------------------------------

be61575ce6a5: Cortex: fix for possible null-dereference

CID 600442

e04f294fe87c: GopherRequest: fixes for null dereference

CID 1249920

f6662e32336a: mail_daemon DeskbarView: init fLastButtons

CID 610256

bd97c88ac35f: Deskbar: check dynamic_cast results

CID 1108236 and CID 1108237

[ Philippe Saint-Pierre <stpere@xxxxxxxxx> ]

----------------------------------------------------------------------------

4 files changed, 19 insertions(+), 6 deletions(-)
src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp | 6 +++++-
src/apps/deskbar/ExpandoMenuBar.cpp | 4 ++++
src/kits/network/libnetapi/GopherRequest.cpp | 9 ++++++---
src/servers/mail/DeskbarView.cpp | 6 ++++--

############################################################################

Commit: be61575ce6a5a3334a03583abde2af9da330b856
URL: http://cgit.haiku-os.org/haiku/commit/?id=be61575ce6a5
Author: Philippe Saint-Pierre <stpere@xxxxxxxxx>
Date: Fri Jul 3 17:14:37 2015 UTC

Cortex: fix for possible null-dereference

CID 600442

----------------------------------------------------------------------------

diff --git a/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp
b/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp
index 788284d..d9d060a 100644
--- a/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp
+++ b/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp
@@ -168,7 +168,11 @@ DiagramWire *MediaRoutingView::createWire(

MediaJack *outputJack, *inputJack;
MediaJack *jack = dynamic_cast<MediaJack *>(fromWhich);
- if (jack && jack->isOutput())
+
+ if (jack == NULL)
+ return 0;
+
+ if (jack->isOutput())
{
outputJack = jack;
inputJack = dynamic_cast<MediaJack *>(toWhich);

############################################################################

Commit: e04f294fe87ce7d5ec5b46516309afe614ed2223
URL: http://cgit.haiku-os.org/haiku/commit/?id=e04f294fe87c
Author: Philippe Saint-Pierre <stpere@xxxxxxxxx>
Date: Fri Jul 3 17:35:08 2015 UTC

GopherRequest: fixes for null dereference

CID 1249920

----------------------------------------------------------------------------

diff --git a/src/kits/network/libnetapi/GopherRequest.cpp
b/src/kits/network/libnetapi/GopherRequest.cpp
index ac3a127..28f5563 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();

############################################################################

Commit: f6662e32336a052b5b6b402ae86dd0f88c17e42e
URL: http://cgit.haiku-os.org/haiku/commit/?id=f6662e32336a
Author: Philippe Saint-Pierre <stpere@xxxxxxxxx>
Date: Fri Jul 3 17:55:58 2015 UTC

mail_daemon DeskbarView: init fLastButtons

CID 610256

----------------------------------------------------------------------------

diff --git a/src/servers/mail/DeskbarView.cpp b/src/servers/mail/DeskbarView.cpp
index 60266ef..3a7a0b3 100644
--- a/src/servers/mail/DeskbarView.cpp
+++ b/src/servers/mail/DeskbarView.cpp
@@ -95,7 +95,8 @@ BView* instantiate_deskbar_item(void)
DeskbarView::DeskbarView(BRect frame)
:
BView(frame, "mail_daemon", B_FOLLOW_NONE, B_WILL_DRAW |
B_PULSE_NEEDED),
- fStatus(kStatusNoMail)
+ fStatus(kStatusNoMail),
+ fLastButtons(0)
{
_InitBitmaps();
}
@@ -104,7 +105,8 @@ DeskbarView::DeskbarView(BRect frame)
DeskbarView::DeskbarView(BMessage *message)
:
BView(message),
- fStatus(kStatusNoMail)
+ fStatus(kStatusNoMail),
+ fLastButtons(0)
{
_InitBitmaps();
}

############################################################################

Revision: hrev49358
Commit: bd97c88ac35fee3e5758f70366b2b0f28703287f
URL: http://cgit.haiku-os.org/haiku/commit/?id=bd97c88ac35f
Author: Philippe Saint-Pierre <stpere@xxxxxxxxx>
Date: Fri Jul 3 18:14:57 2015 UTC

Deskbar: check dynamic_cast results

CID 1108236 and CID 1108237

----------------------------------------------------------------------------

diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp
b/src/apps/deskbar/ExpandoMenuBar.cpp
index 6936133..304722a 100644
--- a/src/apps/deskbar/ExpandoMenuBar.cpp
+++ b/src/apps/deskbar/ExpandoMenuBar.cpp
@@ -1079,6 +1079,8 @@ void
TExpandoMenuBar::_DoneTracking(BPoint point)
{
TTeamMenuItem* lastItem =
dynamic_cast<TTeamMenuItem*>(fLastClickedItem);
+ if (lastItem == NULL)
+ return;

if (!lastItem->ExpanderBounds().Contains(point))
return;
@@ -1096,6 +1098,8 @@ void
TExpandoMenuBar::_Track(BPoint point, uint32)
{
TTeamMenuItem* lastItem =
dynamic_cast<TTeamMenuItem*>(fLastClickedItem);
+ if (lastItem == NULL)
+ return;

if (lastItem->ExpanderBounds().Contains(point))
lastItem->SetArrowDirection(BControlLook::B_RIGHT_DOWN_ARROW);


Other related posts:

  • » [haiku-commits] haiku: hrev49358 - in src: kits/network/libnetapi servers/mail apps/cortex/MediaRoutingView apps/deskbar - stpere