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

Side by Side Diff: net/der/encode_values.cc

Issue 2148303002: Initialize memory in encode_values_unittest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove drmemory suppression. Created 4 years, 5 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 | « net/der/encode_values.h ('k') | net/der/encode_values_unittest.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/time/time.h" 5 #include "base/time/time.h"
6 #include "net/der/encode_values.h" 6 #include "net/der/encode_values.h"
7 7
8 namespace net { 8 namespace net {
9 9
10 namespace der { 10 namespace der {
11 11
12 bool EncodeTimeAsGeneralizedTime(const base::Time& time, 12 bool EncodeTimeAsGeneralizedTime(const base::Time& time,
13 der::GeneralizedTime* generalized_time) { 13 der::GeneralizedTime* generalized_time) {
14 base::Time::Exploded exploded; 14 base::Time::Exploded exploded;
15 time.UTCExplode(&exploded); 15 time.UTCExplode(&exploded);
16 if (!exploded.HasValidValues()) 16 if (!exploded.HasValidValues())
17 return false; 17 return false;
18 18
19 generalized_time->year = exploded.year; 19 generalized_time->year = exploded.year;
20 generalized_time->month = exploded.month; 20 generalized_time->month = exploded.month;
21 generalized_time->day = exploded.day_of_month; 21 generalized_time->day = exploded.day_of_month;
22 generalized_time->hours = exploded.hour; 22 generalized_time->hours = exploded.hour;
23 generalized_time->minutes = exploded.minute; 23 generalized_time->minutes = exploded.minute;
24 generalized_time->seconds = exploded.second; 24 generalized_time->seconds = exploded.second;
25 return true; 25 return true;
26 } 26 }
27 27
28 } // namespace der 28 } // namespace der
29 29
30 } // namespace net 30 } // namespace net
OLDNEW
« no previous file with comments | « net/der/encode_values.h ('k') | net/der/encode_values_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698