New issue
Advanced search Search tips

Issue 829077 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Aug 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac , Fuchsia
Pri: 3
Type: Bug

Blocking:
issue 786559



Sign in to add a comment

Harden Cronet_UrlRequest_InitWithParams() to reject multiple-initialization

Project Member Reported by w...@chromium.org, Apr 4 2018

Issue description

Cronet_UrlRequest_InitWithParam() currently permits the caller to call it multiple times on the same Cronet_UrlRequestPtr, posing two issues:

1. Risk of internal state getting corrupted, e.g. by simultaneous update from the caller and IO threads.
2. Risk of leaking internal structures that are expected only to need to be released when the instance is Destroy()ed.

Related to this, InitWithParams() can fail _after_ having created the internal |request_| structure, e.g. because an invalid HTTP method is requested. Failed InitWithParams() calls should clean up this internal state before returning.

At present the tests for Cronet_UrlRequest create a single instance and then repeatedly call InitWithParams() on that, so they will need to be updated to Create/Destroy an instance for each call.
 
Blocking: 786559
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 3

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/64b266a147e02f009f041bd459c230960e6eb5ef

commit 64b266a147e02f009f041bd459c230960e6eb5ef
Author: Misha Efimov <mef@chromium.org>
Date: Fri Aug 03 13:50:59 2018

[Cronet] Prevent multiple initialization of native UrlRequest.

Bug:  829077 
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I04213a57ef018e7e448974f71c0cd07d65c328ef
Reviewed-on: https://chromium-review.googlesource.com/1161107
Commit-Queue: Paul Jensen <pauljensen@chromium.org>
Reviewed-by: Paul Jensen <pauljensen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580527}
[modify] https://crrev.com/64b266a147e02f009f041bd459c230960e6eb5ef/components/cronet/native/cronet.idl
[modify] https://crrev.com/64b266a147e02f009f041bd459c230960e6eb5ef/components/cronet/native/generated/cronet.idl_c.h
[modify] https://crrev.com/64b266a147e02f009f041bd459c230960e6eb5ef/components/cronet/native/test/url_request_test.cc
[modify] https://crrev.com/64b266a147e02f009f041bd459c230960e6eb5ef/components/cronet/native/url_request.cc

Status: Fixed (was: Untriaged)

Sign in to add a comment