From 2d85dbf54027da71e88c5c1521b2dc35c4a0670c Mon Sep 17 00:00:00 2001 From: Wiktor Garbacz Date: Mon, 2 Dec 2024 01:29:05 -0800 Subject: [PATCH] Fix uninitialized value use PiperOrigin-RevId: 701877096 Change-Id: I5dcae70aa7e1bf0da67a85b87d6fca36b9ed172d --- sandboxed_api/var_array.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sandboxed_api/var_array.h b/sandboxed_api/var_array.h index 49a4308b..cacc76bf 100644 --- a/sandboxed_api/var_array.h +++ b/sandboxed_api/var_array.h @@ -144,10 +144,10 @@ class Array : public Var { } // Pointer to the data, owned by the object if buffer_owned_ is 'true'. - T* arr_; - size_t nelem_; // Number of elements - size_t total_size_; // Total size in bytes - bool buffer_owned_; // Whether we own the buffer + T* arr_ = nullptr; + size_t nelem_ = 0; // Number of elements + size_t total_size_ = 0; // Total size in bytes + bool buffer_owned_ = false; // Whether we own the buffer }; // Specialized Array class for representing NUL-terminated C-style strings. The