[haiku-commits] haiku: hrev49049 - in src: add-ons/kernel/network/stack kits/tracker

  • From: mmlr@xxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 18 Apr 2015 14:19:47 +0200 (CEST)

hrev49049 adds 2 changesets to branch 'master'
old head: ebea950b2df08711adaca9f2c0d282d48667e545
new head: 859686a51c1d8da1eccf42fbe3623b3243f4b84b
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=859686a51c1d+%5Eebea950b2df0

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

359d64ed663e: network stack: Style fix of constant name.

859686a51c1d: Tracker: Fix use-after-free in info window attribute view dtor.

The model was owned by the info window and is gone at the point where
the AttributeView is destroyed. Since the extra check whether the model
is a symlink isn't really needed at all, I opted to just remove it
instead of destroying the AttributeView sooner or unsetting its model.

[ Michael Lotz <mmlr@xxxxxxxx> ]

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

2 files changed, 4 insertions(+), 4 deletions(-)
src/add-ons/kernel/network/stack/routes.cpp | 6 +++---
src/kits/tracker/InfoWindow.cpp | 2 +-

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

Commit: 359d64ed663e922f6aa68d3da8d8fa5c614da9eb
URL: http://cgit.haiku-os.org/haiku/commit/?id=359d64ed663e
Author: Michael Lotz <mmlr@xxxxxxxx>
Date: Sat Apr 18 12:09:27 2015 UTC

network stack: Style fix of constant name.

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

diff --git a/src/add-ons/kernel/network/stack/routes.cpp
b/src/add-ons/kernel/network/stack/routes.cpp
index 9b09934..a43cbef 100644
--- a/src/add-ons/kernel/network/stack/routes.cpp
+++ b/src/add-ons/kernel/network/stack/routes.cpp
@@ -323,7 +323,7 @@ list_routes(net_domain_private* domain, void* buffer,
size_t size)
RecursiveLocker _(domain->lock);

RouteList::Iterator iterator = domain->routes.GetIterator();
- const size_t baseSize = IF_NAMESIZE + sizeof(route_entry);
+ const size_t kBaseSize = IF_NAMESIZE + sizeof(route_entry);
size_t spaceLeft = size;

sockaddr zeros;
@@ -334,7 +334,7 @@ list_routes(net_domain_private* domain, void* buffer,
size_t size)
while (iterator.HasNext()) {
net_route* route = iterator.Next();

- size = baseSize;
+ size = kBaseSize;

sockaddr* destination = NULL;
sockaddr* mask = NULL;
@@ -372,7 +372,7 @@ list_routes(net_domain_private* domain, void* buffer,
size_t size)
request.ifr_route.flags = route->flags;

// copy data into userland buffer
- if (user_memcpy(buffer, &request, baseSize) < B_OK
+ if (user_memcpy(buffer, &request, kBaseSize) < B_OK
|| (route->destination != NULL
&& user_memcpy(request.ifr_route.destination,
route->destination,
route->destination->sa_len) < B_OK)

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

Revision: hrev49049
Commit: 859686a51c1d8da1eccf42fbe3623b3243f4b84b
URL: http://cgit.haiku-os.org/haiku/commit/?id=859686a51c1d
Author: Michael Lotz <mmlr@xxxxxxxx>
Date: Sat Apr 18 12:11:19 2015 UTC

Tracker: Fix use-after-free in info window attribute view dtor.

The model was owned by the info window and is gone at the point where
the AttributeView is destroyed. Since the extra check whether the model
is a symlink isn't really needed at all, I opted to just remove it
instead of destroying the AttributeView sooner or unsetting its model.

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

diff --git a/src/kits/tracker/InfoWindow.cpp b/src/kits/tracker/InfoWindow.cpp
index bdde334..6650cb7 100644
--- a/src/kits/tracker/InfoWindow.cpp
+++ b/src/kits/tracker/InfoWindow.cpp
@@ -990,7 +990,7 @@ AttributeView::~AttributeView()
if (fDescWindow->Lock())
fDescWindow->Quit();

- if (fModel->IsSymLink() && fIconModel != fModel)
+ if (fIconModel != fModel)
delete fIconModel;
}



Other related posts:

  • » [haiku-commits] haiku: hrev49049 - in src: add-ons/kernel/network/stack kits/tracker - mmlr