summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-09-12 16:07:30 -0700
committerTianjie Xu <xunchang@google.com>2019-09-12 16:07:30 -0700
commitf80524611def5ce77986b198c293d298420a829d (patch)
tree63dba96f9bc58ea3c4e264abb2b931ff41eca673
parent797bbc31202358cba772bfe146e63f6b088f450f (diff)
downloadbsdiff-f80524611def5ce77986b198c293d298420a829d.tar.gz
Fix the unintialized value reported by msan
Intialize option_index in case it's not set by getopt_long. Bug: 140493925 Test: blaze test pass Change-Id: I0f93ef9e3061df2ef7813630d58972e1e0ea8286
-rw-r--r--bsdiff_arguments.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/bsdiff_arguments.cc b/bsdiff_arguments.cc
index 20e6149..7ea9b6d 100644
--- a/bsdiff_arguments.cc
+++ b/bsdiff_arguments.cc
@@ -75,7 +75,7 @@ bool BsdiffArguments::IsValid() const {
bool BsdiffArguments::ParseCommandLine(int argc, char** argv) {
int opt;
- int option_index;
+ int option_index = 0;
while ((opt = getopt_long(argc, argv, "", OPTIONS, &option_index)) != -1) {
if (opt != 0) {
return false;