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

Side by Side Diff: base/json/json_writer.cc

Issue 2750533003: Temporarily CHECK use after free in Value (Closed)
Patch Set: Fix more Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/trace_event/trace_event_argument.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/json/json_writer.h" 5 #include "base/json/json_writer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <limits> 10 #include <limits>
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 191 }
192 192
193 json_string_->push_back('}'); 193 json_string_->push_back('}');
194 return result; 194 return result;
195 } 195 }
196 196
197 case Value::Type::BINARY: 197 case Value::Type::BINARY:
198 // Successful only if we're allowed to omit it. 198 // Successful only if we're allowed to omit it.
199 DLOG_IF(ERROR, !omit_binary_values_) << "Cannot serialize binary value."; 199 DLOG_IF(ERROR, !omit_binary_values_) << "Cannot serialize binary value.";
200 return omit_binary_values_; 200 return omit_binary_values_;
201
202 case Value::Type::DELETED:
203 // TODO(crbug.com/697817): This means |node| is used after free.
204 CHECK(false);
205 return false;
201 } 206 }
202 NOTREACHED(); 207 NOTREACHED();
203 return false; 208 return false;
204 } 209 }
205 210
206 void JSONWriter::IndentLine(size_t depth) { 211 void JSONWriter::IndentLine(size_t depth) {
207 json_string_->append(depth * 3U, ' '); 212 json_string_->append(depth * 3U, ' ');
208 } 213 }
209 214
210 } // namespace base 215 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/trace_event/trace_event_argument.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698