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

Issue 1304433004: HTTPTransportMac: CFStream Read() must always set at_eof (Closed)

Created:
5 years, 4 months ago by Mark Mentovai
Modified:
5 years, 4 months ago
Reviewers:
Robert Sesek
CC:
crashpad-dev_chromium.org
Base URL:
https://chromium.googlesource.com/crashpad/crashpad@master
Target Ref:
refs/heads/master
Project:
crashpad
Visibility:
Public.

Description

HTTPTransportMac: CFStream Read() must always set at_eof CFStream’s CFReadStreamGetBuffer() calls the Read() callback without initializing at_eof. The callback function is responsible for setting it on any successful read operation. See 10.10.2 CF-1152.14/CFStream.c. By chance, at_eof seems to always have an initial value of false on x86_64, but true on 32-bit x86. Crashpad’s Read() callback assumed that the initial value was always false. The discrepancy caused truncation and possibly hangs when a 32-bit process attempted to upload a request body larger than 32kB, the buffer size used by NSMutableURLRequest or something between it and CFReadStream. A new test with more than 32kB of data is added. As discussed in: https://groups.google.com/a/chromium.org/d/topic/crashpad-dev/Vz--qMZJRPU TEST=crashpad_util_test HTTPTransport.Upload33k BUG= R=rsesek@chromium.org Committed: https://chromium.googlesource.com/crashpad/crashpad/+/f496130fd594a0467d7dacdf923a9677cafe280b

Patch Set 1 #

Total comments: 1

Patch Set 2 : Address review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -4 lines) Patch
M util/net/http_transport_mac.mm View 1 chunk +6 lines, -4 lines 0 comments Download
M util/net/http_transport_test.cc View 1 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
Mark Mentovai
5 years, 4 months ago (2015-08-18 19:19:54 UTC) #2
Robert Sesek
LGTM https://codereview.chromium.org/1304433004/diff/1/util/net/http_transport_test.cc File util/net/http_transport_test.cc (right): https://codereview.chromium.org/1304433004/diff/1/util/net/http_transport_test.cc#newcode292 util/net/http_transport_test.cc:292: headers[kContentLength] = base::StringPrintf("%zu", request_string.size()); PRIuS instead of %zu.
5 years, 4 months ago (2015-08-18 19:35:07 UTC) #3
Mark Mentovai
5 years, 4 months ago (2015-08-18 19:42:38 UTC) #4
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
f496130fd594a0467d7dacdf923a9677cafe280b (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698