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

Issue 8418034: Make string_util::WriteInto() DCHECK() that the supplied |length_with_null| > 1, meaning that the... (Closed)

Created:
9 years, 1 month ago by Peter Kasting
Modified:
9 years ago
CC:
chromium-reviews, hclam+watch_chromium.org, cbentzel+watch_chromium.org, James Su, ddorwin+watch_chromium.org, fischman+watch_chromium.org, tfarina, amit, dhollowa, acolwell+watch_chromium.org, annacc+watch_chromium.org, brettw-cc_chromium.org, kkania, Paweł Hajdan Jr., darin-cc_chromium.org, ajwong+watch_chromium.org, vrk (LEFT CHROMIUM), robertshield, scherkus (not reviewing), jshin+watch_chromium.org, ihf+watch_chromium.org
Visibility:
Public.

Description

ake string_util::WriteInto() DCHECK() that the supplied |length_with_null| > 1, meaning that the without-'\0' string is non-empty. This replaces the conditional code added recently that makes this case return NULL. It's easier to understand if it's simply an error to call WriteInto() in this case at all. Add DCHECK()s or conditionals as appropriate to callers in order to ensure this assertion holds. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=112005

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 14

Patch Set 3 : '' #

Total comments: 2

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 6

Patch Set 7 : '' #

Total comments: 10

Patch Set 8 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+215 lines, -274 lines) Patch
M base/base_paths_mac.mm View 1 2 3 4 5 6 7 2 chunks +6 lines, -11 lines 0 comments Download
M base/rand_util.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M base/rand_util.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M base/rand_util_unittest.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M base/string_util.h View 1 2 3 4 5 6 7 1 chunk +19 lines, -27 lines 0 comments Download
M base/string_util_unittest.cc View 1 2 3 4 5 6 7 2 chunks +21 lines, -28 lines 0 comments Download
M chrome/browser/automation/testing_automation_provider_win.cc View 1 2 3 4 5 6 7 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/browser_focus_uitest.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/mac/install_from_dmg.mm View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/shell_integration_win.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -3 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_view_win.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -10 lines 0 comments Download
M chrome/common/metrics_log_manager.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/time_format.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M chrome_frame/chrome_tab.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M chrome_frame/test/win_event_receiver.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M chrome_frame/utils.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M crypto/encryptor.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -3 lines 0 comments Download
M crypto/encryptor_mac.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -2 lines 0 comments Download
M crypto/encryptor_nss.cc View 1 2 3 4 5 6 7 4 chunks +12 lines, -17 lines 0 comments Download
M crypto/encryptor_openssl.cc View 1 2 3 4 5 6 7 3 chunks +5 lines, -1 line 0 comments Download
M crypto/encryptor_unittest.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -18 lines 0 comments Download
M crypto/encryptor_win.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -3 lines 0 comments Download
M crypto/symmetric_key.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -3 lines 0 comments Download
M crypto/symmetric_key_openssl.cc View 1 2 3 4 5 6 7 4 chunks +11 lines, -7 lines 0 comments Download
M media/audio/win/audio_manager_win.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -3 lines 0 comments Download
M net/base/net_util.cc View 1 2 3 4 5 6 7 2 chunks +36 lines, -43 lines 0 comments Download
M net/base/x509_certificate_win.cc View 1 2 3 4 5 6 7 1 chunk +12 lines, -8 lines 0 comments Download
M net/disk_cache/entry_impl.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -3 lines 0 comments Download
M net/http/http_mac_signature.cc View 1 2 3 4 5 6 7 1 chunk +6 lines, -3 lines 0 comments Download
M net/http/http_mac_signature_unittest.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M sandbox/src/process_policy_test.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
M sandbox/src/sandbox_utils.h View 1 2 3 4 5 6 7 2 chunks +1 line, -13 lines 0 comments Download
M sandbox/src/sandbox_utils.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -17 lines 0 comments Download
M sandbox/tests/common/controller.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M ui/base/clipboard/clipboard_win.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M ui/base/l10n/l10n_util.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M ui/base/win/ime_input.cc View 1 2 3 4 5 6 7 1 chunk +12 lines, -15 lines 0 comments Download
M views/controls/textfield/native_textfield_win.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -11 lines 0 comments Download

