From 89fe376d13d783efa773acd81082a27919a4c00e Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Wed, 18 Mar 2020 06:18:10 -0700 Subject: [PATCH] [adb data server] Initialize variable servingComplete_ was left uninitialized and only set to 'true' in the code. We initialize it to the 'false' state to avoid uninitialized references in SkipToRequest(). Bug: 150865433 Test: TreeHugger Change-Id: Ia8a4d7135c432eb657543c5498fc9dbe8f4718b6 Merged-In: Ia8a4d7135c432eb657543c5498fc9dbe8f4718b6 --- adb/client/incremental_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adb/client/incremental_server.cpp b/adb/client/incremental_server.cpp index 1a1361c6d..bfe18c0b2 100644 --- a/adb/client/incremental_server.cpp +++ b/adb/client/incremental_server.cpp @@ -264,7 +264,7 @@ class IncrementalServer { char* pendingBlocks_ = nullptr; // True when client notifies that all the data has been received - bool servingComplete_; + bool servingComplete_ = false; }; bool IncrementalServer::SkipToRequest(void* buffer, size_t* size, bool blocking) {