schwehr / generic-sensor-format

Sonar Generic Sensor Format (gsf) codec
Other
13 stars 8 forks source link

CID 116067 and CID 116068 (#1 of 1): Uninitialized scalar variable (UNINIT) in gsf.c:gsfGetSwathBathyArrayMinMax() #68

Open schwehr opened 8 years ago

schwehr commented 8 years ago

gsf.c: uninit_use: Using uninitialized value minimum.

8. Condition ret_code == 0, taking true branch
8895    if (ret_code == 0)
8896    {

CID 116068 (#1 of 1): Uninitialized scalar variable (UNINIT)
9. uninit_use: Using uninitialized value minimum.
8897        *min_value = ((minimum / multiplier) - offset);
        CID 116067: Uninitialized scalar variable (UNINIT) [select issue]
8898        *max_value = ((maximum / multiplier) - offset);
8899    }
8900
8901    return (ret_code);
8902}
schwehr commented 8 years ago

As of https://github.com/schwehr/generic-sensor-format/commit/d6d888e4cfe755f387ea9c8aaf99c793459471c1, it looks to all be getting into the coverity scan:

cov-build --dir cov-int make obj -j 4
Coverity Build Capture (32-bit) version 7.6.0 on Darwin 14.4.0 x86_64
Internal version numbers: 9b77a50df0 p-harmony-push-21098.563

(cd src/gsf && make obj)
(cd src/gsfxx && make obj)
(cd tests/gsf && make obj)
(cd tests/gsfxx && make obj)
clang -Wall -Wextra -g -O   -c -o gsf.o gsf.c
clang++ -std=c++11 -Wall -Wextra -g -O   -c -o mmap.o mmap.cc
clang++ -std=c++11 -Wall -Wextra -g -O -isystem ../../third_party/gtest/include -isystem ../../third_party/gmock/include -I../../src/gsfxx -I../../third_party/gtest -I../../third_party/gmock  -c -o records_test.o records_test.cc
clang++ -std=c++11 -Wall -Wextra -g -O -isystem ../../third_party/gtest/include -isystem ../../third_party/gmock/include -I../../src/gsf -I../../third_party/gtest -I../../third_party/gmock  -c -o gsf_info.o gsf_info.cc
clang++ -c -isystem ../../third_party/gtest/include -isystem ../../third_party/gmock/include -I../../src/gsf -I../../third_party/gtest -I../../third_party/gmock -std=c++11 -Wall -Wextra -g -O gsf_test_util.cc -o gsf_test_util.o
clang++ -std=c++11 -Wall -Wextra -g -O   -c -o records.o records.cc
clang -Wall -Wextra -g -O   -c -o gsf_dec.o gsf_dec.c
clang++ -std=c++11 -Wall -Wextra -g -O -isystem ../../third_party/gtest/include -isystem ../../third_party/gmock/include -I../../src/gsfxx -I../../third_party/gtest -I../../third_party/gmock  -c -o util_test.o util_test.cc
clang -Wall -Wextra -g -O   -c -o gsf_enc.o gsf_enc.c
clang -Wall -Wextra -g -O   -c -o gsf_geo.o gsf_geo.c
clang++ -std=c++11 -Wall -Wextra -g -O -isystem ../../third_party/gtest/include -isystem ../../third_party/gmock/include -I../../src/gsf -I../../third_party/gtest -I../../third_party/gmock  -c -o index_test.o index_test.cc
clang -Wall -Wextra -g -O   -c -o gsf_indx.o gsf_indx.c
clang++ -std=c++11 -Wall -Wextra -g -O   -c -o util.o util.cc
(cd src/bin && make obj)
clang++ -std=c++11 -Wall -Wextra -g -O -I../gsf -I../gsfxx  -c -o gsf_index.o gsf_index.cc
clang -Wall -Wextra -g -O   -c -o gsf_info.o gsf_info.c
clang++ -std=c++11 -Wall -Wextra -g -O -I../gsf -I../gsfxx  -c -o gsf_info.o gsf_info.cc
clang++ -std=c++11 -Wall -Wextra -g -O -isystem ../../third_party/gtest/include -isystem ../../third_party/gmock/include -I../../src/gsf -I../../third_party/gtest -I../../third_party/gmock  -c -o read_gsf_2_9_test.o read_gsf_2_9_test.cc
clang++ -std=c++11 -Wall -Wextra -g -O -isystem ../../third_party/gtest/include -isystem ../../third_party/gmock/include -I../../src/gsf -I../../third_party/gtest -I../../third_party/gmock  -c -o read_gsf_3_6_test.o read_gsf_3_6_test.cc
clang++ -std=c++11 -Wall -Wextra -g -O -isystem ../../third_party/gtest/include -isystem ../../third_party/gmock/include -I../../src/gsf -I../../third_party/gtest -I../../third_party/gmock  -c -o write_test.o write_test.cc
19 C/C++ compilation units (100%) are ready for analysis
The cov-build utility completed successfully.
schwehr commented 8 years ago

Missed at least on no default block