Messages

Total messages: 30 (0 generated)
joth
A couple drive-by comments that occurred to me while reading the openssl changes. http://codereview.chromium.org/8418034/diff/7005/base/string_util.h File ...
9 years, 1 month ago (2011-11-01 11:25:32 UTC) #1
cbentzel
Thank you for cleaning the mess I made. I agree that this is an improvement ...
9 years, 1 month ago (2011-11-01 12:15:06 UTC) #2
rvargas (doing something else)
http://codereview.chromium.org/8418034/diff/7005/net/disk_cache/entry_impl.cc File net/disk_cache/entry_impl.cc (right): http://codereview.chromium.org/8418034/diff/7005/net/disk_cache/entry_impl.cc#newcode776 net/disk_cache/entry_impl.cc:776: ++key_len; // We store a trailing \0 on disk ...
9 years, 1 month ago (2011-11-01 18:13:47 UTC) #3
joth
http://codereview.chromium.org/8418034/diff/7005/net/disk_cache/entry_impl.cc File net/disk_cache/entry_impl.cc (right): http://codereview.chromium.org/8418034/diff/7005/net/disk_cache/entry_impl.cc#newcode776 net/disk_cache/entry_impl.cc:776: ++key_len; // We store a trailing \0 on disk ...
9 years, 1 month ago (2011-11-01 19:14:50 UTC) #4
rvargas (doing something else)
http://codereview.chromium.org/8418034/diff/7005/net/disk_cache/entry_impl.cc File net/disk_cache/entry_impl.cc (right): http://codereview.chromium.org/8418034/diff/7005/net/disk_cache/entry_impl.cc#newcode776 net/disk_cache/entry_impl.cc:776: ++key_len; // We store a trailing \0 on disk ...
9 years, 1 month ago (2011-11-01 19:36:52 UTC) #5
Peter Kasting
New snap up. This is now ready for review. jshin: net_util.cc cbentzel: rest... I contacted ...
9 years, 1 month ago (2011-11-01 19:43:27 UTC) #6
jungshik at Google
http://codereview.chromium.org/8418034/diff/13001/net/base/net_util.cc File net/base/net_util.cc (right): http://codereview.chromium.org/8418034/diff/13001/net/base/net_util.cc#newcode231 net/base/net_util.cc:231: length, &err); |length| is now the target buffer capacity. ...
9 years, 1 month ago (2011-11-01 20:13:09 UTC) #7
Peter Kasting
http://codereview.chromium.org/8418034/diff/13001/net/base/net_util.cc File net/base/net_util.cc (right): http://codereview.chromium.org/8418034/diff/13001/net/base/net_util.cc#newcode231 net/base/net_util.cc:231: length, &err); On 2011/11/01 20:13:09, Jungshik Shin wrote: > ...
9 years, 1 month ago (2011-11-01 20:21:51 UTC) #8
jungshik at Google
thanks. net_util : lgtm On 2011/11/01 20:21:51, Peter Kasting wrote: > http://codereview.chromium.org/8418034/diff/13001/net/base/net_util.cc > File net/base/net_util.cc ...
9 years, 1 month ago (2011-11-01 20:39:46 UTC) #9
Peter Kasting
+rsleevi. Ryan, can you either LG or tell me to raise certain DCHECKs to CHECKs ...
9 years, 1 month ago (2011-11-01 22:33:56 UTC) #10
Ryan Sleevi
To make sure I'm understanding this change: Currently, if WriteInto(..., 0 || 1) is called, ...
9 years, 1 month ago (2011-11-01 23:08:58 UTC) #11
Peter Kasting
On 2011/11/01 23:08:58, Ryan Sleevi wrote: > Currently, if WriteInto(..., 0 || 1) is called, ...
9 years, 1 month ago (2011-11-01 23:20:16 UTC) #12
Ryan Sleevi
On 2011/11/01 23:20:16, Peter Kasting wrote: > On 2011/11/01 23:08:58, Ryan Sleevi wrote: > > ...
9 years, 1 month ago (2011-11-01 23:30:23 UTC) #13
Peter Kasting
On 2011/11/01 23:30:23, Ryan Sleevi wrote: > To be clear: I absolutely agree that this ...
9 years, 1 month ago (2011-11-02 00:01:37 UTC) #14
Ryan Sleevi
On 2011/11/02 00:01:37, Peter Kasting wrote: > On 2011/11/01 23:30:23, Ryan Sleevi wrote: > > ...
9 years, 1 month ago (2011-11-02 00:55:51 UTC) #15
Peter Kasting
On 2011/11/02 00:55:51, Ryan Sleevi wrote: > I think the rest of the discussion hinges ...
9 years, 1 month ago (2011-11-02 01:17:41 UTC) #16
Ryan Sleevi
On 2011/11/02 01:17:41, Peter Kasting wrote: > What I mostly want from you is a ...
9 years, 1 month ago (2011-11-02 02:04:26 UTC) #17
Peter Kasting
OK, you convinced me. I'll change these all to CHECKs and then file a separate ...
9 years, 1 month ago (2011-11-02 18:00:09 UTC) #18
Peter Kasting
On 2011/11/02 18:00:09, Peter Kasting wrote: > OK, you convinced me. I'll change these all ...
9 years, 1 month ago (2011-11-02 21:10:02 UTC) #19
Peter Kasting
cbentzel: ping? rsleevi: Given http://codereview.chromium.org/8511050/ , should I revert all my changes to crypto/? Or ...
9 years, 1 month ago (2011-11-15 00:27:32 UTC) #20
Ryan Sleevi
On 2011/11/15 00:27:32, Peter Kasting wrote: > cbentzel: ping? > rsleevi: Given http://codereview.chromium.org/8511050/ , should ...
9 years, 1 month ago (2011-11-15 00:30:09 UTC) #21
cbentzel
LGTM Remove the empty BUG=/TEST= lines from the CL description. I did not review the ...
9 years, 1 month ago (2011-11-15 11:37:09 UTC) #22
Peter Kasting
On 2011/11/15 11:37:09, cbentzel wrote: > Remove the empty BUG=/TEST= lines from the CL description. ...
9 years, 1 month ago (2011-11-15 18:50:32 UTC) #23
Peter Kasting
Can I get OWNERS r+ from: mark: base rsleevi: crypto -- since http://codereview.chromium.org/8511050/ has not ...
9 years ago (2011-11-28 22:31:16 UTC) #24
Mark Mentovai
LG otherwise in base. http://codereview.chromium.org/8418034/diff/13022/base/base_paths_mac.mm File base/base_paths_mac.mm (right): http://codereview.chromium.org/8418034/diff/13022/base/base_paths_mac.mm#newcode29 base/base_paths_mac.mm:29: DCHECK_GT(executable_length, 1u); Peter Kasting wrote: ...
9 years ago (2011-11-28 22:41:20 UTC) #25
scherkus (not reviewing)
media LGTM
9 years ago (2011-11-28 23:05:21 UTC) #26
sky
LGTM
9 years ago (2011-11-28 23:48:53 UTC) #27
Peter Kasting
http://codereview.chromium.org/8418034/diff/13022/base/base_paths_mac.mm File base/base_paths_mac.mm (right): http://codereview.chromium.org/8418034/diff/13022/base/base_paths_mac.mm#newcode35 base/base_paths_mac.mm:35: return true; On 2011/11/28 22:41:21, Mark Mentovai wrote: > ...
9 years ago (2011-11-29 01:48:15 UTC) #28
Ryan Sleevi
crypto/ LGTM
9 years ago (2011-11-29 02:32:32 UTC) #29
Mark Mentovai
9 years ago (2011-11-29 19:23:11 UTC) #30
LGTM per harassment

Powered by Google App Engine
This is Rietveld 408576698