Use upstream clang 14 for desktop
[platform/framework/web/chromium-efl.git] / sql / recover_module / record.cc
index 7cf0132..773cb2a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
+// Copyright 2019 The Chromium Authors
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -6,8 +6,11 @@
 
 #include <cstddef>
 #include <limits>
+#include <ostream>
 #include <type_traits>
 
+#include "base/check_op.h"
+#include "base/notreached.h"
 #include "sql/recover_module/integers.h"
 #include "sql/recover_module/payload.h"
 #include "third_party/sqlite/sqlite3.h"
@@ -244,7 +247,7 @@ bool RecordReader::ReadValue(int column_index,
     DCHECK(!header.has_inline_value);
 
     uint8_t* const value_bytes = new uint8_t[size];
-    if (!payload_reader_->ReadPayload(offset, size, value_bytes)) {
+    if (size > 0 && !payload_reader_->ReadPayload(offset, size, value_bytes)) {
       delete[] value_bytes;
       return false;
     }
@@ -311,4 +314,4 @@ int64_t RecordReader::InitializeHeaderBuffer() {
 }
 
 }  // namespace recover
-}  // namespace sql
\ No newline at end of file
+}  // namespace sql