Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5387)

Unified Diff: device/usb/usb_context.cc

Issue 1275223005: Fix UAF on libusb thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_context.cc
diff --git a/device/usb/usb_context.cc b/device/usb/usb_context.cc
index 99b76ab34be140118378b95d126891e4db480709..742b40d4517316f9e0421b1c1701c1e81f216602 100644
--- a/device/usb/usb_context.cc
+++ b/device/usb/usb_context.cc
@@ -61,9 +61,10 @@ void UsbContext::UsbEventHandler::ThreadMain() {
}
void UsbContext::UsbEventHandler::Stop() {
+ base::PlatformThreadHandle thread_handle = thread_handle_;
base::subtle::Release_Store(&running_, 0);
libusb_interrupt_handle_event(context_);
Reilly Grant (use Gerrit) 2015/08/10 17:14:08 context_ could also have been freed if there was a
- base::PlatformThread::Join(thread_handle_);
+ base::PlatformThread::Join(thread_handle);
}
UsbContext::UsbContext(PlatformUsbContext context) : context_(context) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698