All of lore.kernel.org
 help / color / mirror / Atom feed
From: scan-admin@coverity.com
To: ceph-devel@vger.kernel.org
Subject: New Defects reported by Coverity Scan for ceph
Date: Fri, 27 Oct 2017 00:31:05 +0000 (UTC)	[thread overview]
Message-ID: <59f27e49144fc_e3c40932c3534a@ss1435.mail> (raw)


Hi,

Please find the latest report on new defect(s) introduced to ceph found with Coverity Scan.

15 new defect(s) introduced to ceph found with Coverity Scan.
18 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 15 of 15 defect(s)


** CID 1420321:  Resource leaks  (RESOURCE_LEAK)
/home/brad/working/src/ceph/src/tools/ceph_kvstore_tool.cc: 88 in StoreTool::StoreTool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, bool)()


________________________________________________________________________________________________________
*** CID 1420321:  Resource leaks  (RESOURCE_LEAK)
/home/brad/working/src/ceph/src/tools/ceph_kvstore_tool.cc: 88 in StoreTool::StoreTool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, bool)()
82               cerr << "failed to open type " << type << " path " << path << ": "
83                    << cpp_strerror(r) << std::endl;
84               exit(1);
85             }
86             db.reset(db_ptr);
87           }
>>>     CID 1420321:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "db_ptr" going out of scope leaks the storage it points to.
88         }
89       }
90     
91       uint32_t traverse(const string &prefix,
92                         const bool do_crc,
93                         ostream *out) {

** CID 1420322:  Error handling issues  (UNCAUGHT_EXCEPT)
/home/brad/working/src/ceph/src/test/librgw_file_marker.cc: 421 in main()


________________________________________________________________________________________________________
*** CID 1420322:  Error handling issues  (UNCAUGHT_EXCEPT)
/home/brad/working/src/ceph/src/test/librgw_file_marker.cc: 421 in main()
415     }
416     
417     TEST(LibRGW, SHUTDOWN) {
418       librgw_shutdown(rgw_h);
419     }
420     
>>>     CID 1420322:  Error handling issues  (UNCAUGHT_EXCEPT)
>>>     In function "main(int, char **)" an exception of type "testing::internal::<unnamed>::ClassUniqueToAlwaysTrue" is thrown and never caught.
421     int main(int argc, char *argv[])
422     {
423       char *v{nullptr};
424       string val;
425       vector<const char*> args;
426     

** CID 1420323:  Null pointer dereferences  (FORWARD_NULL)
/home/brad/working/src/ceph/src/zstd/lib/dictBuilder/cover.c: 852 in COVER_tryParameters()


________________________________________________________________________________________________________
*** CID 1420323:  Null pointer dereferences  (FORWARD_NULL)
/home/brad/working/src/ceph/src/zstd/lib/dictBuilder/cover.c: 852 in COVER_tryParameters()
846       BYTE *const dict = (BYTE * const)malloc(dictBufferCapacity);
847       U32 *freqs = (U32 *)malloc(ctx->suffixSize * sizeof(U32));
848       if (!COVER_map_init(&activeDmers, parameters.k - parameters.d + 1)) {
849         DISPLAYLEVEL(1, "Failed to allocate dmer map: out of memory\n");
850         goto _cleanup;
851       }
>>>     CID 1420323:  Null pointer dereferences  (FORWARD_NULL)
>>>     Comparing "dict" to null implies that "dict" might be null.
852       if (!dict || !freqs) {
853         DISPLAYLEVEL(1, "Failed to allocate buffers: out of memory\n");
854         goto _cleanup;
855       }
856       /* Copy the frequencies because we need to modify them */
857       memcpy(freqs, ctx->freqs, ctx->suffixSize * sizeof(U32));

** CID 1420324:  Null pointer dereferences  (FORWARD_NULL)
/home/brad/working/src/ceph/src/zstd/lib/decompress/zstd_decompress.c: 2085 in ZSTD_initDDict_internal()


________________________________________________________________________________________________________
*** CID 1420324:  Null pointer dereferences  (FORWARD_NULL)
/home/brad/working/src/ceph/src/zstd/lib/decompress/zstd_decompress.c: 2085 in ZSTD_initDDict_internal()
2079     
2080     
2081     static size_t ZSTD_initDDict_internal(ZSTD_DDict* ddict, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod)
2082     {
2083         if ((dictLoadMethod == ZSTD_dlm_byRef) || (!dict) || (!dictSize)) {
2084             ddict->dictBuffer = NULL;
>>>     CID 1420324:  Null pointer dereferences  (FORWARD_NULL)
>>>     Assigning: "ddict->dictContent" = "dict".
2085             ddict->dictContent = dict;
2086         } else {
2087             void* const internalBuffer = ZSTD_malloc(dictSize, ddict->cMem);
2088             ddict->dictBuffer = internalBuffer;
2089             ddict->dictContent = internalBuffer;
2090             if (!internalBuffer) return ERROR(memory_allocation);

** CID 1420325:  Resource leaks  (RESOURCE_LEAK)
/home/brad/working/src/ceph/src/compressor/zstd/ZstdCompressor.h: 84 in ZstdCompressor::decompress(ceph::buffer::list::iterator &, unsigned long, ceph::buffer::list&)()


________________________________________________________________________________________________________
*** CID 1420325:  Resource leaks  (RESOURCE_LEAK)
/home/brad/working/src/ceph/src/compressor/zstd/ZstdCompressor.h: 84 in ZstdCompressor::decompress(ceph::buffer::list::iterator &, unsigned long, ceph::buffer::list&)()
78         outbuf.size = dstptr.length();
79         outbuf.pos = 0;
80         ZSTD_DStream *s = ZSTD_createDStream();
81         ZSTD_initDStream(s);
82         while (compressed_len > 0) {
83           if (p.end()) {
>>>     CID 1420325:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "s" going out of scope leaks the storage it points to.
84     	return -1;
85           }
86           ZSTD_inBuffer_s inbuf;
87           inbuf.pos = 0;
88           inbuf.size = p.get_ptr_and_advance(compressed_len, (const char**)&inbuf.src);
89           ZSTD_decompressStream(s, &outbuf, &inbuf);

** CID 1420326:  Null pointer dereferences  (REVERSE_INULL)
/home/brad/working/src/ceph/src/zstd/lib/compress/zstdmt_compress.c: 834 in ZSTDMT_initCStream_usingCDict()


________________________________________________________________________________________________________
*** CID 1420326:  Null pointer dereferences  (REVERSE_INULL)
/home/brad/working/src/ceph/src/zstd/lib/compress/zstdmt_compress.c: 834 in ZSTDMT_initCStream_usingCDict()
828                                          ZSTD_frameParameters fParams,
829                                          unsigned long long pledgedSrcSize)
830     {
831         ZSTD_CCtx_params cctxParams = mtctx->params;
832         cctxParams.cParams = ZSTD_getCParamsFromCDict(cdict);
833         cctxParams.fParams = fParams;
>>>     CID 1420326:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "cdict" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
834         if (cdict==NULL) return ERROR(dictionary_wrong);   /* method incompatible with NULL cdict */
835         return ZSTDMT_initCStream_internal(mtctx, NULL, 0 /*dictSize*/, ZSTD_dm_auto, cdict,
836                                            cctxParams, pledgedSrcSize);
837     }
838     
839     

** CID 1420327:    (OVERRUN)
/home/brad/working/src/ceph/src/zstd/lib/compress/zstd_compress.c: 1366 in ZSTD_encodeSequences()
/home/brad/working/src/ceph/src/zstd/lib/compress/zstd_compress.c: 1398 in ZSTD_encodeSequences()


________________________________________________________________________________________________________
*** CID 1420327:    (OVERRUN)
/home/brad/working/src/ceph/src/zstd/lib/compress/zstd_compress.c: 1366 in ZSTD_encodeSequences()
1360         if (MEM_32bits()) BIT_flushBits(&blockStream);
1361         BIT_addBits(&blockStream, sequences[nbSeq-1].matchLength, ML_bits[mlCodeTable[nbSeq-1]]);
1362         if (MEM_32bits()) BIT_flushBits(&blockStream);
1363         if (longOffsets) {
1364             U32 const ofBits = ofCodeTable[nbSeq-1];
1365             int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1);
>>>     CID 1420327:    (OVERRUN)
>>>     Checking "extraBits" implies that "extraBits" is 0 on the false branch.
1366             if (extraBits) {
1367                 BIT_addBits(&blockStream, sequences[nbSeq-1].offset, extraBits);
1368                 BIT_flushBits(&blockStream);
1369             }
1370             BIT_addBits(&blockStream, sequences[nbSeq-1].offset >> extraBits,
1371                         ofBits - extraBits);
/home/brad/working/src/ceph/src/zstd/lib/compress/zstd_compress.c: 1398 in ZSTD_encodeSequences()
1392                 BIT_addBits(&blockStream, sequences[n].litLength, llBits);
1393                 if (MEM_32bits() && ((llBits+mlBits)>24)) BIT_flushBits(&blockStream);
1394                 BIT_addBits(&blockStream, sequences[n].matchLength, mlBits);
1395                 if (MEM_32bits() || (ofBits+mlBits+llBits > 56)) BIT_flushBits(&blockStream);
1396                 if (longOffsets) {
1397                     int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1);
>>>     CID 1420327:    (OVERRUN)
>>>     Checking "extraBits" implies that "extraBits" is 0 on the false branch.
1398                     if (extraBits) {
1399                         BIT_addBits(&blockStream, sequences[n].offset, extraBits);
1400                         BIT_flushBits(&blockStream);                            /* (7)*/
1401                     }
1402                     BIT_addBits(&blockStream, sequences[n].offset >> extraBits,
1403                                 ofBits - extraBits);                            /* 31 */

** CID 1420328:    (FORWARD_NULL)
/home/brad/working/src/ceph/src/rgw/rgw_log.cc: 360 in rgw_log_op(RGWRados *, RGWREST *, req_state *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, OpsLogSocket *)()
/home/brad/working/src/ceph/src/rgw/rgw_log.cc: 363 in rgw_log_op(RGWRados *, RGWREST *, req_state *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, OpsLogSocket *)()
/home/brad/working/src/ceph/src/rgw/rgw_log.cc: 372 in rgw_log_op(RGWRados *, RGWREST *, req_state *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, OpsLogSocket *)()


________________________________________________________________________________________________________
*** CID 1420328:    (FORWARD_NULL)
/home/brad/working/src/ceph/src/rgw/rgw_log.cc: 360 in rgw_log_op(RGWRados *, RGWREST *, req_state *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, OpsLogSocket *)()
354       // legacy apps are still using misspelling referer, such as curl -e option
355       if (s->info.env->exists("HTTP_REFERRER"))
356         set_param_str(s, "HTTP_REFERRER", entry.referrer);
357       else
358         set_param_str(s, "HTTP_REFERER", entry.referrer);
359     
>>>     CID 1420328:    (FORWARD_NULL)
>>>     Passing null pointer "s->info.env->get("REQUEST_METHOD", NULL)" to "basic_string", which dereferences it. [Note: The source code implementation of the function has been overridden by a builtin model.]
360       std::string uri(s->info.env->get("REQUEST_METHOD"));
361       uri.append(" ");
362     
363       uri.append(s->info.env->get("REQUEST_URI"));
364       const char* qs = s->info.env->get("QUERY_STRING");
365       if(qs && (*qs != '\0')) {
/home/brad/working/src/ceph/src/rgw/rgw_log.cc: 363 in rgw_log_op(RGWRados *, RGWREST *, req_state *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, OpsLogSocket *)()
357       else
358         set_param_str(s, "HTTP_REFERER", entry.referrer);
359     
360       std::string uri(s->info.env->get("REQUEST_METHOD"));
361       uri.append(" ");
362     
>>>     CID 1420328:    (FORWARD_NULL)
>>>     Passing null pointer "s->info.env->get("REQUEST_URI", NULL)" to "append", which dereferences it. [Note: The source code implementation of the function has been overridden by a builtin model.]
363       uri.append(s->info.env->get("REQUEST_URI"));
364       const char* qs = s->info.env->get("QUERY_STRING");
365       if(qs && (*qs != '\0')) {
366         uri.append("?");
367         uri.append(qs);
368       }
/home/brad/working/src/ceph/src/rgw/rgw_log.cc: 372 in rgw_log_op(RGWRados *, RGWREST *, req_state *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, OpsLogSocket *)()
366         uri.append("?");
367         uri.append(qs);
368       }
369     
370       uri.append(" ");
371       uri.append("HTTP/");
>>>     CID 1420328:    (FORWARD_NULL)
>>>     Passing null pointer "s->info.env->get("HTTP_VERSION", NULL)" to "append", which dereferences it. [Note: The source code implementation of the function has been overridden by a builtin model.]
372       uri.append(s->info.env->get("HTTP_VERSION"));
373     
374       entry.uri = std::move(uri);
375     
376       set_param_str(s, "REQUEST_METHOD", entry.op);
377     

** CID 1420329:  Security best practices violations  (DC.WEAK_CRYPTO)
/home/brad/working/src/ceph/src/osd/PGBackend.cc: 1043 in PGBackend::be_compare_scrubmaps(const std::map<pg_shard_t, ScrubMap *, std::less<pg_shard_t>, std::allocator<std::pair<const pg_shard_t, ScrubMap *>>> &, const std::set<hobject_t, std::less<hobject_t>, std::allocator<hobject_t>> &, bool, std::map<hobject_t, std::set<pg_shard_t, std::less<pg_shard_t>, std::allocator<pg_shard_t>>, std::less<hobject_t>, std::allocator<std::pair<const hobject_t, std::set<pg_shard_t, std::less<pg_shard_t>, std::allocator<pg_shard_t>>>>>&, std::map<hobject_t, std::set<pg_shard_t, std::less<pg_shard_t>, std::allocator<pg_shard_t>>, std::less<hobject_t>, std::allocator<std::pair<const hobject_t, std::set<pg_shard_t, std::less<pg_shard_t>, std::allocator<pg_shard_t>>>>>&, std::map<hobject_t, std::__cxx11::li
 st<pg_shard_t, std::allocator<pg_shard_t>>, std::less<hobject_t>, std::allocator<std::pair<const hobject_t, std::__cxx11::list<pg_shard_t, std::allocator<pg_shard_t>>>>>&, std::map<hobject_t
 , std::pair<boost::optional<unsigned int>, boost::optional<unsigned int>>, std::less<hobject_t>, std::allocator<std::pair<const hobject_t, std::pair<boost::optional<unsigned int>, boost::optional<unsigned int>>>>>&, int &, int &, Scrub::Store *, const spg_t &, const std::vector<int, std::allocator<int>> &, std::basic_ostream<char, std::char_traits<char>>&)()


________________________________________________________________________________________________________
*** CID 1420329:  Security best practices violations  (DC.WEAK_CRYPTO)
/home/brad/working/src/ceph/src/osd/PGBackend.cc: 1043 in PGBackend::be_compare_scrubmaps(const std::map<pg_shard_t, ScrubMap *, std::less<pg_shard_t>, std::allocator<std::pair<const pg_shard_t, ScrubMap *>>> &, const std::set<hobject_t, std::less<hobject_t>, std::allocator<hobject_t>> &, bool, std::map<hobject_t, std::set<pg_shard_t, std::less<pg_shard_t>, std::allocator<pg_shard_t>>, std::less<hobject_t>, std::allocator<std::pair<const hobject_t, std::set<pg_shard_t, std::less<pg_shard_t>, std::allocator<pg_shard_t>>>>>&, std::map<hobject_t, std::set<pg_shard_t, std::less<pg_shard_t>, std::allocator<pg_shard_t>>, std::less<hobject_t>, std::allocator<std::pair<const hobject_t, std::set<pg_shard_t, std::less<pg_shard_t>, std::allocator<pg_shard_t>>>>>&, std::map<hobject_t, std::__cxx11::li
 st<pg_shard_t, std::allocator<pg_shard_t>>, std::less<hobject_t>, std::allocator<std::pair<const hobject_t, std::__cxx11::list<pg_shard_t, std::allocator<pg_shard_t>>>>>&, std::map<hobject_t
 , std::pair<boost::optional<unsigned int>, boost::optional<unsigned int>>, std::less<hobject_t>, std::allocator<std::pair<const hobject_t, std::pair<boost::optional<unsigned int>, boost::optional<unsigned int>>>>>&, int &, int &, Scrub::Store *, const spg_t &, const std::vector<int, std::allocator<int>> &, std::basic_ostream<char, std::char_traits<char>>&)()
1037     	  (!auth_oi.is_data_digest() || !auth_oi.is_omap_digest())) {
1038     	dout(20) << __func__ << " missing digest on " << *k << dendl;
1039     	update = MAYBE;
1040           }
1041           if (auth_object.digest_present && auth_object.omap_digest_present &&
1042     	  cct->_conf->osd_debug_scrub_chance_rewrite_digest &&
>>>     CID 1420329:  Security best practices violations  (DC.WEAK_CRYPTO)
>>>     "rand" should not be used for security related applications, as linear congruential algorithms are too easy to break.
1043     	  (((unsigned)rand() % 100) >
1044     	   cct->_conf->osd_debug_scrub_chance_rewrite_digest)) {
1045     	dout(20) << __func__ << " randomly updating digest on " << *k << dendl;
1046     	update = MAYBE;
1047           }
1048     

** CID 1420330:  Resource leaks  (RESOURCE_LEAK)
/home/brad/working/src/ceph/src/zstd/lib/dictBuilder/zdict.c: 967 in ZDICT_trainFromBuffer_unsafe_legacy()


________________________________________________________________________________________________________
*** CID 1420330:  Resource leaks  (RESOURCE_LEAK)
/home/brad/working/src/ceph/src/zstd/lib/dictBuilder/zdict.c: 967 in ZDICT_trainFromBuffer_unsafe_legacy()
961             DISPLAYLEVEL(3, "list %u best segments \n", nb-1);
962             for (u=1; u<nb; u++) {
963                 U32 const pos = dictList[u].pos;
964                 U32 const length = dictList[u].length;
965                 U32 const printedLength = MIN(40, length);
966                 if ((pos > samplesBuffSize) || ((pos + length) > samplesBuffSize))
>>>     CID 1420330:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "dictList" going out of scope leaks the storage it points to.
967                     return ERROR(GENERIC);   /* should never happen */
968                 DISPLAYLEVEL(3, "%3u:%3u bytes at pos %8u, savings %7u bytes |",
969                              u, length, pos, dictList[u].savings);
970                 ZDICT_printHex((const char*)samplesBuffer+pos, printedLength);
971                 DISPLAYLEVEL(3, "| \n");
972         }   }

** CID 1420331:  Null pointer dereferences  (FORWARD_NULL)
/home/brad/working/src/ceph/src/test/librgw_file_marker.cc: 217 in LibRGW_MARKER1_SETUP_BUCKET_Test::TestBody()()


________________________________________________________________________________________________________
*** CID 1420331:  Null pointer dereferences  (FORWARD_NULL)
/home/brad/working/src/ceph/src/test/librgw_file_marker.cc: 217 in LibRGW_MARKER1_SETUP_BUCKET_Test::TestBody()()
211       st.st_uid = owner_uid;
212       st.st_gid = owner_gid;
213       st.st_mode = 755;
214     
215       (void) rgw_lookup(fs, fs->root_fh, bucket_name.c_str(), &bucket_fh,
216     		    RGW_LOOKUP_FLAG_NONE);
>>>     CID 1420331:  Null pointer dereferences  (FORWARD_NULL)
>>>     Comparing "<unnamed>::bucket_fh" to null implies that "<unnamed>::bucket_fh" might be null.
217       if (! bucket_fh) {
218         if (do_create) {
219           struct stat st;
220     
221           st.st_uid = owner_uid;
222           st.st_gid = owner_gid;

** CID 1420332:  Control flow issues  (DEADCODE)
/home/brad/working/src/ceph/src/zstd/lib/decompress/zstd_decompress.c: 1415 in ZSTD_decompressBlock_internal()


________________________________________________________________________________________________________
*** CID 1420332:  Control flow issues  (DEADCODE)
/home/brad/working/src/ceph/src/zstd/lib/decompress/zstd_decompress.c: 1415 in ZSTD_decompressBlock_internal()
1409         /* isLongOffset must be true if there are long offsets.
1410          * Offsets are long if they are larger than 2^STREAM_ACCUMULATOR_MIN.
1411          * We don't expect that to be the case in 64-bit mode.
1412          * If we are in block mode we don't know the window size, so we have to be
1413          * conservative.
1414          */
>>>     CID 1420332:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach the expression "57" inside this statement: "isLongOffset = (ZSTD_longOf...".
1415         ZSTD_longOffset_e const isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (!frame || dctx->fParams.windowSize > (1ULL << STREAM_ACCUMULATOR_MIN)));
1416         /* windowSize could be any value at this point, since it is only validated
1417          * in the streaming API.
1418          */
1419         DEBUGLOG(5, "ZSTD_decompressBlock_internal (size : %u)", (U32)srcSize);
1420     

** CID 1420333:  Error handling issues  (UNCAUGHT_EXCEPT)
/home/brad/working/src/ceph/src/test/librgw_file_marker.cc: 421 in main()


________________________________________________________________________________________________________
*** CID 1420333:  Error handling issues  (UNCAUGHT_EXCEPT)
/home/brad/working/src/ceph/src/test/librgw_file_marker.cc: 421 in main()
415     }
416     
417     TEST(LibRGW, SHUTDOWN) {
418       librgw_shutdown(rgw_h);
419     }
420     
>>>     CID 1420333:  Error handling issues  (UNCAUGHT_EXCEPT)
>>>     In function "main(int, char **)" an exception of type "testing::internal::GoogleTestFailureException" is thrown and never caught.
421     int main(int argc, char *argv[])
422     {
423       char *v{nullptr};
424       string val;
425       vector<const char*> args;
426     

** CID 1420334:  Control flow issues  (MISMATCHED_ITERATOR)
/home/brad/working/src/ceph/src/osd/PG.cc: 1166 in PG::calc_ec_acting(std::_Rb_tree_const_iterator<std::pair<const pg_shard_t, pg_info_t>>, unsigned int, const std::vector<int, std::allocator<int>> &, const std::vector<int, std::allocator<int>> &, const std::map<pg_shard_t, pg_info_t, std::less<pg_shard_t>, std::allocator<std::pair<const pg_shard_t, pg_info_t>>> &, bool, std::vector<int, std::allocator<int>> *, std::set<pg_shard_t, std::less<pg_shard_t>, std::allocator<pg_shard_t>> *, std::set<pg_shard_t, std::less<pg_shard_t>, std::allocator<pg_shard_t>> *, std::basic_ostream<char, std::char_traits<char>>&)()


________________________________________________________________________________________________________
*** CID 1420334:  Control flow issues  (MISMATCHED_ITERATOR)
/home/brad/working/src/ceph/src/osd/PG.cc: 1166 in PG::calc_ec_acting(std::_Rb_tree_const_iterator<std::pair<const pg_shard_t, pg_info_t>>, unsigned int, const std::vector<int, std::allocator<int>> &, const std::vector<int, std::allocator<int>> &, const std::map<pg_shard_t, pg_info_t, std::less<pg_shard_t>, std::allocator<std::pair<const pg_shard_t, pg_info_t>>> &, bool, std::vector<int, std::allocator<int>> *, std::set<pg_shard_t, std::less<pg_shard_t>, std::allocator<pg_shard_t>> *, std::set<pg_shard_t, std::less<pg_shard_t>, std::allocator<pg_shard_t>> *, std::basic_ostream<char, std::char_traits<char>>&)()
1160     	!all_info.find(pg_shard_t(acting[i], shard_id_t(i)))->second.is_incomplete() &&
1161     	all_info.find(pg_shard_t(acting[i], shard_id_t(i)))->second.last_update >=
1162     	auth_log_shard->second.log_tail) {
1163           ss << " selecting acting[i]: " << pg_shard_t(acting[i], shard_id_t(i)) << std::endl;
1164           want[i] = acting[i];
1165         } else if (!restrict_to_up_acting) {
>>>     CID 1420334:  Control flow issues  (MISMATCHED_ITERATOR)
>>>     Comparing "j" from "all_info_by_shard[shard_id_t(i)]" to "all_info_by_shard[shard_id_t(i)]->end()" from "all_info_by_shard[shard_id_t(i)]".
1166           for (set<pg_shard_t>::iterator j = all_info_by_shard[shard_id_t(i)].begin();
1167     	   j != all_info_by_shard[shard_id_t(i)].end();
1168     	   ++j) {
1169     	assert(j->shard == i);
1170     	if (!all_info.find(*j)->second.is_incomplete() &&
1171     	    all_info.find(*j)->second.last_update >=

** CID 1420335:  Code maintainability issues  (UNUSED_VALUE)
/home/brad/working/src/ceph/src/zstd/lib/compress/zstd_compress.c: 890 in ZSTD_resetCCtx_internal()


________________________________________________________________________________________________________
*** CID 1420335:  Code maintainability issues  (UNUSED_VALUE)
/home/brad/working/src/ceph/src/zstd/lib/compress/zstd_compress.c: 890 in ZSTD_resetCCtx_internal()
884     
885                     zc->workSpaceSize = 0;
886                     ZSTD_free(zc->workSpace, zc->customMem);
887                     zc->workSpace = ZSTD_malloc(neededSpace, zc->customMem);
888                     if (zc->workSpace == NULL) return ERROR(memory_allocation);
889                     zc->workSpaceSize = neededSpace;
>>>     CID 1420335:  Code maintainability issues  (UNUSED_VALUE)
>>>     Assigning value from "zc->workSpace" to "ptr" here, but that stored value is overwritten before it can be used.
890                     ptr = zc->workSpace;
891     
892                     /* entropy space */
893                     assert(((size_t)zc->workSpace & 3) == 0);   /* ensure correct alignment */
894                     assert(zc->workSpaceSize >= sizeof(ZSTD_entropyCTables_t));
895                     zc->entropy = (ZSTD_entropyCTables_t*)zc->workSpace;


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRaGCnxtQO9E3gxlB2GxVsWFENryh7bC5hIb-2FQBVM85YLQ-3D-3D_2sw0G7ICm9mxCh1lYW1t9y1lfDrIerWzLwB67LZ-2Bn8Gy1Hbdng86fSmZDL9jyxshdImPQ1FMiQYxMmP8DI4Txz7Y2fx1phrVnOJropkIhIZ1-2FOGbiEsEgwwF1m5W6-2FDacOyhDMwkSxAZVftCFlZGGJXh-2BWXbxHtDutzOkbJNSdaE5M9dCaR1Fc5eCxox2DOoXzpI7rcojbnoY0Eu-2FTfU2KzrHbUlx7lSPONYKptoonc-3D

To manage Coverity Scan email notifications for "ceph-devel@vger.kernel.org", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4Bco8jcmzhh7FSyvoR0E3-2BDgRcBCQ6OuthHBtaTCGNq9OVG2ZVnjrgThgf5hX3GVEkIxvBX-2BorwRZfOftSp7HPfCifRGGak1MlgNFVd3IIPA-3D_2sw0G7ICm9mxCh1lYW1t9y1lfDrIerWzLwB67LZ-2Bn8Gy1Hbdng86fSmZDL9jyxshdImPQ1FMiQYxMmP8DI4Tx0lIb1cj000l5U2W71KpZOKrvog3jBOKD-2FSLwGRctsQRAC7eSMh5NFUg-2FTNpEbiZravpq89wcQsrrQh6InKwQr5pSlemLwx2RVSzhYOKo2P69-2FhVs54jIEG1r-2F-2BUkyY8EY2pQJ7gaBYjABJsEpn55sg-3D


             reply	other threads:[~2017-10-27  0:31 UTC|newest]

Thread overview: 124+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-27  0:31 scan-admin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-08-20 12:22 New Defects reported by Coverity Scan for ceph scan-admin
2022-08-20 13:17 ` Jeff Layton
2022-08-22  3:54   ` Brad Hubbard
2022-08-23 12:52     ` Jeff Layton
2018-01-04  3:32 scan-admin
2017-12-28  1:57 scan-admin
2017-12-21  1:54 scan-admin
2017-12-21  3:34 ` Jos Collin
2017-12-21  4:03   ` Brad Hubbard
2017-12-14  6:49 scan-admin
2017-12-01  2:25 scan-admin
2017-11-23  0:19 scan-admin
2017-11-16 11:35 scan-admin
2017-11-09 11:36 scan-admin
2017-11-02  2:11 scan-admin
2017-10-19  3:54 scan-admin
2017-10-12  5:54 scan-admin
2017-10-05  5:08 scan-admin
2017-09-28  5:09 scan-admin
2017-09-21  6:44 scan-admin
2017-09-14  7:19 scan-admin
2017-09-07  5:08 scan-admin
2017-08-31  6:39 scan-admin
2017-08-24 23:32 scan-admin
2017-08-17  3:29 scan-admin
2017-08-10  3:50 scan-admin
2017-08-03  4:57 scan-admin
2017-07-27  3:50 scan-admin
2017-07-28 18:42 ` Gregory Farnum
2017-07-28 22:22   ` Brad Hubbard
2017-07-20  4:08 scan-admin
2017-07-13  5:11 scan-admin
2017-07-06  5:03 scan-admin
2017-06-29  4:08 scan-admin
2017-06-22  4:27 scan-admin
2017-06-15  9:50 scan-admin
2017-06-11 23:46 scan-admin
2017-06-01  4:33 scan-admin
2017-05-25  6:22 scan-admin
2017-05-18  1:44 scan-admin
2017-05-11  5:32 scan-admin
2017-05-04  2:45 scan-admin
2017-04-27  2:22 scan-admin
2017-04-20  5:34 scan-admin
2017-04-13  6:25 scan-admin
2017-04-06  9:40 scan-admin
2017-03-31  1:25 scan-admin
2017-03-23  7:58 scan-admin
2017-03-16  7:37 scan-admin
2017-03-09  6:12 scan-admin
2017-03-02  7:44 scan-admin
2017-02-23  9:09 scan-admin
2017-02-17  2:29 scan-admin
     [not found] ` <CAJE9aOMoxWjhq=g+25hfhMhxSCnHAOwAyNhXvkxS1wwBEd3j+A@mail.gmail.com>
2017-02-17  5:19   ` kefu chai
2017-02-05 10:08 scan-admin
2017-01-27 13:22 scan-admin
2017-01-17  3:01 scan-admin
2017-01-09 10:05 scan-admin
2016-12-30  8:33 scan-admin
2016-12-23  9:16 scan-admin
2016-12-16  8:54 scan-admin
2016-12-09 11:29 scan-admin
2016-12-02 11:08 scan-admin
2016-11-25  7:55 scan-admin
2016-03-19 17:58 scan-admin
2016-03-13 17:40 scan-admin
2016-03-12 18:04 scan-admin
2016-03-05 17:55 scan-admin
2016-03-07 20:59 ` Gregory Farnum
2016-02-27 18:07 scan-admin
2016-02-20 18:26 scan-admin
2016-02-18 20:32 scan-admin
2016-02-13 17:47 scan-admin
2016-02-11 17:57 scan-admin
2016-02-11 22:01 ` Gregory Farnum
2016-02-12 16:36   ` Adam C. Emerson
2016-02-04 20:39 scan-admin
2016-02-03 20:40 scan-admin
2015-05-02 14:37 scan-admin
2015-01-21  1:41 scan-admin
2015-01-16 14:39 scan-admin
2015-01-16 15:17 ` Gregory Farnum
2015-01-16 16:00   ` John Spray
2015-01-16 16:08   ` Sage Weil
     [not found] <54b528bef1f63_1b74f3532c63410@scan.coverity.com.mail>
2015-01-13 14:34 ` Sage Weil
2015-01-13 14:16 scan-admin
2015-01-10 14:36 scan-admin
2015-01-10 15:48 ` Haomai Wang
2015-01-09 14:30 scan-admin
2015-01-09 15:26 ` Sage Weil
2015-01-09 15:32   ` Danny Al-Gaaf
2015-01-04 14:14 scan-admin
2014-12-27 14:13 scan-admin
2014-12-28  6:03 ` Sage Weil
2014-12-26 14:19 scan-admin
2014-12-23 14:37 scan-admin
2014-12-21 14:13 scan-admin
2014-12-18 14:19 scan-admin
2014-12-14 14:17 scan-admin
2014-12-07 20:36 scan-admin
2014-12-05 14:11 scan-admin
2014-12-02 14:09 scan-admin
2014-11-25 14:09 scan-admin
2014-11-23 14:08 scan-admin
2014-11-20 14:20 scan-admin
2014-11-14 14:21 scan-admin
2014-11-13 14:21 scan-admin
2014-11-11 20:40 scan-admin
2014-11-09 14:12 scan-admin
2014-10-30 13:19 scan-admin
2014-10-30 16:08 ` Sage Weil
2014-10-28 13:16 scan-admin
2014-10-28 18:26 ` Danny Al-Gaaf
2014-10-26 13:17 scan-admin
2014-10-24 17:55 scan-admin
2014-10-24 17:59 ` Sage Weil
2014-10-17 13:27 scan-admin
2014-10-09 13:23 scan-admin
2014-10-02 13:21 scan-admin
2014-09-25 13:18 scan-admin
2014-09-16 21:40 scan-admin
2014-08-16 21:31 scan-admin
2014-08-09 15:30 scan-admin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59f27e49144fc_e3c40932c3534a@ss1435.mail \
    --to=scan-admin@coverity.com \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.