Details
-
Bug
-
Status: Resolved
-
Not specified
-
Resolution: Fixed
-
9.0.0
-
None
-
Coverity scan
Description
The reported problems are:
CID | Impact | Type | Category | File | Function |
---|---|---|---|---|---|
1536702 | High | Memset fill value of '0' | Memory - illegal accesses | /home/centos/build/CE/platform/HPCC-Platform/system/jhtree/jhtree.cpp | buildTestKey |
1536704 | Low | An array is captured by a lambda | Performance inefficiencies | /home/centos/build/CE/platform/HPCC-Platform/system/jhtree/jhinplace.cpp | operator () |
1536705 | Low | 'Constant' variable guards dead code | Possible Control flow issues | /home/centos/build/CE/platform/HPCC-Platform/system/jhtree/jhinplace.cpp | write |
*** CID 1536705: (DEADCODE) /home/centos/build/CE/platform/HPCC-Platform/system/jhtree/jhinplace.cpp: 2046 in CInplaceLeafWriteNode::write(IFileIOStream *, CRC32 *)() 2040 } 2041 2042 if (keyLen != keyCompareLen) 2043 { 2044 if (useUncompressed) 2045 { >>> CID 1536705: (DEADCODE) >>> Execution cannot reach this statement: "if (this->isVariable) ser...". 2046 if (isVariable) 2047 serializePacked(data, uncompressed.length()); 2048 data.append(uncompressed.length(), uncompressed.bufferBase()); 2049 } 2050 else 2051 { /home/centos/build/CE/platform/HPCC-Platform/system/jhtree/jhinplace.cpp: 2023 in CInplaceLeafWriteNode::write(IFileIOStream *, CRC32 *)() 2017 //Pack these by scaling and reducing the number of bytes 2018 unsigned bytesPerPosition = 0; 2019 if (minPosition != maxPosition) 2020 bytesPerPosition = bytesRequired(maxPosition-minPosition); 2021 2022 bool useUncompressed = false; // Implement in HPCC-19115 >>> CID 1536705: (DEADCODE) >>> Execution cannot reach the expression "64" inside this statement: "sizeMask = (byte)bytesPerPo...". 2023 byte sizeMask = (byte)bytesPerPosition | (useUncompressed ? NSFuncompressedPayload : 0); 2024 data.append(sizeMask); 2025 serializePacked(data, minPosition); 2026 if (bytesPerPosition != 0) 2027 { 2028 for (unsigned i=0; i < positions.ordinality(); i++)** CID 1536704: Performance inefficiencies (PASS_BY_VALUE) /home/centos/build/CE/platform/HPCC-Platform/system/jhtree/jhinplace.cpp: 2227 in InplaceIndexTest::testSearching()::[lambda(const char *) (instance 2)]::operator ()(const char *) const() ________________________________________________________________________________________________________ *** CID 1536704: Performance inefficiencies (PASS_BY_VALUE) /home/centos/build/CE/platform/HPCC-Platform/system/jhtree/jhinplace.cpp: 2227 in InplaceIndexTest::testSearching()::[lambda(const char *) (instance 2)]::operator ()(const char *) const() 2221 2222 if (!searcher.getValueAt(i, result)) 2223 printf("%u: getValue() failed\n", i); 2224 else if (!streq(entry, result)) 2225 printf("%u: '%s', '%s'\n", i, entry, result); 2226 >>> CID 1536704: Performance inefficiencies (PASS_BY_VALUE) >>> Capturing variable "entries", which is a C-array, in a lambda. Unlike function parameters, this array is copied and passed by value. 2227 auto callback = [numEntries, entries, &searcher](const char * search) 2228 { 2229 for (unsigned j= 0; j < numEntries; j++) 2230 { 2231 int expected = normalizeCompare(strcmp(search, entries[j])); 2232 int actual = normalizeCompare(searcher.compareValueAt(search, j));** CID 1536703: Null pointer dereferences (FORWARD_NULL) /home/centos/build/CE/platform/HPCC-Platform/testing/unittests/datamaskingtests.cpp: 730 in DataMaskingEngineTests::assertQueriedProfile(DataMasking::CEngine *, const char *, unsigned char, const char *, unsigned char)() ________________________________________________________________________________________________________ *** CID 1536702: Memory - illegal accesses (NO_EFFECT) /home/centos/build/CE/platform/HPCC-Platform/system/jhtree/jhtree.cpp: 3445 in IKeyManagerTest::buildTestKey(const char *, bool, bool, bool, bool, bool, IOutputMetaData *, const char *)() 3439 (useTrailingHeader ? USE_TRAILING_HEADER : 0) | 3440 (noSeek ? TRAILING_HEADER_ONLY : 0) | 3441 0, 3442 maxRecSize, NODESIZE, keyedSize, 0, &helper, true, false); 3443 3444 char keybuf[18]; >>> CID 1536702: Memory - illegal accesses (NO_EFFECT) >>> Function "memset" with fill value "'0'" (the zero character) in "memset(keybuf, 48, 18UL)". 3445 memset(keybuf, '0', 18); 3446 uint32_t maxRecordSizeSeen = 0; 3447 for (unsigned count = 0; count < 10000; count++) 3448 { 3449 unsigned datasize = 10; 3450 if (variable && (count % 10)==0)