What is a Conditionally Uninitialized Variable? The return value of a function that is potentially used to initialize a local variable is not checked. Therefore, reading the local variable may result in undefined behavior.
4 instances of this defect were found in the following locations:
if (IsDepWeak(file_->dependency(i))) continue;
if (IsBootstrapProto(options_, file_)) {
GetBootstrapBasename(options_, basename, &basename); <------ HERE
}
What is a Conditionally Uninitialized Variable? The return value of a function that is potentially used to initialize a local variable is not checked. Therefore, reading the local variable may result in undefined behavior.
4 instances of this defect were found in the following locations:
Instance 1 File :
src/google/protobuf/compiler/cpp/cpp_file.cc
Enclosing Function :GeneratePBHeader@FileGenerator@cpp@compiler@protobuf@google
Function :GetBootstrapBasename@cpp@compiler@protobuf@google
https://github.com/sagarpant1/protobuf/blob/6b1d0f11493ef2317ea74aa00804835a10ebaf19/src/google/protobuf/compiler/cpp/cpp_file.cc#L292 Issue in: _targetbasenameCode extract:
How can I fix it? Correct reference usage found in
src/google/protobuf/compiler/cpp/cpp_helpers.cc
at line1295
. https://github.com/sagarpant1/protobuf/blob/6b1d0f11493ef2317ea74aa00804835a10ebaf19/src/google/protobuf/compiler/cpp/cpp_helpers.cc#L1295 Code extract:Instance 2 File :
src/google/protobuf/compiler/cpp/cpp_file.cc
Enclosing Function :GenerateSourceIncludes@FileGenerator@cpp@compiler@protobuf@google
Function :GetBootstrapBasename@cpp@compiler@protobuf@google
https://github.com/sagarpant1/protobuf/blob/6b1d0f11493ef2317ea74aa00804835a10ebaf19/src/google/protobuf/compiler/cpp/cpp_file.cc#L386 Issue in: _targetbasenameCode extract:
How can I fix it? Correct reference usage found in
src/google/protobuf/compiler/cpp/cpp_helpers.cc
at line1295
. https://github.com/sagarpant1/protobuf/blob/6b1d0f11493ef2317ea74aa00804835a10ebaf19/src/google/protobuf/compiler/cpp/cpp_helpers.cc#L1295 Code extract:Instance 3 File :
src/google/protobuf/compiler/cpp/cpp_file.cc
Enclosing Function :GenerateSourceIncludes@FileGenerator@cpp@compiler@protobuf@google
Function :GetBootstrapBasename@cpp@compiler@protobuf@google
https://github.com/sagarpant1/protobuf/blob/6b1d0f11493ef2317ea74aa00804835a10ebaf19/src/google/protobuf/compiler/cpp/cpp_file.cc#L424 Issue in: basenameCode extract:
How can I fix it? Correct reference usage found in
src/google/protobuf/compiler/cpp/cpp_helpers.cc
at line1295
. https://github.com/sagarpant1/protobuf/blob/6b1d0f11493ef2317ea74aa00804835a10ebaf19/src/google/protobuf/compiler/cpp/cpp_helpers.cc#L1295 Code extract:Instance 4 File :
src/google/protobuf/compiler/cpp/cpp_file.cc
Enclosing Function :GenerateDependencyIncludes@FileGenerator@cpp@compiler@protobuf@google
Function :GetBootstrapBasename@cpp@compiler@protobuf@google
https://github.com/sagarpant1/protobuf/blob/6b1d0f11493ef2317ea74aa00804835a10ebaf19/src/google/protobuf/compiler/cpp/cpp_file.cc#L1383 Issue in: basenameCode extract:
How can I fix it? Correct reference usage found in
src/google/protobuf/compiler/cpp/cpp_helpers.cc
at line1295
. https://github.com/sagarpant1/protobuf/blob/6b1d0f11493ef2317ea74aa00804835a10ebaf19/src/google/protobuf/compiler/cpp/cpp_helpers.cc#L1295 Code extract: