libdb-5.3.28-64.fc42

List of Findings

Error: COMPILER_WARNING (CWE-569): [#def1]
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_open.c: scope_hint: In function ‘__bt_open’
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_open.c:128:29: warning[-Wparentheses]: suggest parentheses around ‘-’ in operand of ‘&’
#  128 |                     b.psize & sizeof(indx_t) - 1))
#      |                             ^
#  126|   		if (b.psize &&
#  127|   		    (b.psize < MINPSIZE || b.psize > MAX_PAGE_OFFSET + 1 ||
#  128|-> 		    b.psize & sizeof(indx_t) - 1))
#  129|   			goto einval;
#  130|   

Error: COMPILER_WARNING (CWE-569): [#def2]
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_open.c:248:29: warning[-Wparentheses]: suggest parentheses around ‘-’ in operand of ‘&’
#  248 |                     m.psize & sizeof(indx_t) - 1)
#      |                             ^
#  246|   			goto eftype;
#  247|   		if (m.psize < MINPSIZE || m.psize > MAX_PAGE_OFFSET + 1 ||
#  248|-> 		    m.psize & sizeof(indx_t) - 1)
#  249|   			goto eftype;
#  250|   		if (m.flags & ~SAVEMETA)

Error: COMPILER_WARNING (CWE-569): [#def3]
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_open.c:281:50: warning[-Wparentheses]: suggest parentheses around ‘-’ in operand of ‘&’
#  281 |         if (b.cachesize && b.cachesize & b.psize - 1)
#      |                                          ~~~~~~~~^~~
#  279|   
#  280|   	/* Set the cache size; must be a multiple of the page size. */
#  281|-> 	if (b.cachesize && b.cachesize & b.psize - 1)
#  282|   		b.cachesize += (~b.cachesize & b.psize - 1) + 1;
#  283|   	if (b.cachesize < b.psize * MINCACHE)

Error: COMPILER_WARNING (CWE-569): [#def4]
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_open.c:282:56: warning[-Wparentheses]: suggest parentheses around ‘-’ in operand of ‘&’
#  282 |                 b.cachesize += (~b.cachesize & b.psize - 1) + 1;
#      |                                                ~~~~~~~~^~~
#  280|   	/* Set the cache size; must be a multiple of the page size. */
#  281|   	if (b.cachesize && b.cachesize & b.psize - 1)
#  282|-> 		b.cachesize += (~b.cachesize & b.psize - 1) + 1;
#  283|   	if (b.cachesize < b.psize * MINCACHE)
#  284|   		b.cachesize = b.psize * MINCACHE;

Error: COMPILER_WARNING (CWE-691): [#def5]
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_put.c: scope_hint: In function ‘__bt_put’
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_put.c:226:12: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’
#  226 |         if (t->bt_order == NOT)
#      |            ^
#  224|   		++t->bt_cursor.pg.index;
#  225|   
#  226|-> 	if (t->bt_order == NOT)
#  227|   		if (h->nextpg == P_INVALID) {
#  228|   			if (index == NEXTINDEX(h) - 1) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def6]
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_seq.c: scope_hint: In function ‘__bt_seqadv’
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_seq.c:323:19: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘index’
#  321|   
#  322|   	ep->page = h;
#  323|-> 	ep->index = index;
#  324|   	return (RET_SUCCESS);
#  325|   }

Error: COMPILER_WARNING (CWE-457): [#def7]
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_seq.c:323:19: warning[-Wmaybe-uninitialized]: ‘index’ may be used uninitialized
#  323 |         ep->index = index;
#      |         ~~~~~~~~~~^~~~~~~
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_seq.c: scope_hint: In function ‘__bt_seq’
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_seq.c:247:16: note: ‘index’ was declared here
#  247 |         indx_t index;
#      |                ^~~~~
#  321|   
#  322|   	ep->page = h;
#  323|-> 	ep->index = index;
#  324|   	return (RET_SUCCESS);
#  325|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def8]
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_seq.c: scope_hint: In function ‘__bt_first’
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_seq.c:394:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_seq.c:49: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_seq.c:363:21: note: in expansion of macro ‘F_ISSET’
#  392|   				if ((h = mpool_get(t->bt_mp,
#  393|   				    h->prevpg, 0)) == NULL) {
#  394|-> 					if (h->pgno == save.page->pgno)
#  395|   						mpool_put(t->bt_mp,
#  396|   						    save.page, 0);

Error: COMPILER_WARNING (CWE-457): [#def9]
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_split.c:245:60: warning[-Wmaybe-uninitialized]: ‘nksize’ may be used uninitialized
#  245 |                         WR_BINTERNAL(dest, nksize ? nksize : bl->ksize,
#      |                                            ~~~~~~~~~~~~~~~~^~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_split.c:97:30: note: ‘nksize’ was declared here
#   97 |         u_int32_t n, nbytes, nksize;
#      |                              ^~~~~~
#  243|   			h->linp[skip] = h->upper -= nbytes;
#  244|   			dest = (char *)h + h->linp[skip];
#  245|-> 			WR_BINTERNAL(dest, nksize ? nksize : bl->ksize,
#  246|   			    rchild->pgno, bl->flags & P_BIGKEY);
#  247|   			memmove(dest, bl->bytes, nksize ? nksize : bl->ksize);

Error: COMPILER_WARNING (CWE-457): [#def10]
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_split.c:49: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_split.c:246:45: warning[-Wmaybe-uninitialized]: ‘bl’ may be used uninitialized
#  246 |                             rchild->pgno, bl->flags & P_BIGKEY);
#      |                                           ~~^~~~~~~
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_split.c:91:16: note: ‘bl’ was declared here
#   91 |         BLEAF *bl, *tbl;
#      |                ^~
#  244|   			dest = (char *)h + h->linp[skip];
#  245|   			WR_BINTERNAL(dest, nksize ? nksize : bl->ksize,
#  246|-> 			    rchild->pgno, bl->flags & P_BIGKEY);
#  247|   			memmove(dest, bl->bytes, nksize ? nksize : bl->ksize);
#  248|   			if (bl->flags & P_BIGKEY &&

Error: COMPILER_WARNING (CWE-569): [#def11]
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_split.c: scope_hint: In function ‘bt_psplit’
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_split.c:676:33: warning[-Wparentheses]: suggest parentheses around ‘&&’ within ‘||’
#  676 |                 if (skip <= off &&
#      |                     ~~~~~~~~~~~~^~
#  677 |                     used + nbytes + sizeof(indx_t) >= full || nxt == top - 1) {
#      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  674|   		 * Make sure that doesn't happen.
#  675|   		 */
#  676|-> 		if (skip <= off &&
#  677|   		    used + nbytes + sizeof(indx_t) >= full || nxt == top - 1) {
#  678|   			--off;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def12]
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_split.c: scope_hint: In function ‘bt_psplit’
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_split.c:687:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘src’
#  685|   
#  686|   			l->linp[off] = l->upper -= nbytes;
#  687|-> 			memmove((char *)l + l->upper, src, nbytes);
#  688|   		}
#  689|   

Error: COMPILER_WARNING (CWE-457): [#def13]
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/btree.h:131:49: warning[-Wmaybe-uninitialized]: ‘index’ may be used uninitialized
#  131 |         ((BINTERNAL *)((char *)(pg) + (pg)->linp[indx]))
#      |                                       ~~~~~~~~~~^~~~~~
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_delete.c: scope_hint: In function ‘__bt_delete’
libdb-5.3.28-build/db-5.3.28/db.1.85/btree/bt_delete.c:153:16: note: ‘index’ was declared here
#  153 |         indx_t index;
#      |                ^~~~~
#  129|   /* Get the page's BINTERNAL structure at index indx. */
#  130|   #define	GETBINTERNAL(pg, indx)						\
#  131|-> 	((BINTERNAL *)((char *)(pg) + (pg)->linp[indx]))
#  132|   
#  133|   /* Get the number of bytes in the entry. */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def14]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash.c: scope_hint: In function ‘hash_seq’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash.c:777:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bp’
#  775|   			hashp->cndx = 1;
#  776|   		}
#  777|-> 		if (!bp[0]) {
#  778|   			hashp->cpage = NULL;
#  779|   			++hashp->cbucket;

Error: COMPILER_WARNING (CWE-569): [#def15]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash.c: scope_hint: In function ‘hash_realloc’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash.c:871:13: warning[-Wparentheses]: suggest parentheses around assignment used as truth value
#  871 |         if (p = malloc(newsize)) {
#      |             ^
#  869|   	register void *p;
#  870|   
#  871|-> 	if (p = malloc(newsize)) {
#  872|   		memmove(p, *p_ptr, oldsize);
#  873|   		memset((char *)p + oldsize, 0, newsize - oldsize);

Error: GCC_ANALYZER_WARNING (CWE-131): [#def16]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash.c: scope_hint: In function ‘hash_realloc’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash.c:875:24: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
#  873|   		memset((char *)p + oldsize, 0, newsize - oldsize);
#  874|   		free(*p_ptr);
#  875|-> 		*p_ptr = p;
#  876|   	}
#  877|   	return (p);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash.c: scope_hint: In function ‘alloc_segs’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash.c:925:23: warning[-Wanalyzer-malloc-leak]: leak of ‘store’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash.c:55: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash.c:919:45: note: in expansion of macro ‘SSHIFT’
#  923|   		return (-1);
#  924|   	}
#  925|-> 	for (i = 0; i < nsegs; i++, hashp->nsegs++)
#  926|   		hashp->dir[i] = &store[i << hashp->SSHIFT];
#  927|   	return (0);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def18]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c:71: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c: scope_hint: In function ‘overflow_page’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash.h:154:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘freep’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c:767:17: note: in expansion of macro ‘SETBIT’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c:725:33: note: in expansion of macro ‘BSIZE’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c:767:17: note: in expansion of macro ‘SETBIT’
#  152|   /* Given the address of the beginning of a big map, clear/set the nth bit */
#  153|   #define CLRBIT(A, N)	((A)[(N)/BITS_PER_MAP] &= ~(1<<((N)%BITS_PER_MAP)))
#  154|-> #define SETBIT(A, N)	((A)[(N)/BITS_PER_MAP] |= (1<<((N)%BITS_PER_MAP)))
#  155|   #define ISSET(A, N)	((A)[(N)/BITS_PER_MAP] & (1<<((N)%BITS_PER_MAP)))
#  156|   

Error: COMPILER_WARNING (CWE-457): [#def19]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash.h:154:29: warning[-Wmaybe-uninitialized]: ‘freep’ may be used uninitialized
#  154 | #define SETBIT(A, N)    ((A)[(N)/BITS_PER_MAP] |= (1<<((N)%BITS_PER_MAP)))
#      |                          ~~~^~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c: scope_hint: In function ‘__add_ovflpage’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c:668:29: note: ‘freep’ was declared here
#  668 |         register u_int32_t *freep;
#      |                             ^~~~~
#  152|   /* Given the address of the beginning of a big map, clear/set the nth bit */
#  153|   #define CLRBIT(A, N)	((A)[(N)/BITS_PER_MAP] &= ~(1<<((N)%BITS_PER_MAP)))
#  154|-> #define SETBIT(A, N)	((A)[(N)/BITS_PER_MAP] |= (1<<((N)%BITS_PER_MAP)))
#  155|   #define ISSET(A, N)	((A)[(N)/BITS_PER_MAP] & (1<<((N)%BITS_PER_MAP)))
#  156|   

Error: COMPILER_WARNING (CWE-691): [#def20]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_bigkey.c: scope_hint: In function ‘__big_insert’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_bigkey.c:124:20: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’
#  124 |                 if (!key_size)
#      |                    ^
#  122|   			return (-1);
#  123|   		n = p[0];
#  124|-> 		if (!key_size)
#  125|   			if (FREESPACE(p)) {
#  126|   				move_bytes = MIN(FREESPACE(p), val_size);

Error: COMPILER_WARNING (CWE-569): [#def21]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_bigkey.c: scope_hint: In function ‘__big_split’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_bigkey.c:593:13: warning[-Wparentheses]: suggest parentheses around assignment used as truth value
#  593 |         if (ret->next_addr = __find_last_page(hashp, &big_keyp)) {
#      |             ^~~
#  591|   	change = (__call_hash(hashp, key.data, key.size) != obucket);
#  592|   
#  593|-> 	if (ret->next_addr = __find_last_page(hashp, &big_keyp)) {
#  594|   		if (!(ret->nextp =
#  595|   		    __get_buf(hashp, ret->next_addr, big_keyp, 0)))

Error: COMPILER_WARNING (CWE-457): [#def22]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_buf.c: scope_hint: In function ‘__get_buf’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_buf.c:144:29: warning[-Wmaybe-uninitialized]: ‘segment_ndx’ may be used uninitialized
#  144 |                         segp[segment_ndx] =
#      |                             ^
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_buf.c:113:31: note: ‘segment_ndx’ was declared here
#  113 |         register int is_disk, segment_ndx;
#      |                               ^~~~~~~~~~~
#  142|   			return (NULL);
#  143|   		if (!prev_bp)
#  144|-> 			segp[segment_ndx] =
#  145|   			    (BUFHEAD *)((ptrdiff_t)bp | is_disk_mask);
#  146|   	} else {

Error: COMPILER_WARNING (CWE-457): [#def23]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_buf.c:144:29: warning[-Wmaybe-uninitialized]: ‘segp’ may be used uninitialized
#  144 |                         segp[segment_ndx] =
#      |                             ^
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_buf.c:114:17: note: ‘segp’ was declared here
#  114 |         SEGMENT segp;
#      |                 ^~~~
#  142|   			return (NULL);
#  143|   		if (!prev_bp)
#  144|-> 			segp[segment_ndx] =
#  145|   			    (BUFHEAD *)((ptrdiff_t)bp | is_disk_mask);
#  146|   	} else {

Error: COMPILER_WARNING (CWE-1164): [#def24]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_func.c:69:1: warning[-Wunused-function]: ‘hash1’ defined but not used
#   69 | hash1(keyarg, len)
#      | ^~~~~
#   67|   
#   68|   static u_int32_t
#   69|-> hash1(keyarg, len)
#   70|   	const void *keyarg;
#   71|   	register size_t len;

Error: COMPILER_WARNING (CWE-1164): [#def25]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_func.c:89:1: warning[-Wunused-function]: ‘hash2’ defined but not used
#   89 | hash2(keyarg, len)
#      | ^~~~~
#   87|   
#   88|   static u_int32_t
#   89|-> hash2(keyarg, len)
#   90|   	const void *keyarg;
#   91|   	size_t len;

Error: COMPILER_WARNING (CWE-1164): [#def26]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_func.c:118:1: warning[-Wunused-function]: ‘hash3’ defined but not used
#  118 | hash3(keyarg, len)
#      | ^~~~~
#  116|    */
#  117|   static u_int32_t
#  118|-> hash3(keyarg, len)
#  119|   	const void *keyarg;
#  120|   	register size_t len;

Error: GCC_ANALYZER_WARNING (CWE-131): [#def27]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c: scope_hint: In function ‘__ibitmap’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c:634:32: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
#  632|   	int clearbytes, clearints;
#  633|   
#  634|-> 	if ((ip = (u_int32_t *)malloc(hashp->BSIZE)) == NULL)
#  635|   		return (1);
#  636|   	hashp->nmaps++;

Error: COMPILER_WARNING (CWE-252): [#def28]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c: scope_hint: In function ‘overflow_page’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c:715:31: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  715 |                         (void)write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1);
#      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  713|   	if (offset > SPLITMASK) {
#  714|   		if (++splitnum >= NCACHED) {
#  715|-> 			(void)write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1);
#  716|   			return (0);
#  717|   		}

Error: COMPILER_WARNING (CWE-252): [#def29]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c:728:31: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  728 |                         (void)write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1);
#      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  726|   		free_page++;
#  727|   		if (free_page >= NCACHED) {
#  728|-> 			(void)write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1);
#  729|   			return (0);
#  730|   		}

Error: COMPILER_WARNING (CWE-252): [#def30]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c:752:39: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  752 |                                 (void)write(STDERR_FILENO, OVMSG,
#      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  753 |                                     sizeof(OVMSG) - 1);
#      |                                     ~~~~~~~~~~~~~~~~~~
#  750|   		if (offset > SPLITMASK) {
#  751|   			if (++splitnum >= NCACHED) {
#  752|-> 				(void)write(STDERR_FILENO, OVMSG,
#  753|   				    sizeof(OVMSG) - 1);
#  754|   				return (0);

Error: GCC_ANALYZER_WARNING (CWE-131): [#def31]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c: scope_hint: In function ‘fetch_bitmap’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c:914:31: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hash_page.c:914:60: note: in expansion of macro ‘BSIZE’
#  912|   	if (ndx >= hashp->nmaps)
#  913|   		return (NULL);
#  914|-> 	if ((hashp->mapp[ndx] = (u_int32_t *)malloc(hashp->BSIZE)) == NULL)
#  915|   		return (NULL);
#  916|   	if (__get_page(hashp,

Error: COMPILER_WARNING (CWE-704): [#def32]
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hsearch.c: scope_hint: In function ‘hcreate’
libdb-5.3.28-build/db-5.3.28/db.1.85/hash/hsearch.c:65:17: warning[-Wpointer-to-int-cast]: cast from pointer to integer of different size
#   65 |         return ((int)dbp);
#      |                 ^
#   63|   	info.lorder = 0;
#   64|   	dbp = (DB *)__hash_open(NULL, O_CREAT | O_RDWR, 0600, &info, 0);
#   65|-> 	return ((int)dbp);
#   66|   }
#   67|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
libdb-5.3.28-build/db-5.3.28/db.1.85/mpool/mpool.c: scope_hint: In function ‘mpool_get’
libdb-5.3.28-build/db-5.3.28/db.1.85/mpool/mpool.c:315:15: warning[-Wanalyzer-malloc-leak]: leak of ‘mpool_bkt(mp)’
libdb-5.3.28-build/db-5.3.28/db.1.85/mpool/mpool.c:402:25: note: in expansion of macro ‘HASHKEY’
libdb-5.3.28-build/db-5.3.28/db.1.85/mpool/mpool.c: scope_hint: In function ‘mpool_get’
#  313|   
#  314|   	/* If under the max cached, always create a new page. */
#  315|-> 	if (mp->curcache < mp->maxcache)
#  316|   		goto new;
#  317|   

Error: COMPILER_WARNING (CWE-691): [#def34]
libdb-5.3.28-build/db-5.3.28/db.1.85/recno/rec_close.c: scope_hint: In function ‘__rec_close’
libdb-5.3.28-build/db-5.3.28/db.1.85/recno/rec_close.c:82:12: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’
#   82 |         if (!F_ISSET(t, R_INMEM))
#      |            ^
#   80|   		status = RET_ERROR;
#   81|   
#   82|-> 	if (!F_ISSET(t, R_INMEM))
#   83|   		if (F_ISSET(t, R_CLOSEFP)) {
#   84|   			if (fclose(t->bt_rfp))

Error: COMPILER_WARNING (CWE-457): [#def35]
libdb-5.3.28-build/db-5.3.28/db.1.85/recno/rec_open.c: scope_hint: In function ‘__rec_open’
libdb-5.3.28-build/db-5.3.28/db.1.85/recno/rec_open.c:123:21: warning[-Wmaybe-uninitialized]: ‘rfd’ may be used uninitialized
#  123 |                 if (lseek(rfd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE) {
#      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/db.1.85/recno/rec_open.c:66:13: note: ‘rfd’ was declared here
#   66 |         int rfd, sverrno;
#      |             ^~~
#  121|   		 */
#  122|   		errno = 0;
#  123|-> 		if (lseek(rfd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE) {
#  124|   			switch (flags & O_ACCMODE) {
#  125|   			case O_RDONLY:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
libdb-5.3.28-build/db-5.3.28/db.1.85/recno/rec_put.c: scope_hint: In function ‘__rec_put’
libdb-5.3.28-build/db-5.3.28/db.1.85/recno/rec_put.c:94:28: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
#   92|   			    malloc(t->bt_reclen) :
#   93|   			    realloc(t->bt_rdata.data, t->bt_reclen);
#   94|-> 			if (t->bt_rdata.data == NULL)
#   95|   				return (RET_ERROR);
#   96|   			t->bt_rdata.size = t->bt_reclen;

Error: COMPILER_WARNING (CWE-563): [#def37]
libdb-5.3.28-build/db-5.3.28/db.1.85/recno/rec_seq.c:35:13: warning[-Wunused-variable]: ‘sccsid’ defined but not used
#   35 | static char sccsid[] = "@(#)rec_seq.c   8.3 (Berkeley) 7/14/94";
#      |             ^~~~~~
#   33|   
#   34|   #ifndef lint
#   35|-> static char sccsid[] = "@(#)rec_seq.c	8.3 (Berkeley) 7/14/94";
#   36|   #endif /* not lint */
#   37|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def38]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/pager.h:7: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/sqliteInt.h:650: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c: scope_hint: In function ‘btreeCopyPages’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1932:64: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘in’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:952:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:934:25: note: in expansion of macro ‘DB_MULTIPLE_INIT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:936:25: note: in expansion of macro ‘DB_MULTIPLE_KEY_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:936:25: note: in expansion of macro ‘DB_MULTIPLE_KEY_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:952:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:952:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:952:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:952:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:988:33: note: in expansion of macro ‘DB_MULTIPLE_KEY_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:988:33: note: in expansion of macro ‘DB_MULTIPLE_KEY_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:952:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:952:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:952:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:952:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
# 1930|   		u_int32_t *__p = (u_int32_t *)(pointer);		\
# 1931|   		u_int32_t __off = ((pointer) == (u_int8_t *)(dbt)->data +\
# 1932|-> 		    (dbt)->ulen - sizeof(u_int32_t)) ?  0 : __p[1] + __p[2];\
# 1933|   		if ((u_int8_t *)(dbt)->data + __off + (writeklen) +	\
# 1934|   		    (writedlen) > (u_int8_t *)(__p - 4)) {		\

Error: GCC_ANALYZER_WARNING (CWE-126): [#def39]
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1932:64: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:934:25: note: in expansion of macro ‘DB_MULTIPLE_INIT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:936:25: note: in expansion of macro ‘DB_MULTIPLE_KEY_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:936:25: note: in expansion of macro ‘DB_MULTIPLE_KEY_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1932:64: note: read of 4 bytes from after the end of ‘bufIn’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1932:64: note: valid subscripts for ‘bufIn’ are ‘[0]’ to ‘[32767]’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
# 1930|   		u_int32_t *__p = (u_int32_t *)(pointer);		\
# 1931|   		u_int32_t __off = ((pointer) == (u_int8_t *)(dbt)->data +\
# 1932|-> 		    (dbt)->ulen - sizeof(u_int32_t)) ?  0 : __p[1] + __p[2];\
# 1933|   		if ((u_int8_t *)(dbt)->data + __off + (writeklen) +	\
# 1934|   		    (writedlen) > (u_int8_t *)(__p - 4)) {		\

Error: GCC_ANALYZER_WARNING (CWE-126): [#def40]
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1932:73: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:934:25: note: in expansion of macro ‘DB_MULTIPLE_INIT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:936:25: note: in expansion of macro ‘DB_MULTIPLE_KEY_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:936:25: note: in expansion of macro ‘DB_MULTIPLE_KEY_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1932:73: note: read of 4 bytes from after the end of ‘bufIn’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1932:73: note: valid subscripts for ‘bufIn’ are ‘[0]’ to ‘[32767]’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
# 1930|   		u_int32_t *__p = (u_int32_t *)(pointer);		\
# 1931|   		u_int32_t __off = ((pointer) == (u_int8_t *)(dbt)->data +\
# 1932|-> 		    (dbt)->ulen - sizeof(u_int32_t)) ?  0 : __p[1] + __p[2];\
# 1933|   		if ((u_int8_t *)(dbt)->data + __off + (writeklen) +	\
# 1934|   		    (writedlen) > (u_int8_t *)(__p - 4)) {		\

Error: GCC_ANALYZER_WARNING (CWE-476): [#def41]
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1939:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘in’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:934:25: note: in expansion of macro ‘DB_MULTIPLE_INIT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:936:25: note: in expansion of macro ‘DB_MULTIPLE_KEY_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:936:25: note: in expansion of macro ‘DB_MULTIPLE_KEY_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:988:33: note: in expansion of macro ‘DB_MULTIPLE_KEY_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:988:33: note: in expansion of macro ‘DB_MULTIPLE_KEY_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db.h:1954:17: note: in expansion of macro ‘DB_MULTIPLE_KEY_RESERVE_NEXT’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:977:49: note: in expansion of macro ‘DB_MULTIPLE_KEY_WRITE_NEXT’
# 1937|   		} else {						\
# 1938|   			writekey = (u_int8_t *)(dbt)->data + __off;	\
# 1939|-> 			__p[0] = __off;					\
# 1940|   			__p[-1] = (u_int32_t)(writeklen);		\
# 1941|   			__p -= 2;					\

Error: GCC_ANALYZER_WARNING (CWE-476): [#def42]
libdb-5.3.28-build/db-5.3.28/src/os/os_unlink.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/os/os_unlink.c: scope_hint: In function '__os_unlink'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:263:37: warning[-Wanalyzer-null-dereference]: dereference of NULL '*env.dbenv'
libdb-5.3.28-build/db-5.3.28/src/dbinc/region.h:326:14: note: in expansion of macro 'F_ISSET'
libdb-5.3.28-build/db-5.3.28/src/dbinc/region.h:329:13: note: in expansion of macro 'PANIC_ISSET'
libdb-5.3.28-build/db-5.3.28/src/dbinc/os.h:106:9: note: in expansion of macro 'PANIC_CHECK'
libdb-5.3.28-build/db-5.3.28/src/os/os_unlink.c:39:9: note: in expansion of macro 'LAST_PANIC_CHECK_BEFORE_IO'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:1111: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/dbinc/os.h:106:9: note: in expansion of macro 'PANIC_CHECK'
libdb-5.3.28-build/db-5.3.28/src/os/os_unlink.c:39:9: note: in expansion of macro 'LAST_PANIC_CHECK_BEFORE_IO'
libdb-5.3.28-build/db-5.3.28/src/dbinc/os.h:106:9: note: in expansion of macro 'PANIC_CHECK'
libdb-5.3.28-build/db-5.3.28/src/os/os_unlink.c:39:9: note: in expansion of macro 'LAST_PANIC_CHECK_BEFORE_IO'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:263:35: note: in definition of macro 'F_ISSET'
libdb-5.3.28-build/db-5.3.28/src/dbinc/region.h:329:13: note: in expansion of macro 'PANIC_ISSET'
libdb-5.3.28-build/db-5.3.28/src/dbinc/os.h:106:9: note: in expansion of macro 'PANIC_CHECK'
libdb-5.3.28-build/db-5.3.28/src/os/os_unlink.c:39:9: note: in expansion of macro 'LAST_PANIC_CHECK_BEFORE_IO'
libdb-5.3.28-build/db-5.3.28/src/dbinc/region.h:326:14: note: in expansion of macro 'F_ISSET'
libdb-5.3.28-build/db-5.3.28/src/dbinc/region.h:329:13: note: in expansion of macro 'PANIC_ISSET'
libdb-5.3.28-build/db-5.3.28/src/dbinc/os.h:106:9: note: in expansion of macro 'PANIC_CHECK'
libdb-5.3.28-build/db-5.3.28/src/os/os_unlink.c:39:9: note: in expansion of macro 'LAST_PANIC_CHECK_BEFORE_IO'
#  261|   #define	FLD_SET(fld, f)		(fld) |= (f)
#  262|   #define	F_CLR(p, f)		(p)->flags &= ~(f)
#  263|-> #define	F_ISSET(p, f)		((p)->flags & (f))
#  264|   #define	F_SET(p, f)		(p)->flags |= (f)
#  265|   #define	F2_CLR(p, f)		((p)->flags2 &= ~(f))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def43]
libdb-5.3.28-build/db-5.3.28/src/env/env_open.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/env/env_open.c: scope_hint: In function '__env_close_pp'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:619:26: warning[-Wanalyzer-null-dereference]: dereference of NULL 'env'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:629:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/env/env_open.c:559:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/src/env/env_open.c:559:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/src/env/env_open.c:559:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:629:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/env/env_open.c:559:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:629:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/env/env_open.c:559:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:629:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/env/env_open.c:559:9: note: in expansion of macro 'ENV_ENTER'
#  617|   	PANIC_CHECK_RET(env, ret);					\
#  618|    	if (ret == 0) {							\
#  619|-> 		if ((env)->thr_hashtab == NULL)				\
#  620|   			ip = NULL;					\
#  621|   		else 							\

Error: GCC_ANALYZER_WARNING (CWE-476): [#def44]
libdb-5.3.28-build/db-5.3.28/src/os/os_rw.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/os/os_rw.c: scope_hint: In function '__os_physwrite'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:741:17: warning[-Wanalyzer-null-dereference]: dereference of NULL 'env'
libdb-5.3.28-build/db-5.3.28/src/os/os_rw.c:268:25: note: in expansion of macro 'DB_EVENT'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:1108: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/os/os_rw.c:258:13: note: in expansion of macro 'DB_GLOBAL'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:1111: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/dbinc/os.h:106:9: note: in expansion of macro 'PANIC_CHECK'
libdb-5.3.28-build/db-5.3.28/src/os/os_rw.c:260:17: note: in expansion of macro 'LAST_PANIC_CHECK_BEFORE_IO'
libdb-5.3.28-build/db-5.3.28/src/os/os_rw.c:261:21: note: in expansion of macro 'DB_GLOBAL'
libdb-5.3.28-build/db-5.3.28/src/os/os_rw.c:268:25: note: in expansion of macro 'DB_EVENT'
#  739|   
#  740|   #define	DB_EVENT(env, e, einfo) do {					\
#  741|-> 	DB_ENV *__dbenv = (env)->dbenv;					\
#  742|   	if (__dbenv->db_event_func != NULL)				\
#  743|   		__dbenv->db_event_func(__dbenv, e, einfo);		\

Error: GCC_ANALYZER_WARNING (CWE-457): [#def45]
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c: scope_hint: In function '__rep_check_applied'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:1051:32: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'hist2.lsn.file'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c:2837:21: note: in expansion of macro 'LOG_COMPARE'
libdb-5.3.28-build/db-5.3.28/src/dbinc/mutex.h:208:14: note: in definition of macro 'MUTEX_LOCK'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c:2900:9: note: in expansion of macro 'REP_SYSTEM_LOCK'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c:2837:21: note: in expansion of macro 'LOG_COMPARE'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c:2837:21: note: in expansion of macro 'LOG_COMPARE'
# 1049|   
# 1050|   #define	LOG_COMPARE(lsn0, lsn1)						\
# 1051|-> 	((lsn0)->file != (lsn1)->file ?					\
# 1052|   	((lsn0)->file < (lsn1)->file ? -1 : 1) :			\
# 1053|   	((lsn0)->offset != (lsn1)->offset ?				\

Error: COMPILER_WARNING (CWE-563): [#def46]
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/sql/parse.c: scope_hint: In function 'sqlite3Parser'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/sql/parse.c:3709:7: warning[-Wunused-but-set-variable]: variable 'yyendofinput' set but not used
# 3709 |   int yyendofinput;     /* True if we are at the end of input */
#      |       ^~~~~~~~~~~~
# 3707|     YYMINORTYPE yyminorunion;
# 3708|     int yyact;            /* The parser action. */
# 3709|->   int yyendofinput;     /* True if we are at the end of input */
# 3710|   #ifdef YYERRORSYMBOL
# 3711|     int yyerrorhit = 0;   /* True if yymajor has invoked an error */

Error: COMPILER_WARNING (CWE-563): [#def47]
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/sql/parse.c: scope_hint: In function ‘sqlite3Parser’
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/sql/parse.c:3709:7: warning[-Wunused-but-set-variable]: variable ‘yyendofinput’ set but not used
# 3709 |   int yyendofinput;     /* True if we are at the end of input */
#      |       ^~~~~~~~~~~~
# 3707|     YYMINORTYPE yyminorunion;
# 3708|     int yyact;            /* The parser action. */
# 3709|->   int yyendofinput;     /* True if we are at the end of input */
# 3710|   #ifdef YYERRORSYMBOL
# 3711|     int yyerrorhit = 0;   /* True if yymajor has invoked an error */

Error: COMPILER_WARNING: [#def48]
libdb-5.3.28-build/db-5.3.28/lang/db185/db185.c: scope_hint: At top level
libdb-5.3.28-build/db-5.3.28/lang/db185/db185.c:14:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   14 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   12|   
#   13|   #ifndef lint
#   14|-> static const char copyright[] =
#   15|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   16|   #endif

Error: COMPILER_WARNING (CWE-1023): [#def49]
libdb-5.3.28-build/db-5.3.28/lang/db185/db185.c: scope_hint: In function '__db185_open'
libdb-5.3.28-build/db-5.3.28/lang/db185/db185.c:71:9: warning[-Wswitch]: case value '0' not in enumerated type 'DBTYPE'
#   71 |         case 0:                                 /* DB_BTREE */
#      |         ^~~~
#   69|   	 */
#   70|   	switch (type) {
#   71|-> 	case 0:					/* DB_BTREE */
#   72|   		type = DB_BTREE;
#   73|   		if ((bi = openinfo) != NULL) {

Error: COMPILER_WARNING (CWE-563): [#def50]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c: scope_hint: In function 'sqlite3_backup_init'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:148:13: warning[-Wunused-but-set-variable]: variable 'ret' set but not used
#  148 |         int ret;
#      |             ^~~
#  146|   	Parse parse;
#  147|   	DB_ENV *dbenv;
#  148|-> 	int ret;
#  149|   
#  150|   	p = NULL;

Error: COMPILER_WARNING (CWE-563): [#def51]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c: scope_hint: In function ‘sqlite3_backup_init’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:148:13: warning[-Wunused-but-set-variable]: variable ‘ret’ set but not used
#  148 |         int ret;
#      |             ^~~
#  146|   	Parse parse;
#  147|   	DB_ENV *dbenv;
#  148|-> 	int ret;
#  149|   
#  150|   	p = NULL;

Error: COMPILER_WARNING: [#def52]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c: scope_hint: In function 'sqlite3_backup_init'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:194:9: warning[-Wstringop-truncation]: 'strncpy' specified bound depends on the length of the source argument
#  194 |         strncpy(p->srcName, zSrcDb, strlen(zSrcDb) + 1);
#      |         ^
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:194:37: note: length computed here
#  194 |         strncpy(p->srcName, zSrcDb, strlen(zSrcDb) + 1);
#      |                                     ^~~~~~~~~~~~~~
#  192|   		goto err;
#  193|   	}
#  194|-> 	strncpy(p->srcName, zSrcDb, strlen(zSrcDb) + 1);
#  195|   	strncpy(p->destName, zDestDb, strlen(zDestDb) + 1);
#  196|   

Error: COMPILER_WARNING: [#def53]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c: scope_hint: In function ‘sqlite3_backup_init’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:194:9: warning[-Wstringop-truncation]: ‘strncpy’ specified bound depends on the length of the source argument
#  194 |         strncpy(p->srcName, zSrcDb, strlen(zSrcDb) + 1);
#      |         ^
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:194:37: note: length computed here
#  194 |         strncpy(p->srcName, zSrcDb, strlen(zSrcDb) + 1);
#      |                                     ^~~~~~~~~~~~~~
#  192|   		goto err;
#  193|   	}
#  194|-> 	strncpy(p->srcName, zSrcDb, strlen(zSrcDb) + 1);
#  195|   	strncpy(p->destName, zDestDb, strlen(zDestDb) + 1);
#  196|   

Error: COMPILER_WARNING: [#def54]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:195:9: warning[-Wstringop-truncation]: 'strncpy' specified bound depends on the length of the source argument
#  195 |         strncpy(p->destName, zDestDb, strlen(zDestDb) + 1);
#      |         ^
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:195:39: note: length computed here
#  195 |         strncpy(p->destName, zDestDb, strlen(zDestDb) + 1);
#      |                                       ^~~~~~~~~~~~~~~
#  193|   	}
#  194|   	strncpy(p->srcName, zSrcDb, strlen(zSrcDb) + 1);
#  195|-> 	strncpy(p->destName, zDestDb, strlen(zDestDb) + 1);
#  196|   
#  197|   	if (p->pDest->pBt->full_name) {

Error: COMPILER_WARNING: [#def55]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:195:9: warning[-Wstringop-truncation]: ‘strncpy’ specified bound depends on the length of the source argument
#  195 |         strncpy(p->destName, zDestDb, strlen(zDestDb) + 1);
#      |         ^
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:195:39: note: length computed here
#  195 |         strncpy(p->destName, zDestDb, strlen(zDestDb) + 1);
#      |                                       ^~~~~~~~~~~~~~~
#  193|   	}
#  194|   	strncpy(p->srcName, zSrcDb, strlen(zSrcDb) + 1);
#  195|-> 	strncpy(p->destName, zDestDb, strlen(zDestDb) + 1);
#  196|   
#  197|   	if (p->pDest->pBt->full_name) {

Error: COMPILER_WARNING: [#def56]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:204:17: warning[-Wstringop-truncation]: 'strncpy' specified bound depends on the length of the source argument
#  204 |                 strncpy(p->fullName, fullName, strlen(fullName) + 1);
#      |                 ^
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:204:48: note: length computed here
#  204 |                 strncpy(p->fullName, fullName, strlen(fullName) + 1);
#      |                                                ^~~~~~~~~~~~~~~~
#  202|   			goto err;
#  203|   		}
#  204|-> 		strncpy(p->fullName, fullName, strlen(fullName) + 1);
#  205|   	}
#  206|   

Error: COMPILER_WARNING: [#def57]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:204:17: warning[-Wstringop-truncation]: ‘strncpy’ specified bound depends on the length of the source argument
#  204 |                 strncpy(p->fullName, fullName, strlen(fullName) + 1);
#      |                 ^
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:204:48: note: length computed here
#  204 |                 strncpy(p->fullName, fullName, strlen(fullName) + 1);
#      |                                                ^~~~~~~~~~~~~~~~
#  202|   			goto err;
#  203|   		}
#  204|-> 		strncpy(p->fullName, fullName, strlen(fullName) + 1);
#  205|   	}
#  206|   

Error: COMPILER_WARNING (CWE-563): [#def58]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c: scope_hint: In function 'btreeDeleteEnvironment'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:323:27: warning[-Wunused-but-set-variable]: variable 'storage' set but not used
#  323 |         int rc, ret, iDb, storage;
#      |                           ^~~~~~~
#  321|   {
#  322|   	BtShared *pBt;
#  323|-> 	int rc, ret, iDb, storage;
#  324|   	sqlite3 *db;
#  325|   	DB_ENV *tmp_env;

Error: COMPILER_WARNING (CWE-563): [#def59]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c: scope_hint: In function ‘btreeDeleteEnvironment’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:323:27: warning[-Wunused-but-set-variable]: variable ‘storage’ set but not used
#  323 |         int rc, ret, iDb, storage;
#      |                           ^~~~~~~
#  321|   {
#  322|   	BtShared *pBt;
#  323|-> 	int rc, ret, iDb, storage;
#  324|   	sqlite3 *db;
#  325|   	DB_ENV *tmp_env;

Error: COMPILER_WARNING (CWE-563): [#def60]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c: scope_hint: In function 'sqlite3_backup_step'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:565:19: warning[-Wunused-but-set-variable]: variable 'pBtDest' set but not used
#  565 |         BtShared *pBtDest, *pBtSrc;
#      |                   ^~~~~~~
#  563|   	Parse parse;
#  564|   	DB_ENV *dbenv;
#  565|-> 	BtShared *pBtDest, *pBtSrc;
#  566|   
#  567|   	pBtDest = pBtSrc = NULL;

Error: COMPILER_WARNING (CWE-563): [#def61]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c: scope_hint: In function ‘sqlite3_backup_step’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/backup.c:565:19: warning[-Wunused-but-set-variable]: variable ‘pBtDest’ set but not used
#  565 |         BtShared *pBtDest, *pBtSrc;
#      |                   ^~~~~~~
#  563|   	Parse parse;
#  564|   	DB_ENV *dbenv;
#  565|-> 	BtShared *pBtDest, *pBtSrc;
#  566|   
#  567|   	pBtDest = pBtSrc = NULL;

Error: COMPILER_WARNING (CWE-457): [#def62]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function 'btreeUpdateBtShared'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:1501:17: warning[-Wmaybe-uninitialized]: 'mutexOpen' may be used uninitialized
# 1501 |                 sqlite3_mutex_leave(mutexOpen);
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:1440:24: note: 'mutexOpen' was declared here
# 1440 |         sqlite3_mutex *mutexOpen;
#      |                        ^~~~~~~~~
# 1499|   	}
# 1500|   	if (needLock)
# 1501|-> 		sqlite3_mutex_leave(mutexOpen);
# 1502|   
# 1503|   #ifdef BDBSQL_FILE_PER_TABLE

Error: COMPILER_WARNING (CWE-457): [#def63]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function ‘btreeUpdateBtShared’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:1501:17: warning[-Wmaybe-uninitialized]: ‘mutexOpen’ may be used uninitialized
# 1501 |                 sqlite3_mutex_leave(mutexOpen);
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:1440:24: note: ‘mutexOpen’ was declared here
# 1440 |         sqlite3_mutex *mutexOpen;
#      |                        ^~~~~~~~~
# 1499|   	}
# 1500|   	if (needLock)
# 1501|-> 		sqlite3_mutex_leave(mutexOpen);
# 1502|   
# 1503|   #ifdef BDBSQL_FILE_PER_TABLE

Error: COMPILER_WARNING (CWE-563): [#def64]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function 'btreeOpenEnvironment'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:1597:20: warning[-Wunused-but-set-variable]: variable 'cached_db' set but not used
# 1597 |         CACHED_DB *cached_db;
#      |                    ^~~~~~~~~
# 1595|   	BtShared *pBt;
# 1596|   	sqlite3 *db;
# 1597|-> 	CACHED_DB *cached_db;
# 1598|   	int creating, iTable, newEnv, rc, ret, reuse_env, writeLock;
# 1599|   	sqlite3_mutex *mutexOpen;

Error: COMPILER_WARNING (CWE-563): [#def65]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function ‘btreeOpenEnvironment’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:1597:20: warning[-Wunused-but-set-variable]: variable ‘cached_db’ set but not used
# 1597 |         CACHED_DB *cached_db;
#      |                    ^~~~~~~~~
# 1595|   	BtShared *pBt;
# 1596|   	sqlite3 *db;
# 1597|-> 	CACHED_DB *cached_db;
# 1598|   	int creating, iTable, newEnv, rc, ret, reuse_env, writeLock;
# 1599|   	sqlite3_mutex *mutexOpen;

Error: COMPILER_WARNING (CWE-563): [#def66]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function 'sqlite3BtreeCommit'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:3052:19: warning[-Wunused-but-set-variable]: variable 'pBt' set but not used
# 3052 |         BtShared *pBt;
#      |                   ^~~
# 3050|   int sqlite3BtreeCommit(Btree *p)
# 3051|   {
# 3052|-> 	BtShared *pBt;
# 3053|   	int rc;
# 3054|   

Error: COMPILER_WARNING (CWE-563): [#def67]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function ‘sqlite3BtreeCommit’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:3052:19: warning[-Wunused-but-set-variable]: variable ‘pBt’ set but not used
# 3052 |         BtShared *pBt;
#      |                   ^~~
# 3050|   int sqlite3BtreeCommit(Btree *p)
# 3051|   {
# 3052|-> 	BtShared *pBt;
# 3053|   	int rc;
# 3054|   

Error: CPPCHECK_WARNING (CWE-457): [#def68]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:3352: warning[uninitvar]: Uninitialized variable: *ppCachedDb
# 3350|   	rc = SQLITE_OK;
# 3351|   	ret = 0;
# 3352|-> 	cached_db = *ppCachedDb;
# 3353|   	create_db = NULL;
# 3354|   

Error: COMPILER_WARNING (CWE-563): [#def69]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function 'btreeRestoreCursorPosition'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:4240:19: warning[-Wunused-but-set-variable]: variable 'pBt' set but not used
# 4240 |         BtShared *pBt;
#      |                   ^~~
# 4238|   {
# 4239|   	Btree *p;
# 4240|-> 	BtShared *pBt;
# 4241|   	void *keyCopy;
# 4242|   	int rc, ret, size;

Error: COMPILER_WARNING (CWE-563): [#def70]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function ‘btreeRestoreCursorPosition’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:4240:19: warning[-Wunused-but-set-variable]: variable ‘pBt’ set but not used
# 4240 |         BtShared *pBt;
#      |                   ^~~
# 4238|   {
# 4239|   	Btree *p;
# 4240|-> 	BtShared *pBt;
# 4241|   	void *keyCopy;
# 4242|   	int rc, ret, size;

Error: CPPCHECK_WARNING (CWE-476): [#def71]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:5394: warning[nullPointer]: Possible null pointer dereference: oldTableName
# 5392|   		memset(&key, 0, sizeof(key));
# 5393|   		key.data = oldTableName;
# 5394|-> 		key.size = (u_int32_t)strlen(oldTableName);
# 5395|   		key.flags = DB_DBT_USERMEM;
# 5396|   		/* If the renamed table already exists, we could be in one of

Error: COMPILER_WARNING (CWE-563): [#def72]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function 'sqlite3BtreeCheckpoint'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:5739:19: warning[-Wunused-but-set-variable]: variable 'pBt' set but not used
# 5739 |         BtShared *pBt;
#      |                   ^~~
# 5737|   int sqlite3BtreeCheckpoint(Btree *p, int eMode, int *pnLog, int *pnCkpt)
# 5738|   {
# 5739|-> 	BtShared *pBt;
# 5740|   	int rc;
# 5741|   

Error: COMPILER_WARNING (CWE-563): [#def73]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function ‘sqlite3BtreeCheckpoint’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:5739:19: warning[-Wunused-but-set-variable]: variable ‘pBt’ set but not used
# 5739 |         BtShared *pBt;
#      |                   ^~~
# 5737|   int sqlite3BtreeCheckpoint(Btree *p, int eMode, int *pnLog, int *pnCkpt)
# 5738|   {
# 5739|-> 	BtShared *pBt;
# 5740|   	int rc;
# 5741|   

Error: COMPILER_WARNING (CWE-563): [#def74]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:5936:19: warning[-Wunused-but-set-variable]: variable 'pBt' set but not used
# 5936 |         BtShared *pBt;
#      |                   ^~~
# 5934|   {
# 5935|   	BtCursor *pCur, tmpCursor;
# 5936|-> 	BtShared *pBt;
# 5937|   	DBC *oldCur;
# 5938|   	int opened, rc, res, ret;

Error: COMPILER_WARNING (CWE-563): [#def75]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:5936:19: warning[-Wunused-but-set-variable]: variable ‘pBt’ set but not used
# 5936 |         BtShared *pBt;
#      |                   ^~~
# 5934|   {
# 5935|   	BtCursor *pCur, tmpCursor;
# 5936|-> 	BtShared *pBt;
# 5937|   	DBC *oldCur;
# 5938|   	int opened, rc, res, ret;

Error: COMPILER_WARNING (CWE-563): [#def76]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function 'btreeLockSchema'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:5937:14: warning[-Wunused-but-set-variable]: variable 'oldCur' set but not used
# 5937 |         DBC *oldCur;
#      |              ^~~~~~
# 5935|   	BtCursor *pCur, tmpCursor;
# 5936|   	BtShared *pBt;
# 5937|-> 	DBC *oldCur;
# 5938|   	int opened, rc, res, ret;
# 5939|   

Error: COMPILER_WARNING (CWE-563): [#def77]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function ‘btreeLockSchema’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:5937:14: warning[-Wunused-but-set-variable]: variable ‘oldCur’ set but not used
# 5937 |         DBC *oldCur;
#      |              ^~~~~~
# 5935|   	BtCursor *pCur, tmpCursor;
# 5936|   	BtShared *pBt;
# 5937|-> 	DBC *oldCur;
# 5938|   	int opened, rc, res, ret;
# 5939|   

Error: COMPILER_WARNING (CWE-563): [#def78]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function 'sqlite3BtreeSavepoint'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:6454:19: warning[-Wunused-but-set-variable]: variable 'pBt' set but not used
# 6454 |         BtShared *pBt;
#      |                   ^~~
# 6452|   int sqlite3BtreeSavepoint(Btree *p, int op, int iSavepoint)
# 6453|   {
# 6454|-> 	BtShared *pBt;
# 6455|   	DB_TXN *txn;
# 6456|   	DB_TXN *ttxn;

Error: COMPILER_WARNING (CWE-563): [#def79]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function ‘sqlite3BtreeSavepoint’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:6454:19: warning[-Wunused-but-set-variable]: variable ‘pBt’ set but not used
# 6454 |         BtShared *pBt;
#      |                   ^~~
# 6452|   int sqlite3BtreeSavepoint(Btree *p, int op, int iSavepoint)
# 6453|   {
# 6454|-> 	BtShared *pBt;
# 6455|   	DB_TXN *txn;
# 6456|   	DB_TXN *ttxn;

Error: COMPILER_WARNING (CWE-563): [#def80]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function 'btreeGetPageCount'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:6774:14: warning[-Wunused-but-set-variable]: variable 'dbc' set but not used
# 6774 |         DBC *dbc;
#      |              ^~~
# 6772|   	DB *dbp;
# 6773|   	DB_BTREE_STAT *stats;
# 6774|-> 	DBC *dbc;
# 6775|   	DB_TXN *txnChild;
# 6776|   	BtShared *pBt;

Error: COMPILER_WARNING (CWE-563): [#def81]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: In function ‘btreeGetPageCount’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:6774:14: warning[-Wunused-but-set-variable]: variable ‘dbc’ set but not used
# 6774 |         DBC *dbc;
#      |              ^~~
# 6772|   	DB *dbp;
# 6773|   	DB_BTREE_STAT *stats;
# 6774|-> 	DBC *dbc;
# 6775|   	DB_TXN *txnChild;
# 6776|   	BtShared *pBt;

Error: COMPILER_WARNING (CWE-1164): [#def82]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:7015:12: warning[-Wunused-function]: 'btreeCompressInt' defined but not used
# 7015 | static int btreeCompressInt(u_int8_t *buf, u_int64_t i)
#      |            ^~~~~~~~~~~~~~~~
# 7013|    * An exact copy of __db_compress_int
# 7014|    */
# 7015|-> static int btreeCompressInt(u_int8_t *buf, u_int64_t i)
# 7016|   {
# 7017|   	if (i <= CMP_INT_1BYTE_MAX) {

Error: COMPILER_WARNING (CWE-1164): [#def83]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:7015:12: warning[-Wunused-function]: ‘btreeCompressInt’ defined but not used
# 7015 | static int btreeCompressInt(u_int8_t *buf, u_int64_t i)
#      |            ^~~~~~~~~~~~~~~~
# 7013|    * An exact copy of __db_compress_int
# 7014|    */
# 7015|-> static int btreeCompressInt(u_int8_t *buf, u_int64_t i)
# 7016|   {
# 7017|   	if (i <= CMP_INT_1BYTE_MAX) {

Error: COMPILER_WARNING (CWE-1164): [#def84]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: At top level
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:7170:12: warning[-Wunused-function]: 'btreeDecompressInt' defined but not used
# 7170 | static int btreeDecompressInt(const u_int8_t *buf, u_int64_t *i)
#      |            ^~~~~~~~~~~~~~~~~~
# 7168|    * An exact copy of __db_decompress_int
# 7169|    */
# 7170|-> static int btreeDecompressInt(const u_int8_t *buf, u_int64_t *i)
# 7171|   {
# 7172|   	int len;

Error: COMPILER_WARNING (CWE-1164): [#def85]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c: scope_hint: At top level
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/btree.c:7170:12: warning[-Wunused-function]: ‘btreeDecompressInt’ defined but not used
# 7170 | static int btreeDecompressInt(const u_int8_t *buf, u_int64_t *i)
#      |            ^~~~~~~~~~~~~~~~~~
# 7168|    * An exact copy of __db_decompress_int
# 7169|    */
# 7170|-> static int btreeDecompressInt(const u_int8_t *buf, u_int64_t *i)
# 7171|   {
# 7172|   	int len;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def86]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c: scope_hint: In function ‘supportsReplication’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:128:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:10: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:403:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:415:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:436:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:469:20: note: in expansion of macro ‘sqlite3StrNICmp’
#  126|   	u_int32_t val = 0;
#  127|   
#  128|-> 	if (p->pBt->env_opened) {
#  129|   		dbenv = p->pBt->dbenv;
#  130|   		dbenv->get_open_flags(dbenv, &val);

Error: COMPILER_WARNING (CWE-563): [#def87]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c: scope_hint: In function ‘hasDatabaseConnections’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:138:13: warning[-Wunused-but-set-variable]: variable ‘ret’ set but not used
#  138 |         int ret;
#      |             ^~~
#  136|   {
#  137|   	u_int32_t refCount;
#  138|-> 	int ret;
#  139|   
#  140|   	/*

Error: GCC_ANALYZER_WARNING (CWE-476): [#def88]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c: scope_hint: In function ‘getHostPort’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:219:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘colonpos’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:403:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:415:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:436:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:469:20: note: in expansion of macro ‘sqlite3StrNICmp’
#  217|   	/* Now that we have port number, only need to return host string. */
#  218|   	if (rc == SQLITE_OK)
#  219|-> 		*colonpos = '\0';
#  220|   
#  221|   	if (rc != SQLITE_OK)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def89]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c: scope_hint: In function ‘bdbsqlPragma’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:399:39: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pBt’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
#  397|   	} else if (sqlite3StrNICmp(zLeft, "txn_bulk", 8) == 0) {
#  398|   		if (zRight)
#  399|-> 			pBt->txn_bulk = getBoolean(zRight);
#  400|   		returnSingleInt(pParse, "txn_bulk", (i64)pBt->txn_bulk);
#  401|   		parsed = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def90]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:400:61: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pBt’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
#  398|   		if (zRight)
#  399|   			pBt->txn_bulk = getBoolean(zRight);
#  400|-> 		returnSingleInt(pParse, "txn_bulk", (i64)pBt->txn_bulk);
#  401|   		parsed = 1;
#  402|   		/* Enables MVCC and transactions snapshots. */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def91]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:405:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pDb’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:403:20: note: in expansion of macro ‘sqlite3StrNICmp’
#  403|   	} else if (sqlite3StrNICmp(zLeft, "multiversion", 12) == 0) {
#  404|   		if (zRight)
#  405|-> 			bdbsqlPragmaMultiversion(pParse, pDb->pBt,
#  406|   			    getBoolean(zRight));
#  407|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def92]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:409:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pDb’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:403:20: note: in expansion of macro ‘sqlite3StrNICmp’
#  407|   
#  408|   		returnSingleInt(pParse, "multiversion",
#  409|-> 		    (i64)((pDb->pBt->pBt->env_oflags & DB_MULTIVERSION)?
#  410|   		    1 : 0));
#  411|   		parsed = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def93]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:418:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pDb’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:403:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:415:20: note: in expansion of macro ‘sqlite3StrNICmp’
#  416|   		if (zRight) {
#  417|   			if (getBoolean(zRight)) {
#  418|-> 				if (pDb->pBt->pBt->env_oflags &
#  419|   				    DB_MULTIVERSION) {
#  420|   					pDb->pBt->pBt->read_txn_flags

Error: GCC_ANALYZER_WARNING (CWE-476): [#def94]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:429:36: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pDb’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:403:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:415:20: note: in expansion of macro ‘sqlite3StrNICmp’
#  427|   				}
#  428|   			} else
#  429|-> 				pDb->pBt->pBt->read_txn_flags &=
#  430|   				    ~DB_TXN_SNAPSHOT;
#  431|   		}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def95]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:433:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pDb’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:403:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:415:20: note: in expansion of macro ‘sqlite3StrNICmp’
#  431|   		}
#  432|   		returnSingleInt(pParse, "snapshot_isolation",
#  433|-> 		    (i64)((pDb->pBt->pBt->read_txn_flags & DB_TXN_SNAPSHOT)?
#  434|   		    1 : 0));
#  435|   		parsed = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def96]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:439:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pDb’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:403:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:415:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:436:20: note: in expansion of macro ‘sqlite3StrNICmp’
#  437|   		int iLimit = -2;
#  438|   		if (zRight &&
#  439|-> 		    envIsClosed(pParse, pDb->pBt, "bdbsql_system_memory")) {
#  440|   			if (!sqlite3GetInt32(zRight, &iLimit) ||
#  441|   			    (iLimit < 1 && iLimit != -1)) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def97]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:460:39: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pDb’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:403:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:415:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:436:20: note: in expansion of macro ‘sqlite3StrNICmp’
#  458|   			}
#  459|   		} else
#  460|-> 			iLimit = ((pDb->pBt->pBt->env_oflags &
#  461|   			    DB_SYSTEM_MEM) ? 1 : 0);
#  462|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def98]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:498:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pDb’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:403:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:415:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:436:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:469:20: note: in expansion of macro ‘sqlite3StrNICmp’
#  496|   			}
#  497|   			if (rc == SQLITE_OK)
#  498|-> 				rc = setPersistentPragma(pDb->pBt, zLeft,
#  499|   				    zRight, pParse);
#  500|   			/*

Error: GCC_ANALYZER_WARNING (CWE-476): [#def99]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:516:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pDb’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:403:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:415:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:436:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:469:20: note: in expansion of macro ‘sqlite3StrNICmp’
#  514|   			value = zRight;
#  515|   		} else
#  516|-> 			rc = getPersistentPragma(pDb->pBt, zLeft, &value,
#  517|   			    pParse);
#  518|   		if (rc == SQLITE_OK) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def100]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:526:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pDb’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:403:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:415:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:436:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:469:20: note: in expansion of macro ‘sqlite3StrNICmp’
#  524|   			sqlite3VdbeAddOp2(pParse->pVdbe, OP_ResultRow, 1, 1);
#  525|   		} else {
#  526|-> 			if (pDb->pBt->db->errCode != SQLITE_OK)
#  527|   				sqlite3Error(pDb->pBt->db, rc, "error in ",
#  528|   				    zLeft);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def101]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:548:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pDb’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:388:13: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:403:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:415:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:436:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:469:20: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:470:25: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:472:25: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:474:24: note: in expansion of macro ‘sqlite3StrNICmp’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:533:30: note: in expansion of macro ‘sqlite3StrNICmp’
#  546|   			turningOn = (getBoolean(zRight) == 1);
#  547|   			strcpy(setValue, turningOn ? "1" : "0");
#  548|-> 			rc = setPersistentPragma(pDb->pBt, zLeft,
#  549|   			    setValue, pParse);
#  550|   

Error: COMPILER_WARNING (CWE-457): [#def102]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:1187:12: warning[-Wmaybe-uninitialized]: ‘exists’ may be used uninitialized
# 1187 |         if (!exists) {
#      |            ^
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c: scope_hint: In function ‘setPersistentPragma’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:1528:29: note: ‘exists’ was declared here
# 1528 |         int rc, idx, attrs, exists;
#      |                             ^~~~~~
# 1185|   	 * version record.
# 1186|   	 */
# 1187|-> 	if (!exists) {
# 1188|   		memcpy(pragma_version, &pragma_index, 4);
# 1189|   		memcpy(&pragma_version[RECORD_HDR_SIZE], PRAGMA_VERSION, 4);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def103]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c: scope_hint: In function ‘setPersistentPragma’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_pragma.c:1590:19: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘exists’
# 1588|   
# 1589|   	/* No-op if an in-memeory environment. */
# 1590|-> 	if ((rc = insertPragmaIntoFile(p, idx, pragma_file, exists, pParse))
# 1591|   	    != SQLITE_OK) {
# 1592|   		/* The pragma file was deleted if it was found corrupt. */

Error: COMPILER_WARNING (CWE-563): [#def104]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_sequence.c: scope_hint: In function 'db_seq_drop_func'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_sequence.c:277:13: warning[-Wunused-but-set-variable]: variable 'mutex_held' set but not used
#  277 |         int mutex_held, rc;
#      |             ^~~~~~~~~~
#  275|   	CACHED_DB *cache_entry;
#  276|   	SEQ_COOKIE cookie;
#  277|-> 	int mutex_held, rc;
#  278|   	sqlite3 *db;
#  279|   

Error: COMPILER_WARNING (CWE-563): [#def105]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_sequence.c: scope_hint: In function ‘db_seq_drop_func’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_sequence.c:277:13: warning[-Wunused-but-set-variable]: variable ‘mutex_held’ set but not used
#  277 |         int mutex_held, rc;
#      |             ^~~~~~~~~~
#  275|   	CACHED_DB *cache_entry;
#  276|   	SEQ_COOKIE cookie;
#  277|-> 	int mutex_held, rc;
#  278|   	sqlite3 *db;
#  279|   

Error: COMPILER_WARNING (CWE-563): [#def106]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_sequence.c: scope_hint: In function 'btreeSeqGetVal'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_sequence.c:362:19: warning[-Wunused-but-set-variable]: variable 'pBt' set but not used
#  362 |         BtShared *pBt;
#      |                   ^~~
#  360|   
#  361|   	Btree *p;
#  362|-> 	BtShared *pBt;
#  363|   	SEQ_COOKIE cookie;
#  364|   	db_seq_t val;

Error: COMPILER_WARNING (CWE-563): [#def107]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_sequence.c: scope_hint: In function ‘btreeSeqGetVal’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_sequence.c:362:19: warning[-Wunused-but-set-variable]: variable ‘pBt’ set but not used
#  362 |         BtShared *pBt;
#      |                   ^~~
#  360|   
#  361|   	Btree *p;
#  362|-> 	BtShared *pBt;
#  363|   	SEQ_COOKIE cookie;
#  364|   	db_seq_t val;

Error: COMPILER_WARNING (CWE-563): [#def108]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_sequence.c: scope_hint: In function 'btreeSeqPutCookie'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_sequence.c:838:18: warning[-Wunused-but-set-variable]: variable 'db' set but not used
#  838 |         sqlite3 *db;
#      |                  ^~
#  836|   	DBT cookie_key, cookie_data;
#  837|   	int rc, ret;
#  838|-> 	sqlite3 *db;
#  839|   
#  840|   	pBt = p->pBt;

Error: COMPILER_WARNING (CWE-563): [#def109]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_sequence.c: scope_hint: In function ‘btreeSeqPutCookie’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_sequence.c:838:18: warning[-Wunused-but-set-variable]: variable ‘db’ set but not used
#  838 |         sqlite3 *db;
#      |                  ^~
#  836|   	DBT cookie_key, cookie_data;
#  837|   	int rc, ret;
#  838|-> 	sqlite3 *db;
#  839|   
#  840|   	pBt = p->pBt;

Error: COMPILER_WARNING (CWE-457): [#def110]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_shell.c: scope_hint: In function ‘bdbSqlDbStatPrint’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_shell.c:123:16: warning[-Wmaybe-uninitialized]: ‘rc’ may be used uninitialized
#  123 |         return rc;
#      |                ^~
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/db_shell.c:37:16: note: ‘rc’ was declared here
#   37 |         int i, rc, nRow, iTable, openTransaction = 0;
#      |                ^~
#  121|   		(void)sqlite3_free_table(azResult);
#  122|   
#  123|-> 	return rc;
#  124|   }
#  125|   

Error: COMPILER_WARNING (CWE-563): [#def111]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/pager.c: scope_hint: In function 'sqlite3PagerCheckpoint'
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/pager.c:150:13: warning[-Wunused-but-set-variable]: variable 'needUnlock' set but not used
#  150 |         int needUnlock;
#      |             ^~~~~~~~~~
#  148|   	Btree *p;
#  149|   	BtShared *pBt;
#  150|-> 	int needUnlock;
#  151|   
#  152|   	p = (Btree *)pPager;

Error: COMPILER_WARNING (CWE-563): [#def112]
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/pager.c: scope_hint: In function ‘sqlite3PagerCheckpoint’
libdb-5.3.28-build/db-5.3.28/lang/sql/adapter/pager.c:150:13: warning[-Wunused-but-set-variable]: variable ‘needUnlock’ set but not used
#  150 |         int needUnlock;
#      |             ^~~~~~~~~~
#  148|   	Btree *p;
#  149|   	BtShared *pBt;
#  150|-> 	int needUnlock;
#  151|   
#  152|   	p = (Btree *)pPager;

Error: COMPILER_WARNING: [#def113]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:7426:26: warning[-Wunused-const-variable=]: 'sqlite3one' defined but not used
# 7426 | SQLITE_PRIVATE const int sqlite3one = 1;
#      |                          ^~~~~~~~~~
# 7424|   */
# 7425|   #ifdef SQLITE_AMALGAMATION
# 7426|-> SQLITE_PRIVATE const int sqlite3one = 1;
# 7427|   #else
# 7428|   SQLITE_PRIVATE const int sqlite3one;

Error: COMPILER_WARNING (CWE-1164): [#def114]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: At top level
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:7712:20: warning[-Wunused-function]: 'sqlite3BtreeCopyFile' declared 'static' but never defined
# 7712 | SQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *, Btree *);
#      |                    ^~~~~~~~~~~~~~~~~~~~
# 7710|   SQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *);
# 7711|   SQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *);
# 7712|-> SQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *, Btree *);
# 7713|   
# 7714|   SQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *);

Error: COMPILER_WARNING (CWE-1164): [#def115]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:10672:22: warning[-Wunused-function]: 'sqlite3PageMalloc' declared 'static' but never defined
#10672 | SQLITE_PRIVATE void *sqlite3PageMalloc(int);
#      |                      ^~~~~~~~~~~~~~~~~
#10670|   SQLITE_PRIVATE void *sqlite3ScratchMalloc(int);
#10671|   SQLITE_PRIVATE void sqlite3ScratchFree(void*);
#10672|-> SQLITE_PRIVATE void *sqlite3PageMalloc(int);
#10673|   SQLITE_PRIVATE void sqlite3PageFree(void*);
#10674|   SQLITE_PRIVATE void sqlite3MemSetDefault(void);

Error: COMPILER_WARNING (CWE-1164): [#def116]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:10673:21: warning[-Wunused-function]: 'sqlite3PageFree' declared 'static' but never defined
#10673 | SQLITE_PRIVATE void sqlite3PageFree(void*);
#      |                     ^~~~~~~~~~~~~~~
#10671|   SQLITE_PRIVATE void sqlite3ScratchFree(void*);
#10672|   SQLITE_PRIVATE void *sqlite3PageMalloc(int);
#10673|-> SQLITE_PRIVATE void sqlite3PageFree(void*);
#10674|   SQLITE_PRIVATE void sqlite3MemSetDefault(void);
#10675|   SQLITE_PRIVATE void sqlite3BenignMallocHooks(void (*)(void), void (*)(void));

Error: COMPILER_WARNING (CWE-1164): [#def117]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:11109:21: warning[-Wunused-function]: 'sqlite3BackupRestart' declared 'static' but never defined
#11109 | SQLITE_PRIVATE void sqlite3BackupRestart(sqlite3_backup *);
#      |                     ^~~~~~~~~~~~~~~~~~~~
#11107|   SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *, SrcList *, int, int);
#11108|   
#11109|-> SQLITE_PRIVATE void sqlite3BackupRestart(sqlite3_backup *);
#11110|   SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *);
#11111|   

Error: COMPILER_WARNING (CWE-1164): [#def118]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:11110:21: warning[-Wunused-function]: 'sqlite3BackupUpdate' declared 'static' but never defined
#11110 | SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *);
#      |                     ^~~~~~~~~~~~~~~~~~~
#11108|   
#11109|   SQLITE_PRIVATE void sqlite3BackupRestart(sqlite3_backup *);
#11110|-> SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *);
#11111|   
#11112|   /*

Error: COMPILER_WARNING (CWE-1164): [#def119]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:13765:20: warning[-Wunused-function]: 'sqlite3OsTruncate' defined but not used
#13765 | SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file *id, i64 size){
#      |                    ^~~~~~~~~~~~~~~~~
#13763|     return id->pMethods->xWrite(id, pBuf, amt, offset);
#13764|   }
#13765|-> SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file *id, i64 size){
#13766|     return id->pMethods->xTruncate(id, size);
#13767|   }

Error: COMPILER_WARNING (CWE-1164): [#def120]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:13772:20: warning[-Wunused-function]: 'sqlite3OsFileSize' defined but not used
#13772 | SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file *id, i64 *pSize){
#      |                    ^~~~~~~~~~~~~~~~~
#13770|     return id->pMethods->xSync(id, flags);
#13771|   }
#13772|-> SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file *id, i64 *pSize){
#13773|     DO_OS_MALLOC_TEST(id);
#13774|     return id->pMethods->xFileSize(id, pSize);

Error: COMPILER_WARNING (CWE-1164): [#def121]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:13783:20: warning[-Wunused-function]: 'sqlite3OsCheckReservedLock' defined but not used
#13783 | SQLITE_PRIVATE int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut){
#      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
#13781|     return id->pMethods->xUnlock(id, lockType);
#13782|   }
#13783|-> SQLITE_PRIVATE int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut){
#13784|     DO_OS_MALLOC_TEST(id);
#13785|     return id->pMethods->xCheckReservedLock(id, pResOut);

Error: COMPILER_WARNING (CWE-1164): [#def122]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:13790:20: warning[-Wunused-function]: 'sqlite3OsSectorSize' defined but not used
#13790 | SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id){
#      |                    ^~~~~~~~~~~~~~~~~~~
#13788|     return id->pMethods->xFileControl(id, op, pArg);
#13789|   }
#13790|-> SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id){
#13791|     int (*xSectorSize)(sqlite3_file*) = id->pMethods->xSectorSize;
#13792|     return (xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE);

Error: COMPILER_WARNING (CWE-1164): [#def123]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:13797:20: warning[-Wunused-function]: 'sqlite3OsShmLock' defined but not used
#13797 | SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int offset, int n, int flags){
#      |                    ^~~~~~~~~~~~~~~~
#13795|     return id->pMethods->xDeviceCharacteristics(id);
#13796|   }
#13797|-> SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int offset, int n, int flags){
#13798|     return id->pMethods->xShmLock(id, offset, n, flags);
#13799|   }

Error: COMPILER_WARNING (CWE-1164): [#def124]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:13800:21: warning[-Wunused-function]: 'sqlite3OsShmBarrier' defined but not used
#13800 | SQLITE_PRIVATE void sqlite3OsShmBarrier(sqlite3_file *id){
#      |                     ^~~~~~~~~~~~~~~~~~~
#13798|     return id->pMethods->xShmLock(id, offset, n, flags);
#13799|   }
#13800|-> SQLITE_PRIVATE void sqlite3OsShmBarrier(sqlite3_file *id){
#13801|     id->pMethods->xShmBarrier(id);
#13802|   }

Error: COMPILER_WARNING (CWE-1164): [#def125]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:13803:20: warning[-Wunused-function]: 'sqlite3OsShmUnmap' defined but not used
#13803 | SQLITE_PRIVATE int sqlite3OsShmUnmap(sqlite3_file *id, int deleteFlag){
#      |                    ^~~~~~~~~~~~~~~~~
#13801|     id->pMethods->xShmBarrier(id);
#13802|   }
#13803|-> SQLITE_PRIVATE int sqlite3OsShmUnmap(sqlite3_file *id, int deleteFlag){
#13804|     return id->pMethods->xShmUnmap(id, deleteFlag);
#13805|   }

Error: COMPILER_WARNING (CWE-1164): [#def126]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:13806:20: warning[-Wunused-function]: 'sqlite3OsShmMap' defined but not used
#13806 | SQLITE_PRIVATE int sqlite3OsShmMap(
#      |                    ^~~~~~~~~~~~~~~
#13804|     return id->pMethods->xShmUnmap(id, deleteFlag);
#13805|   }
#13806|-> SQLITE_PRIVATE int sqlite3OsShmMap(
#13807|     sqlite3_file *id,               /* Database file handle */
#13808|     int iPage,

Error: COMPILER_WARNING (CWE-457): [#def127]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:16265:5: warning[-Wmaybe-uninitialized]: 'mutexOpen' may be used uninitialized
#16265 |   if( p ){
#      |     ^
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'btreeUpdateBtShared'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:36670:24: note: 'mutexOpen' was declared here
#36670 |         sqlite3_mutex *mutexOpen;
#      |                        ^~~~~~~~~
#16263|   */
#16264|   SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex *p){
#16265|->   if( p ){
#16266|       sqlite3GlobalConfig.mutex.xMutexLeave(p);
#16267|     }

Error: COMPILER_WARNING (CWE-1164): [#def128]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:17655:20: warning[-Wunused-function]: 'sqlite3HeapNearlyFull' defined but not used
#17655 | SQLITE_PRIVATE int sqlite3HeapNearlyFull(void){
#      |                    ^~~~~~~~~~~~~~~~~~~~~
#17653|   ** sqlite3_soft_heap_limit().
#17654|   */
#17655|-> SQLITE_PRIVATE int sqlite3HeapNearlyFull(void){
#17656|     return mem0.nearlyFull;
#17657|   }

Error: COMPILER_WARNING (CWE-1164): [#def129]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:20944:20: warning[-Wunused-function]: 'sqlite3Get4byte' defined but not used
#20944 | SQLITE_PRIVATE u32 sqlite3Get4byte(const u8 *p){
#      |                    ^~~~~~~~~~~~~~~
#20942|   ** Read or write a four-byte big-endian integer value.
#20943|   */
#20944|-> SQLITE_PRIVATE u32 sqlite3Get4byte(const u8 *p){
#20945|     return (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
#20946|   }

Error: COMPILER_WARNING (CWE-1164): [#def130]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:20947:21: warning[-Wunused-function]: 'sqlite3Put4byte' defined but not used
#20947 | SQLITE_PRIVATE void sqlite3Put4byte(unsigned char *p, u32 v){
#      |                     ^~~~~~~~~~~~~~~
#20945|     return (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
#20946|   }
#20947|-> SQLITE_PRIVATE void sqlite3Put4byte(unsigned char *p, u32 v){
#20948|     p[0] = (u8)(v>>24);
#20949|     p[1] = (u8)(v>>16);

Error: COMPILER_WARNING (CWE-563): [#def131]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'posixUnlock'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:25435:7: warning[-Wunused-but-set-variable]: variable 'h' set but not used
#25435 |   int h;
#      |       ^
#25433|     struct flock lock;
#25434|     int rc = SQLITE_OK;
#25435|->   int h;
#25436|   
#25437|     assert( pFile );

Error: COMPILER_WARNING (CWE-1164): [#def132]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:34901:20: warning[-Wunused-function]: 'sqlite3PagerIsMemdb' defined but not used
#34901 | SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager *pPager) { return 0; }
#      |                    ^~~~~~~~~~~~~~~~~~~
#34899|   static sqlite3_file nullfile;
#34900|   
#34901|-> SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager *pPager) { return 0; }
#34902|   SQLITE_PRIVATE int sqlite3PagerJournalMode(Pager *pPager, int mode) { return 0; }
#34903|   SQLITE_PRIVATE i64 sqlite3PagerJournalSizeLimit(Pager *pPager, i64 limit)

Error: COMPILER_WARNING (CWE-1164): [#def133]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:34902:20: warning[-Wunused-function]: 'sqlite3PagerJournalMode' defined but not used
#34902 | SQLITE_PRIVATE int sqlite3PagerJournalMode(Pager *pPager, int mode) { return 0; }
#      |                    ^~~~~~~~~~~~~~~~~~~~~~~
#34900|   
#34901|   SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager *pPager) { return 0; }
#34902|-> SQLITE_PRIVATE int sqlite3PagerJournalMode(Pager *pPager, int mode) { return 0; }
#34903|   SQLITE_PRIVATE i64 sqlite3PagerJournalSizeLimit(Pager *pPager, i64 limit)
#34904|   {

Error: COMPILER_WARNING (CWE-1164): [#def134]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:34935:20: warning[-Wunused-function]: 'sqlite3PagerPagecount' defined but not used
#34935 | SQLITE_PRIVATE int sqlite3PagerPagecount(Pager *pPager, int *pCount) {
#      |                    ^~~~~~~~~~~~~~~~~~~~~
#34933|   }
#34934|   
#34935|-> SQLITE_PRIVATE int sqlite3PagerPagecount(Pager *pPager, int *pCount) {
#34936|   	pCount = 0;
#34937|   	return SQLITE_OK;

Error: COMPILER_WARNING (CWE-563): [#def135]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'sqlite3PagerCheckpoint'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:35034:13: warning[-Wunused-but-set-variable]: variable 'needUnlock' set but not used
#35034 |         int needUnlock;
#      |             ^~~~~~~~~~
#35032|   	Btree *p;
#35033|   	BtShared *pBt;
#35034|-> 	int needUnlock;
#35035|   
#35036|   	p = (Btree *)pPager;

Error: COMPILER_WARNING (CWE-1164): [#def136]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:35193:20: warning[-Wunused-function]: 'sqlite3BtreeHoldsMutex' defined but not used
#35193 | SQLITE_PRIVATE int sqlite3BtreeHoldsMutex(Btree *db)
#      |                    ^~~~~~~~~~~~~~~~~~~~~~
#35191|   }
#35192|   
#35193|-> SQLITE_PRIVATE int sqlite3BtreeHoldsMutex(Btree *db)
#35194|   {
#35195|   	log_msg(LOG_VERBOSE, "sqlite3BtreeHoldsMutex(%p)", db);

Error: COMPILER_WARNING (CWE-1164): [#def137]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:35199:20: warning[-Wunused-function]: 'sqlite3BtreeHoldsAllMutexes' defined but not used
#35199 | SQLITE_PRIVATE int sqlite3BtreeHoldsAllMutexes(sqlite3 *db)
#      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#35197|   }
#35198|   
#35199|-> SQLITE_PRIVATE int sqlite3BtreeHoldsAllMutexes(sqlite3 *db)
#35200|   {
#35201|   	log_msg(LOG_VERBOSE, "sqlite3BtreeHoldsAllMutexes(%p)", db);

Error: COMPILER_WARNING (CWE-1164): [#def138]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:35205:20: warning[-Wunused-function]: 'sqlite3SchemaMutexHeld' defined but not used
#35205 | SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3 *db, int iDb, Schema *pSchema)
#      |                    ^~~~~~~~~~~~~~~~~~~~~~
#35203|   }
#35204|   
#35205|-> SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3 *db, int iDb, Schema *pSchema)
#35206|   {
#35207|   	/*

Error: COMPILER_WARNING (CWE-457): [#def139]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'btreeUpdateBtShared'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:36731:17: warning[-Wmaybe-uninitialized]: 'mutexOpen' may be used uninitialized
#36731 |                 sqlite3_mutex_leave(mutexOpen);
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:36670:24: note: 'mutexOpen' was declared here
#36670 |         sqlite3_mutex *mutexOpen;
#      |                        ^~~~~~~~~
#36729|   	}
#36730|   	if (needLock)
#36731|-> 		sqlite3_mutex_leave(mutexOpen);
#36732|   
#36733|   #ifdef BDBSQL_FILE_PER_TABLE

Error: COMPILER_WARNING (CWE-563): [#def140]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'btreeOpenEnvironment'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:36827:20: warning[-Wunused-but-set-variable]: variable 'cached_db' set but not used
#36827 |         CACHED_DB *cached_db;
#      |                    ^~~~~~~~~
#36825|   	BtShared *pBt;
#36826|   	sqlite3 *db;
#36827|-> 	CACHED_DB *cached_db;
#36828|   	int creating, iTable, newEnv, rc, ret, reuse_env, writeLock;
#36829|   	sqlite3_mutex *mutexOpen;

Error: COMPILER_WARNING (CWE-563): [#def141]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'sqlite3BtreeCommit'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:38282:19: warning[-Wunused-but-set-variable]: variable 'pBt' set but not used
#38282 |         BtShared *pBt;
#      |                   ^~~
#38280|   SQLITE_PRIVATE int sqlite3BtreeCommit(Btree *p)
#38281|   {
#38282|-> 	BtShared *pBt;
#38283|   	int rc;
#38284|   

Error: COMPILER_WARNING (CWE-563): [#def142]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'btreeRestoreCursorPosition'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:39470:19: warning[-Wunused-but-set-variable]: variable 'pBt' set but not used
#39470 |         BtShared *pBt;
#      |                   ^~~
#39468|   {
#39469|   	Btree *p;
#39470|-> 	BtShared *pBt;
#39471|   	void *keyCopy;
#39472|   	int rc, ret, size;

Error: COMPILER_WARNING (CWE-563): [#def143]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'sqlite3BtreeCheckpoint'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:40969:19: warning[-Wunused-but-set-variable]: variable 'pBt' set but not used
#40969 |         BtShared *pBt;
#      |                   ^~~
#40967|   SQLITE_PRIVATE int sqlite3BtreeCheckpoint(Btree *p, int eMode, int *pnLog, int *pnCkpt)
#40968|   {
#40969|-> 	BtShared *pBt;
#40970|   	int rc;
#40971|   

Error: COMPILER_WARNING (CWE-563): [#def144]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:41166:19: warning[-Wunused-but-set-variable]: variable 'pBt' set but not used
#41166 |         BtShared *pBt;
#      |                   ^~~
#41164|   {
#41165|   	BtCursor *pCur, tmpCursor;
#41166|-> 	BtShared *pBt;
#41167|   	DBC *oldCur;
#41168|   	int opened, rc, res, ret;

Error: COMPILER_WARNING (CWE-563): [#def145]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'btreeLockSchema'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:41167:14: warning[-Wunused-but-set-variable]: variable 'oldCur' set but not used
#41167 |         DBC *oldCur;
#      |              ^~~~~~
#41165|   	BtCursor *pCur, tmpCursor;
#41166|   	BtShared *pBt;
#41167|-> 	DBC *oldCur;
#41168|   	int opened, rc, res, ret;
#41169|   

Error: COMPILER_WARNING (CWE-1164): [#def146]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:41359:20: warning[-Wunused-function]: 'sqlite3BtreeGetReserve' defined but not used
#41359 | SQLITE_PRIVATE int sqlite3BtreeGetReserve(Btree *p)
#      |                    ^~~~~~~~~~~~~~~~~~~~~~
#41357|   ** No op.
#41358|   */
#41359|-> SQLITE_PRIVATE int sqlite3BtreeGetReserve(Btree *p)
#41360|   {
#41361|   	log_msg(LOG_VERBOSE, "sqlite3BtreeGetReserve(%p)", p);

Error: COMPILER_WARNING (CWE-563): [#def147]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'sqlite3BtreeSavepoint'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:41684:19: warning[-Wunused-but-set-variable]: variable 'pBt' set but not used
#41684 |         BtShared *pBt;
#      |                   ^~~
#41682|   SQLITE_PRIVATE int sqlite3BtreeSavepoint(Btree *p, int op, int iSavepoint)
#41683|   {
#41684|-> 	BtShared *pBt;
#41685|   	DB_TXN *txn;
#41686|   	DB_TXN *ttxn;

Error: COMPILER_WARNING (CWE-563): [#def148]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'btreeGetPageCount'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:42004:14: warning[-Wunused-but-set-variable]: variable 'dbc' set but not used
#42004 |         DBC *dbc;
#      |              ^~~
#42002|   	DB *dbp;
#42003|   	DB_BTREE_STAT *stats;
#42004|-> 	DBC *dbc;
#42005|   	DB_TXN *txnChild;
#42006|   	BtShared *pBt;

Error: COMPILER_WARNING (CWE-1164): [#def149]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:42245:12: warning[-Wunused-function]: 'btreeCompressInt' defined but not used
#42245 | static int btreeCompressInt(u_int8_t *buf, u_int64_t i)
#      |            ^~~~~~~~~~~~~~~~
#42243|    * An exact copy of __db_compress_int
#42244|    */
#42245|-> static int btreeCompressInt(u_int8_t *buf, u_int64_t i)
#42246|   {
#42247|   	if (i <= CMP_INT_1BYTE_MAX) {

Error: COMPILER_WARNING (CWE-1164): [#def150]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:42400:12: warning[-Wunused-function]: 'btreeDecompressInt' defined but not used
#42400 | static int btreeDecompressInt(const u_int8_t *buf, u_int64_t *i)
#      |            ^~~~~~~~~~~~~~~~~~
#42398|    * An exact copy of __db_decompress_int
#42399|    */
#42400|-> static int btreeDecompressInt(const u_int8_t *buf, u_int64_t *i)
#42401|   {
#42402|   	int len;

Error: COMPILER_WARNING (CWE-563): [#def151]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'sqlite3_backup_init'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:43292:13: warning[-Wunused-but-set-variable]: variable 'ret' set but not used
#43292 |         int ret;
#      |             ^~~
#43290|   	Parse parse;
#43291|   	DB_ENV *dbenv;
#43292|-> 	int ret;
#43293|   
#43294|   	p = NULL;

Error: COMPILER_WARNING: [#def152]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'sqlite3_backup_init'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:43338:9: warning[-Wstringop-truncation]: 'strncpy' specified bound depends on the length of the source argument
#43338 |         strncpy(p->srcName, zSrcDb, strlen(zSrcDb) + 1);
#      |         ^
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:43338:37: note: length computed here
#43338 |         strncpy(p->srcName, zSrcDb, strlen(zSrcDb) + 1);
#      |                                     ^~~~~~~~~~~~~~
#43336|   		goto err;
#43337|   	}
#43338|-> 	strncpy(p->srcName, zSrcDb, strlen(zSrcDb) + 1);
#43339|   	strncpy(p->destName, zDestDb, strlen(zDestDb) + 1);
#43340|   

Error: COMPILER_WARNING: [#def153]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:43339:9: warning[-Wstringop-truncation]: 'strncpy' specified bound depends on the length of the source argument
#43339 |         strncpy(p->destName, zDestDb, strlen(zDestDb) + 1);
#      |         ^
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:43339:39: note: length computed here
#43339 |         strncpy(p->destName, zDestDb, strlen(zDestDb) + 1);
#      |                                       ^~~~~~~~~~~~~~~
#43337|   	}
#43338|   	strncpy(p->srcName, zSrcDb, strlen(zSrcDb) + 1);
#43339|-> 	strncpy(p->destName, zDestDb, strlen(zDestDb) + 1);
#43340|   
#43341|   	if (p->pDest->pBt->full_name) {

Error: COMPILER_WARNING: [#def154]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:43348:17: warning[-Wstringop-truncation]: 'strncpy' specified bound depends on the length of the source argument
#43348 |                 strncpy(p->fullName, fullName, strlen(fullName) + 1);
#      |                 ^
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:43348:48: note: length computed here
#43348 |                 strncpy(p->fullName, fullName, strlen(fullName) + 1);
#      |                                                ^~~~~~~~~~~~~~~~
#43346|   			goto err;
#43347|   		}
#43348|-> 		strncpy(p->fullName, fullName, strlen(fullName) + 1);
#43349|   	}
#43350|   

Error: COMPILER_WARNING (CWE-563): [#def155]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'btreeDeleteEnvironment'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:43467:27: warning[-Wunused-but-set-variable]: variable 'storage' set but not used
#43467 |         int rc, ret, iDb, storage;
#      |                           ^~~~~~~
#43465|   {
#43466|   	BtShared *pBt;
#43467|-> 	int rc, ret, iDb, storage;
#43468|   	sqlite3 *db;
#43469|   	DB_ENV *tmp_env;

Error: COMPILER_WARNING (CWE-563): [#def156]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'sqlite3_backup_step'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:43709:19: warning[-Wunused-but-set-variable]: variable 'pBtDest' set but not used
#43709 |         BtShared *pBtDest, *pBtSrc;
#      |                   ^~~~~~~
#43707|   	Parse parse;
#43708|   	DB_ENV *dbenv;
#43709|-> 	BtShared *pBtDest, *pBtSrc;
#43710|   
#43711|   	pBtDest = pBtSrc = NULL;

Error: COMPILER_WARNING (CWE-563): [#def157]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'hasDatabaseConnections'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:44410:13: warning[-Wunused-but-set-variable]: variable 'ret' set but not used
#44410 |         int ret;
#      |             ^~~
#44408|   {
#44409|   	u_int32_t refCount;
#44410|-> 	int ret;
#44411|   
#44412|   	/*

Error: COMPILER_WARNING (CWE-457): [#def158]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:45459:12: warning[-Wmaybe-uninitialized]: 'exists' may be used uninitialized
#45459 |         if (!exists) {
#      |            ^
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'setPersistentPragma'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:45800:29: note: 'exists' was declared here
#45800 |         int rc, idx, attrs, exists;
#      |                             ^~~~~~
#45457|   	 * version record.
#45458|   	 */
#45459|-> 	if (!exists) {
#45460|   		memcpy(pragma_version, &pragma_index, 4);
#45461|   		memcpy(&pragma_version[RECORD_HDR_SIZE], PRAGMA_VERSION, 4);

Error: COMPILER_WARNING (CWE-563): [#def159]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'db_seq_drop_func'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:46170:13: warning[-Wunused-but-set-variable]: variable 'mutex_held' set but not used
#46170 |         int mutex_held, rc;
#      |             ^~~~~~~~~~
#46168|   	CACHED_DB *cache_entry;
#46169|   	SEQ_COOKIE cookie;
#46170|-> 	int mutex_held, rc;
#46171|   	sqlite3 *db;
#46172|   

Error: COMPILER_WARNING (CWE-563): [#def160]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'btreeSeqGetVal'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:46255:19: warning[-Wunused-but-set-variable]: variable 'pBt' set but not used
#46255 |         BtShared *pBt;
#      |                   ^~~
#46253|   
#46254|   	Btree *p;
#46255|-> 	BtShared *pBt;
#46256|   	SEQ_COOKIE cookie;
#46257|   	db_seq_t val;

Error: COMPILER_WARNING (CWE-563): [#def161]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'btreeSeqPutCookie'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:46731:18: warning[-Wunused-but-set-variable]: variable 'db' set but not used
#46731 |         sqlite3 *db;
#      |                  ^~
#46729|   	DBT cookie_key, cookie_data;
#46730|   	int rc, ret;
#46731|-> 	sqlite3 *db;
#46732|   
#46733|   	pBt = p->pBt;

Error: COMPILER_WARNING (CWE-457): [#def162]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'bdbSqlDbStatPrint'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:46936:16: warning[-Wmaybe-uninitialized]: 'rc' may be used uninitialized
#46936 |         return rc;
#      |                ^~
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:46850:16: note: 'rc' was declared here
#46850 |         int i, rc, nRow, iTable, openTransaction = 0;
#      |                ^~
#46934|   		(void)sqlite3_free_table(azResult);
#46935|   
#46936|-> 	return rc;
#46937|   }
#46938|   

Error: COMPILER_WARNING (CWE-1164): [#def163]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:60455:20: warning[-Wunused-function]: 'sqlite3IsMemJournal' defined but not used
#60455 | SQLITE_PRIVATE int sqlite3IsMemJournal(sqlite3_file *pJfd){
#      |                    ^~~~~~~~~~~~~~~~~~~
#60453|   ** an in-memory journal 
#60454|   */
#60455|-> SQLITE_PRIVATE int sqlite3IsMemJournal(sqlite3_file *pJfd){
#60456|     return pJfd->pMethods==&MemJournalMethods;
#60457|   }

Error: COMPILER_WARNING (CWE-697): [#def164]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'sqlite3SrcListShiftJoinType'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:71243:9: warning[-Waddress]: the comparison will always evaluate as 'true' for the address of 'a' will never be NULL
#71243 |   if( p && p->a ){
#      |         ^~
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:9956:5: note: 'a' declared here
# 9956 |   } a[1];             /* One entry for each identifier on the list */
#      |     ^
#71241|   */
#71242|   SQLITE_PRIVATE void sqlite3SrcListShiftJoinType(SrcList *p){
#71243|->   if( p && p->a ){
#71244|       int i;
#71245|       for(i=p->nSrc-1; i>0; i--){

Error: COMPILER_WARNING (CWE-563): [#def165]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'sqlite3CommitTransaction'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:71282:12: warning[-Wunused-but-set-variable]: variable 'db' set but not used
#71282 |   sqlite3 *db;
#      |            ^~
#71280|   */
#71281|   SQLITE_PRIVATE void sqlite3CommitTransaction(Parse *pParse){
#71282|->   sqlite3 *db;
#71283|     Vdbe *v;
#71284|   

Error: COMPILER_WARNING (CWE-563): [#def166]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'sqlite3RollbackTransaction'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:71302:12: warning[-Wunused-but-set-variable]: variable 'db' set but not used
#71302 |   sqlite3 *db;
#      |            ^~
#71300|   */
#71301|   SQLITE_PRIVATE void sqlite3RollbackTransaction(Parse *pParse){
#71302|->   sqlite3 *db;
#71303|     Vdbe *v;
#71304|   

Error: COMPILER_WARNING (CWE-562): [#def167]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'sqlite3SelectNew'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:81096:10: warning[-Wreturn-local-addr]: function may return address of local variable
#81096 |   return pNew;
#      |          ^~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:81066:10: note: declared here
#81066 |   Select standin;
#      |          ^~~~~~~
#81094|       pNew = 0;
#81095|     }
#81096|->   return pNew;
#81097|   }
#81098|   

Error: COMPILER_WARNING (CWE-563): [#def168]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'sqlite3Parser'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:97024:7: warning[-Wunused-but-set-variable]: variable 'yyendofinput' set but not used
#97024 |   int yyendofinput;     /* True if we are at the end of input */
#      |       ^~~~~~~~~~~~
#97022|     YYMINORTYPE yyminorunion;
#97023|     int yyact;            /* The parser action. */
#97024|->   int yyendofinput;     /* True if we are at the end of input */
#97025|   #ifdef YYERRORSYMBOL
#97026|     int yyerrorhit = 0;   /* True if yymajor has invoked an error */

Error: COMPILER_WARNING (CWE-1164): [#def169]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:99275:20: warning[-Wunused-function]: 'sqlite3InvokeBusyHandler' defined but not used
#99275 | SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p){
#      |                    ^~~~~~~~~~~~~~~~~~~~~~~~
#99273|   ** returns 0, the operation aborts with an SQLITE_BUSY error.
#99274|   */
#99275|-> SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p){
#99276|     int rc;
#99277|     if( NEVER(p==0) || p->xFunc==0 || p->nBusy<0 ) return 0;

Error: COMPILER_WARNING (CWE-1164): [#def170]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:99841:20: warning[-Wunused-function]: 'sqlite3TempInMemory' defined but not used
#99841 | SQLITE_PRIVATE int sqlite3TempInMemory(const sqlite3 *db){
#      |                    ^~~~~~~~~~~~~~~~~~~
#99839|   **   3                     any                memory    (return 1)
#99840|   */
#99841|-> SQLITE_PRIVATE int sqlite3TempInMemory(const sqlite3 *db){
#99842|   #if SQLITE_TEMP_STORE==1
#99843|     return ( db->temp_store==2 );

Error: COMPILER_WARNING (CWE-1164): [#def171]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:101220:21: warning[-Wunused-function]: 'sqlite3ConnectionBlocked' defined but not used
#101220 | SQLITE_PRIVATE void sqlite3ConnectionBlocked(sqlite3 *db, sqlite3 *pBlocker){
#       |                     ^~~~~~~~~~~~~~~~~~~~~~~~
#101218|   ** until connection pBlocker concludes its current transaction.
#101219|   */
#101220|-> SQLITE_PRIVATE void sqlite3ConnectionBlocked(sqlite3 *db, sqlite3 *pBlocker){
#101221|     enterMutex();
#101222|     if( db->pBlockingConnection==0 && db->pUnlockConnection==0 ){

Error: COMPILER_WARNING (CWE-563): [#def172]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'porter_stemmer'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:107889:41: warning[-Wunused-value]: value computed is not used
#107889 |      stem(&z, "lanoita", "ate", m_gt_0) ||
#       |                                         ^~
#107887|     switch( z[1] ){
#107888|      case 'a':
#107889|->      stem(&z, "lanoita", "ate", m_gt_0) ||
#107890|        stem(&z, "lanoit", "tion", m_gt_0);
#107891|        break;

Error: COMPILER_WARNING (CWE-563): [#def173]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:107893:39: warning[-Wunused-value]: value computed is not used
#107893 |      stem(&z, "icne", "ence", m_gt_0) ||
#       |                                       ^~
#107891|        break;
#107892|      case 'c':
#107893|->      stem(&z, "icne", "ence", m_gt_0) ||
#107894|        stem(&z, "icna", "ance", m_gt_0);
#107895|        break;

Error: COMPILER_WARNING (CWE-563): [#def174]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:107906:35: warning[-Wunused-value]: value computed is not used
#107906 |      stem(&z, "ile", "e", m_gt_0) ||
#       |                                   ^~
#107904|        stem(&z, "illa", "al", m_gt_0) ||
#107905|        stem(&z, "iltne", "ent", m_gt_0) ||
#107906|->      stem(&z, "ile", "e", m_gt_0) ||
#107907|        stem(&z, "ilsuo", "ous", m_gt_0);
#107908|        break;

Error: COMPILER_WARNING (CWE-563): [#def175]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:107911:39: warning[-Wunused-value]: value computed is not used
#107911 |      stem(&z, "noita", "ate", m_gt_0) ||
#       |                                       ^~
#107909|      case 'o':
#107910|        stem(&z, "noitazi", "ize", m_gt_0) ||
#107911|->      stem(&z, "noita", "ate", m_gt_0) ||
#107912|        stem(&z, "rota", "ate", m_gt_0);
#107913|        break;

Error: COMPILER_WARNING (CWE-563): [#def176]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:107917:41: warning[-Wunused-value]: value computed is not used
#107917 |      stem(&z, "ssenluf", "ful", m_gt_0) ||
#       |                                         ^~
#107915|        stem(&z, "msila", "al", m_gt_0) ||
#107916|        stem(&z, "ssenevi", "ive", m_gt_0) ||
#107917|->      stem(&z, "ssenluf", "ful", m_gt_0) ||
#107918|        stem(&z, "ssensuo", "ous", m_gt_0);
#107919|        break;

Error: COMPILER_WARNING (CWE-563): [#def177]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:107922:39: warning[-Wunused-value]: value computed is not used
#107922 |      stem(&z, "itivi", "ive", m_gt_0) ||
#       |                                       ^~
#107920|      case 't':
#107921|        stem(&z, "itila", "al", m_gt_0) ||
#107922|->      stem(&z, "itivi", "ive", m_gt_0) ||
#107923|        stem(&z, "itilib", "ble", m_gt_0);
#107924|        break;

Error: COMPILER_WARNING (CWE-563): [#def178]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:107931:38: warning[-Wunused-value]: value computed is not used
#107931 |      stem(&z, "evita", "", m_gt_0)   ||
#       |                                      ^~
#107929|      case 'e':
#107930|        stem(&z, "etaci", "ic", m_gt_0) ||
#107931|->      stem(&z, "evita", "", m_gt_0)   ||
#107932|        stem(&z, "ezila", "al", m_gt_0);
#107933|        break;

Error: COMPILER_WARNING (CWE-563): [#def179]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:107938:37: warning[-Wunused-value]: value computed is not used
#107938 |      stem(&z, "laci", "ic", m_gt_0) ||
#       |                                     ^~
#107936|        break;
#107937|      case 'l':
#107938|->      stem(&z, "laci", "ic", m_gt_0) ||
#107939|        stem(&z, "luf", "", m_gt_0);
#107940|        break;

Error: COMPILER_WARNING (CWE-563): [#def180]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:107981:39: warning[-Wunused-value]: value computed is not used
#107981 |          stem(&z, "tnem", "", m_gt_1) ||
#       |                                       ^~
#107979|          }else if( z[2]=='e' ){
#107980|            stem(&z, "tneme", "", m_gt_1) ||
#107981|->          stem(&z, "tnem", "", m_gt_1) ||
#107982|            stem(&z, "tne", "", m_gt_1);
#107983|          }

Error: COMPILER_WARNING (CWE-563): [#def181]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:108001:34: warning[-Wunused-value]: value computed is not used
#108001 |      stem(&z, "eta", "", m_gt_1) ||
#       |                                  ^~
#107999|        break;
#108000|      case 't':
#108001|->      stem(&z, "eta", "", m_gt_1) ||
#108002|        stem(&z, "iti", "", m_gt_1);
#108003|        break;

Error: COMPILER_WARNING (CWE-457): [#def182]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:113839:5: warning[-Wmaybe-uninitialized]: 'pParent' may be used uninitialized
#113839 |   if( pNode ){
#       |     ^
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'removeNode'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:115543:14: note: 'pParent' was declared here
#115543 |   RtreeNode *pParent;
#       |              ^~~~~~~
#113837|   nodeRelease(Rtree *pRtree, RtreeNode *pNode){
#113838|     int rc = SQLITE_OK;
#113839|->   if( pNode ){
#113840|       assert( pNode->nRef>0 );
#113841|       pNode->nRef--;

Error: COMPILER_WARNING (CWE-569): [#def183]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'deserializeGeometry'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:114396:34: warning[-Wbool-compare]: comparison of constant '4' with boolean expression is always false
#114396 |   if( !sqlite3_value_type(pValue)==SQLITE_BLOB ) return SQLITE_ERROR;
#       |                                  ^~
#114394|   
#114395|     /* Check that value is actually a blob. */
#114396|->   if( !sqlite3_value_type(pValue)==SQLITE_BLOB ) return SQLITE_ERROR;
#114397|   
#114398|     /* Check that the blob is roughly the right size. */

Error: COMPILER_WARNING (CWE-783): [#def184]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:114396:34: warning[-Wlogical-not-parentheses]: logical not is only applied to the left hand side of comparison
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:114396:7: note: add parentheses around left hand side expression to silence this warning
#114396 |   if( !sqlite3_value_type(pValue)==SQLITE_BLOB ) return SQLITE_ERROR;
#       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#       |       (                          )
#114394|   
#114395|     /* Check that value is actually a blob. */
#114396|->   if( !sqlite3_value_type(pValue)==SQLITE_BLOB ) return SQLITE_ERROR;
#114397|   
#114398|     /* Check that the blob is roughly the right size. */

Error: COMPILER_WARNING (CWE-563): [#def185]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'ChooseLeaf'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:114772:11: warning[-Wunused-but-set-variable]: variable 'fMinOverlap' set but not used
#114772 |     float fMinOverlap;
#       |           ^~~~~~~~~~~
#114770|       float fMinGrowth;
#114771|       float fMinArea;
#114772|->     float fMinOverlap;
#114773|   
#114774|       int nCell = NCELL(pNode);

Error: COMPILER_WARNING (CWE-457): [#def186]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'ChooseLeaf'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:114834:10: warning[-Wmaybe-uninitialized]: 'iBest' may be used uninitialized
#114834 |     rc = nodeAcquire(pRtree, iBest, pNode, &pChild);
#       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:114768:19: note: 'iBest' was declared here
#114768 |     sqlite3_int64 iBest;
#       |                   ^~~~~
#114832|   
#114833|       sqlite3_free(aCell);
#114834|->     rc = nodeAcquire(pRtree, iBest, pNode, &pChild);
#114835|       nodeRelease(pRtree, pNode);
#114836|       pNode = pChild;

Error: COMPILER_WARNING (CWE-457): [#def187]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:115256:8: warning[-Wmaybe-uninitialized]: 'fBestOverlap' may be used uninitialized
#115255 |       if( (nLeft==RTREE_MINCELLS(pRtree))
#       |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#115256 |        || (overlap<fBestOverlap)
#       |        ^~~~~~~~~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'rtreeInsertCell'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:115226:11: note: 'fBestOverlap' was declared here
#115226 |     float fBestOverlap;
#       |           ^~~~~~~~~~~~
#115254|         area = cellArea(pRtree, &left) + cellArea(pRtree, &right);
#115255|         if( (nLeft==RTREE_MINCELLS(pRtree))
#115256|->        || (overlap<fBestOverlap)
#115257|          || (overlap==fBestOverlap && area<fBestArea)
#115258|         ){

Error: COMPILER_WARNING (CWE-457): [#def188]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:115257:34: warning[-Wmaybe-uninitialized]: 'fBestArea' may be used uninitialized
#115257 |        || (overlap==fBestOverlap && area<fBestArea)
#       |           ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'rtreeInsertCell'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:115227:11: note: 'fBestArea' was declared here
#115227 |     float fBestArea;
#       |           ^~~~~~~~~
#115255|         if( (nLeft==RTREE_MINCELLS(pRtree))
#115256|          || (overlap<fBestOverlap)
#115257|->        || (overlap==fBestOverlap && area<fBestArea)
#115258|         ){
#115259|           iBestLeft = nLeft;

Error: COMPILER_WARNING (CWE-457): [#def189]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:115272:36: warning[-Wmaybe-uninitialized]: 'iBestDim' may be used uninitialized
#115272 |   memcpy(pBboxLeft, &aCell[aaSorted[iBestDim][0]], sizeof(RtreeCell));
#       |                                    ^
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'rtreeInsertCell'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:115202:7: note: 'iBestDim' was declared here
#115202 |   int iBestDim;
#       |       ^~~~~~~~
#115270|     }
#115271|   
#115272|->   memcpy(pBboxLeft, &aCell[aaSorted[iBestDim][0]], sizeof(RtreeCell));
#115273|     memcpy(pBboxRight, &aCell[aaSorted[iBestDim][iBestSplit]], sizeof(RtreeCell));
#115274|     for(ii=0; ii<nCell; ii++){

Error: COMPILER_WARNING (CWE-457): [#def190]
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:115273:47: warning[-Wmaybe-uninitialized]: 'iBestSplit' may be used uninitialized
#115273 |   memcpy(pBboxRight, &aCell[aaSorted[iBestDim][iBestSplit]], sizeof(RtreeCell));
#       |                                               ^
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c: scope_hint: In function 'rtreeInsertCell'
libdb-5.3.28-build/db-5.3.28/lang/sql/generated/sqlite3.c:115203:7: note: 'iBestSplit' was declared here
#115203 |   int iBestSplit;
#       |       ^~~~~~~~~~
#115271|   
#115272|     memcpy(pBboxLeft, &aCell[aaSorted[iBestDim][0]], sizeof(RtreeCell));
#115273|->   memcpy(pBboxRight, &aCell[aaSorted[iBestDim][iBestSplit]], sizeof(RtreeCell));
#115274|     for(ii=0; ii<nCell; ii++){
#115275|       RtreeNode *pTarget = (ii<iBestSplit)?pLeft:pRight;

Error: CPPCHECK_WARNING (CWE-476): [#def191]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3.c:2827: warning[nullPointer]: Possible null pointer dereference: pBest
# 2825|             }
# 2826|     
# 2827|->           if( pBest->nCost>nDoc ){
# 2828|               rc = fts3DeferExpression(p, p->pExpr);
# 2829|               break;

Error: COMPILER_WARNING (CWE-563): [#def192]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_porter.c: scope_hint: In function ‘porter_stemmer’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_porter.c:407:41: warning[-Wunused-value]: value computed is not used
#  407 |      stem(&z, "lanoita", "ate", m_gt_0) ||
#      |                                         ^~
#  405|     switch( z[1] ){
#  406|      case 'a':
#  407|->      stem(&z, "lanoita", "ate", m_gt_0) ||
#  408|        stem(&z, "lanoit", "tion", m_gt_0);
#  409|        break;

Error: COMPILER_WARNING (CWE-563): [#def193]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_porter.c:411:39: warning[-Wunused-value]: value computed is not used
#  411 |      stem(&z, "icne", "ence", m_gt_0) ||
#      |                                       ^~
#  409|        break;
#  410|      case 'c':
#  411|->      stem(&z, "icne", "ence", m_gt_0) ||
#  412|        stem(&z, "icna", "ance", m_gt_0);
#  413|        break;

Error: COMPILER_WARNING (CWE-563): [#def194]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_porter.c:424:35: warning[-Wunused-value]: value computed is not used
#  424 |      stem(&z, "ile", "e", m_gt_0) ||
#      |                                   ^~
#  422|        stem(&z, "illa", "al", m_gt_0) ||
#  423|        stem(&z, "iltne", "ent", m_gt_0) ||
#  424|->      stem(&z, "ile", "e", m_gt_0) ||
#  425|        stem(&z, "ilsuo", "ous", m_gt_0);
#  426|        break;

Error: COMPILER_WARNING (CWE-563): [#def195]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_porter.c:429:39: warning[-Wunused-value]: value computed is not used
#  429 |      stem(&z, "noita", "ate", m_gt_0) ||
#      |                                       ^~
#  427|      case 'o':
#  428|        stem(&z, "noitazi", "ize", m_gt_0) ||
#  429|->      stem(&z, "noita", "ate", m_gt_0) ||
#  430|        stem(&z, "rota", "ate", m_gt_0);
#  431|        break;

Error: COMPILER_WARNING (CWE-563): [#def196]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_porter.c:435:41: warning[-Wunused-value]: value computed is not used
#  435 |      stem(&z, "ssenluf", "ful", m_gt_0) ||
#      |                                         ^~
#  433|        stem(&z, "msila", "al", m_gt_0) ||
#  434|        stem(&z, "ssenevi", "ive", m_gt_0) ||
#  435|->      stem(&z, "ssenluf", "ful", m_gt_0) ||
#  436|        stem(&z, "ssensuo", "ous", m_gt_0);
#  437|        break;

Error: COMPILER_WARNING (CWE-563): [#def197]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_porter.c:440:39: warning[-Wunused-value]: value computed is not used
#  440 |      stem(&z, "itivi", "ive", m_gt_0) ||
#      |                                       ^~
#  438|      case 't':
#  439|        stem(&z, "itila", "al", m_gt_0) ||
#  440|->      stem(&z, "itivi", "ive", m_gt_0) ||
#  441|        stem(&z, "itilib", "ble", m_gt_0);
#  442|        break;

Error: COMPILER_WARNING (CWE-563): [#def198]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_porter.c:449:38: warning[-Wunused-value]: value computed is not used
#  449 |      stem(&z, "evita", "", m_gt_0)   ||
#      |                                      ^~
#  447|      case 'e':
#  448|        stem(&z, "etaci", "ic", m_gt_0) ||
#  449|->      stem(&z, "evita", "", m_gt_0)   ||
#  450|        stem(&z, "ezila", "al", m_gt_0);
#  451|        break;

Error: COMPILER_WARNING (CWE-563): [#def199]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_porter.c:456:37: warning[-Wunused-value]: value computed is not used
#  456 |      stem(&z, "laci", "ic", m_gt_0) ||
#      |                                     ^~
#  454|        break;
#  455|      case 'l':
#  456|->      stem(&z, "laci", "ic", m_gt_0) ||
#  457|        stem(&z, "luf", "", m_gt_0);
#  458|        break;

Error: COMPILER_WARNING (CWE-563): [#def200]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_porter.c:499:39: warning[-Wunused-value]: value computed is not used
#  499 |          stem(&z, "tnem", "", m_gt_1) ||
#      |                                       ^~
#  497|          }else if( z[2]=='e' ){
#  498|            stem(&z, "tneme", "", m_gt_1) ||
#  499|->          stem(&z, "tnem", "", m_gt_1) ||
#  500|            stem(&z, "tne", "", m_gt_1);
#  501|          }

Error: COMPILER_WARNING (CWE-563): [#def201]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_porter.c:519:34: warning[-Wunused-value]: value computed is not used
#  519 |      stem(&z, "eta", "", m_gt_1) ||
#      |                                  ^~
#  517|        break;
#  518|      case 't':
#  519|->      stem(&z, "eta", "", m_gt_1) ||
#  520|        stem(&z, "iti", "", m_gt_1);
#  521|        break;

Error: CPPCHECK_WARNING (CWE-476): [#def202]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_snippet.c:1007: error[ctunullpointer]: Null pointer dereference: pIter
# 1005|   */
# 1006|   static int fts3LcsIteratorAdvance(LcsIterator *pIter){
# 1007|->   char *pRead = pIter->pRead;
# 1008|     sqlite3_int64 iRead;
# 1009|     int rc = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def203]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_snippet.c:1007: warning[nullPointer]: Possible null pointer dereference: pIter
# 1005|   */
# 1006|   static int fts3LcsIteratorAdvance(LcsIterator *pIter){
# 1007|->   char *pRead = pIter->pRead;
# 1008|     sqlite3_int64 iRead;
# 1009|     int rc = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def204]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_snippet.c: scope_hint: In function ‘fts3LcsIteratorAdvance’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_snippet.c:1007:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pIter’
# 1005|   */
# 1006|   static int fts3LcsIteratorAdvance(LcsIterator *pIter){
# 1007|->   char *pRead = pIter->pRead;
# 1008|     sqlite3_int64 iRead;
# 1009|     int rc = 0;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def205]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_tokenizer.c: scope_hint: In function ‘sqlite3Fts3InitTokenizer’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_tokenizer.c:169:4: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘n’
#  167|   
#  168|     z = (char *)sqlite3Fts3NextToken(zCopy, &n);
#  169|->   z[n] = '\0';
#  170|     sqlite3Fts3Dequote(z);
#  171|   

Error: COMPILER_WARNING (CWE-563): [#def206]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_tokenizer.c: scope_hint: In function 'intTestFunc'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_tokenizer.c:401:7: warning[-Wunused-but-set-variable]: variable 'rc' set but not used
#  401 |   int rc;
#      |       ^~
#  399|     sqlite3_value **argv
#  400|   ){
#  401|->   int rc;
#  402|     const sqlite3_tokenizer_module *p1;
#  403|     const sqlite3_tokenizer_module *p2;

Error: CPPCHECK_WARNING (CWE-562): [#def207]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/fts3/fts3_write.c:1295: error[invalidLifetime]: Using pointer to local variable 'pE' that is out of scope.
# 1293|         pReader->iIdx = 0x7FFFFFFF;
# 1294|         pReader->ppNextElem = (Fts3HashElem **)&pReader[1];
# 1295|->       memcpy(pReader->ppNextElem, aElem, nElem*sizeof(Fts3HashElem *));
# 1296|       }
# 1297|     }

Error: COMPILER_WARNING (CWE-457): [#def208]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:639:5: warning[-Wmaybe-uninitialized]: ‘pParent’ may be used uninitialized
#  639 |   if( pNode ){
#      |     ^
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c: scope_hint: In function ‘removeNode’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2343:14: note: ‘pParent’ was declared here
# 2343 |   RtreeNode *pParent;
#      |              ^~~~~~~
#  637|   nodeRelease(Rtree *pRtree, RtreeNode *pNode){
#  638|     int rc = SQLITE_OK;
#  639|->   if( pNode ){
#  640|       assert( pNode->nRef>0 );
#  641|       pNode->nRef--;

Error: COMPILER_WARNING (CWE-569): [#def209]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c: scope_hint: In function ‘deserializeGeometry’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1196:34: warning[-Wbool-compare]: comparison of constant ‘4’ with boolean expression is always false
# 1196 |   if( !sqlite3_value_type(pValue)==SQLITE_BLOB ) return SQLITE_ERROR;
#      |                                  ^~
# 1194|   
# 1195|     /* Check that value is actually a blob. */
# 1196|->   if( !sqlite3_value_type(pValue)==SQLITE_BLOB ) return SQLITE_ERROR;
# 1197|   
# 1198|     /* Check that the blob is roughly the right size. */

Error: COMPILER_WARNING (CWE-783): [#def210]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1196:34: warning[-Wlogical-not-parentheses]: logical not is only applied to the left hand side of comparison
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1196:7: note: add parentheses around left hand side expression to silence this warning
# 1196 |   if( !sqlite3_value_type(pValue)==SQLITE_BLOB ) return SQLITE_ERROR;
#      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#      |       (                          )
# 1194|   
# 1195|     /* Check that value is actually a blob. */
# 1196|->   if( !sqlite3_value_type(pValue)==SQLITE_BLOB ) return SQLITE_ERROR;
# 1197|   
# 1198|     /* Check that the blob is roughly the right size. */

Error: GCC_ANALYZER_WARNING (CWE-121): [#def211]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c: scope_hint: In function ‘cellUnion.part.0’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1449:24: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2394:17: note: in expansion of macro ‘NCELL’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1449:24: note: write of 4 bytes to beyond the end of ‘box’
# 1447|     if( pRtree->eCoordType==RTREE_COORD_REAL32 ){
# 1448|       for(ii=0; ii<(pRtree->nDim*2); ii+=2){
# 1449|->       p1->aCoord[ii].f = MIN(p1->aCoord[ii].f, p2->aCoord[ii].f);
# 1450|         p1->aCoord[ii+1].f = MAX(p1->aCoord[ii+1].f, p2->aCoord[ii+1].f);
# 1451|       }

Error: GCC_ANALYZER_WARNING (CWE-126): [#def212]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1449:44: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2394:17: note: in expansion of macro ‘NCELL’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1449:44: note: read of 4 bytes from after the end of ‘box’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
# 1447|     if( pRtree->eCoordType==RTREE_COORD_REAL32 ){
# 1448|       for(ii=0; ii<(pRtree->nDim*2); ii+=2){
# 1449|->       p1->aCoord[ii].f = MIN(p1->aCoord[ii].f, p2->aCoord[ii].f);
# 1450|         p1->aCoord[ii+1].f = MAX(p1->aCoord[ii+1].f, p2->aCoord[ii+1].f);
# 1451|       }

Error: GCC_ANALYZER_WARNING (CWE-126): [#def213]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1449:62: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:27: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2394:17: note: in expansion of macro ‘NCELL’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:27: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1449:62: note: read of 4 bytes from after the end of ‘cell’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:27: note: in definition of macro ‘MIN’
# 1447|     if( pRtree->eCoordType==RTREE_COORD_REAL32 ){
# 1448|       for(ii=0; ii<(pRtree->nDim*2); ii+=2){
# 1449|->       p1->aCoord[ii].f = MIN(p1->aCoord[ii].f, p2->aCoord[ii].f);
# 1450|         p1->aCoord[ii+1].f = MAX(p1->aCoord[ii+1].f, p2->aCoord[ii+1].f);
# 1451|       }

Error: GCC_ANALYZER_WARNING (CWE-121): [#def214]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1450:26: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2394:17: note: in expansion of macro ‘NCELL’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1450:26: note: write of 4 bytes to beyond the end of ‘box’
# 1448|       for(ii=0; ii<(pRtree->nDim*2); ii+=2){
# 1449|         p1->aCoord[ii].f = MIN(p1->aCoord[ii].f, p2->aCoord[ii].f);
# 1450|->       p1->aCoord[ii+1].f = MAX(p1->aCoord[ii+1].f, p2->aCoord[ii+1].f);
# 1451|       }
# 1452|     }else{

Error: GCC_ANALYZER_WARNING (CWE-126): [#def215]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1450:48: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:310:21: note: in definition of macro ‘MAX’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2394:17: note: in expansion of macro ‘NCELL’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:310:21: note: in definition of macro ‘MAX’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1450:48: note: read of 4 bytes from after the end of ‘box’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:310:21: note: in definition of macro ‘MAX’
# 1448|       for(ii=0; ii<(pRtree->nDim*2); ii+=2){
# 1449|         p1->aCoord[ii].f = MIN(p1->aCoord[ii].f, p2->aCoord[ii].f);
# 1450|->       p1->aCoord[ii+1].f = MAX(p1->aCoord[ii+1].f, p2->aCoord[ii+1].f);
# 1451|       }
# 1452|     }else{

Error: GCC_ANALYZER_WARNING (CWE-126): [#def216]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1450:68: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:310:27: note: in definition of macro ‘MAX’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2394:17: note: in expansion of macro ‘NCELL’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:310:27: note: in definition of macro ‘MAX’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1450:68: note: read of 4 bytes from after the end of ‘cell’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:310:27: note: in definition of macro ‘MAX’
# 1448|       for(ii=0; ii<(pRtree->nDim*2); ii+=2){
# 1449|         p1->aCoord[ii].f = MIN(p1->aCoord[ii].f, p2->aCoord[ii].f);
# 1450|->       p1->aCoord[ii+1].f = MAX(p1->aCoord[ii+1].f, p2->aCoord[ii+1].f);
# 1451|       }
# 1452|     }else{

Error: GCC_ANALYZER_WARNING (CWE-121): [#def217]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c: scope_hint: In function ‘cellUnion’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1454:24: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2394:17: note: in expansion of macro ‘NCELL’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1454:24: note: write of 4 bytes to beyond the end of ‘box’
# 1452|     }else{
# 1453|       for(ii=0; ii<(pRtree->nDim*2); ii+=2){
# 1454|->       p1->aCoord[ii].i = MIN(p1->aCoord[ii].i, p2->aCoord[ii].i);
# 1455|         p1->aCoord[ii+1].i = MAX(p1->aCoord[ii+1].i, p2->aCoord[ii+1].i);
# 1456|       }

Error: GCC_ANALYZER_WARNING (CWE-126): [#def218]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1454:44: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2394:17: note: in expansion of macro ‘NCELL’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1454:44: note: read of 4 bytes from after the end of ‘box’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
# 1452|     }else{
# 1453|       for(ii=0; ii<(pRtree->nDim*2); ii+=2){
# 1454|->       p1->aCoord[ii].i = MIN(p1->aCoord[ii].i, p2->aCoord[ii].i);
# 1455|         p1->aCoord[ii+1].i = MAX(p1->aCoord[ii+1].i, p2->aCoord[ii+1].i);
# 1456|       }

Error: GCC_ANALYZER_WARNING (CWE-126): [#def219]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1454:62: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:27: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2394:17: note: in expansion of macro ‘NCELL’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:27: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1454:62: note: read of 4 bytes from after the end of ‘cell’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:27: note: in definition of macro ‘MIN’
# 1452|     }else{
# 1453|       for(ii=0; ii<(pRtree->nDim*2); ii+=2){
# 1454|->       p1->aCoord[ii].i = MIN(p1->aCoord[ii].i, p2->aCoord[ii].i);
# 1455|         p1->aCoord[ii+1].i = MAX(p1->aCoord[ii+1].i, p2->aCoord[ii+1].i);
# 1456|       }

Error: GCC_ANALYZER_WARNING (CWE-121): [#def220]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1455:26: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2394:17: note: in expansion of macro ‘NCELL’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1455:26: note: write of 4 bytes to beyond the end of ‘box’
# 1453|       for(ii=0; ii<(pRtree->nDim*2); ii+=2){
# 1454|         p1->aCoord[ii].i = MIN(p1->aCoord[ii].i, p2->aCoord[ii].i);
# 1455|->       p1->aCoord[ii+1].i = MAX(p1->aCoord[ii+1].i, p2->aCoord[ii+1].i);
# 1456|       }
# 1457|     }

Error: GCC_ANALYZER_WARNING (CWE-126): [#def221]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1455:48: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:310:21: note: in definition of macro ‘MAX’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2394:17: note: in expansion of macro ‘NCELL’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:310:21: note: in definition of macro ‘MAX’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1455:48: note: read of 4 bytes from after the end of ‘box’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:310:21: note: in definition of macro ‘MAX’
# 1453|       for(ii=0; ii<(pRtree->nDim*2); ii+=2){
# 1454|         p1->aCoord[ii].i = MIN(p1->aCoord[ii].i, p2->aCoord[ii].i);
# 1455|->       p1->aCoord[ii+1].i = MAX(p1->aCoord[ii+1].i, p2->aCoord[ii+1].i);
# 1456|       }
# 1457|     }

Error: GCC_ANALYZER_WARNING (CWE-126): [#def222]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1455:68: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:310:27: note: in definition of macro ‘MAX’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2394:17: note: in expansion of macro ‘NCELL’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:313:21: note: in definition of macro ‘MIN’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:310:27: note: in definition of macro ‘MAX’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1455:68: note: read of 4 bytes from after the end of ‘cell’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:310:27: note: in definition of macro ‘MAX’
# 1453|       for(ii=0; ii<(pRtree->nDim*2); ii+=2){
# 1454|         p1->aCoord[ii].i = MIN(p1->aCoord[ii].i, p2->aCoord[ii].i);
# 1455|->       p1->aCoord[ii+1].i = MAX(p1->aCoord[ii+1].i, p2->aCoord[ii+1].i);
# 1456|       }
# 1457|     }

Error: COMPILER_WARNING (CWE-563): [#def223]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c: scope_hint: In function ‘ChooseLeaf’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1572:11: warning[-Wunused-but-set-variable]: variable ‘fMinOverlap’ set but not used
# 1572 |     float fMinOverlap;
#      |           ^~~~~~~~~~~
# 1570|       float fMinGrowth;
# 1571|       float fMinArea;
# 1572|->     float fMinOverlap;
# 1573|   
# 1574|       int nCell = NCELL(pNode);

Error: CPPCHECK_WARNING (CWE-457): [#def224]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1634: warning[uninitvar]: Uninitialized variable: iBest
# 1632|   
# 1633|       sqlite3_free(aCell);
# 1634|->     rc = nodeAcquire(pRtree, iBest, pNode, &pChild);
# 1635|       nodeRelease(pRtree, pNode);
# 1636|       pNode = pChild;

Error: COMPILER_WARNING (CWE-457): [#def225]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1634:10: warning[-Wmaybe-uninitialized]: ‘iBest’ may be used uninitialized
# 1634 |     rc = nodeAcquire(pRtree, iBest, pNode, &pChild);
#      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:1568:19: note: ‘iBest’ was declared here
# 1568 |     sqlite3_int64 iBest;
#      |                   ^~~~~
# 1632|   
# 1633|       sqlite3_free(aCell);
# 1634|->     rc = nodeAcquire(pRtree, iBest, pNode, &pChild);
# 1635|       nodeRelease(pRtree, pNode);
# 1636|       pNode = pChild;

Error: COMPILER_WARNING (CWE-457): [#def226]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2056:8: warning[-Wmaybe-uninitialized]: ‘fBestOverlap’ may be used uninitialized
# 2055 |       if( (nLeft==RTREE_MINCELLS(pRtree))
#      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2056 |        || (overlap<fBestOverlap)
#      |        ^~~~~~~~~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c: scope_hint: In function ‘rtreeInsertCell’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2026:11: note: ‘fBestOverlap’ was declared here
# 2026 |     float fBestOverlap;
#      |           ^~~~~~~~~~~~
# 2054|         area = cellArea(pRtree, &left) + cellArea(pRtree, &right);
# 2055|         if( (nLeft==RTREE_MINCELLS(pRtree))
# 2056|->        || (overlap<fBestOverlap)
# 2057|          || (overlap==fBestOverlap && area<fBestArea)
# 2058|         ){

Error: COMPILER_WARNING (CWE-457): [#def227]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2057:34: warning[-Wmaybe-uninitialized]: ‘fBestArea’ may be used uninitialized
# 2057 |        || (overlap==fBestOverlap && area<fBestArea)
#      |           ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c: scope_hint: In function ‘rtreeInsertCell’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2027:11: note: ‘fBestArea’ was declared here
# 2027 |     float fBestArea;
#      |           ^~~~~~~~~
# 2055|         if( (nLeft==RTREE_MINCELLS(pRtree))
# 2056|          || (overlap<fBestOverlap)
# 2057|->        || (overlap==fBestOverlap && area<fBestArea)
# 2058|         ){
# 2059|           iBestLeft = nLeft;

Error: CPPCHECK_WARNING (CWE-457): [#def228]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2072: warning[uninitvar]: Uninitialized variable: iBestDim
# 2070|     }
# 2071|   
# 2072|->   memcpy(pBboxLeft, &aCell[aaSorted[iBestDim][0]], sizeof(RtreeCell));
# 2073|     memcpy(pBboxRight, &aCell[aaSorted[iBestDim][iBestSplit]], sizeof(RtreeCell));
# 2074|     for(ii=0; ii<nCell; ii++){

Error: COMPILER_WARNING (CWE-457): [#def229]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2072:36: warning[-Wmaybe-uninitialized]: ‘iBestDim’ may be used uninitialized
# 2072 |   memcpy(pBboxLeft, &aCell[aaSorted[iBestDim][0]], sizeof(RtreeCell));
#      |                                    ^
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c: scope_hint: In function ‘rtreeInsertCell’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2002:7: note: ‘iBestDim’ was declared here
# 2002 |   int iBestDim;
#      |       ^~~~~~~~
# 2070|     }
# 2071|   
# 2072|->   memcpy(pBboxLeft, &aCell[aaSorted[iBestDim][0]], sizeof(RtreeCell));
# 2073|     memcpy(pBboxRight, &aCell[aaSorted[iBestDim][iBestSplit]], sizeof(RtreeCell));
# 2074|     for(ii=0; ii<nCell; ii++){

Error: CPPCHECK_WARNING (CWE-457): [#def230]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2073: warning[uninitvar]: Uninitialized variable: iBestSplit
# 2071|   
# 2072|     memcpy(pBboxLeft, &aCell[aaSorted[iBestDim][0]], sizeof(RtreeCell));
# 2073|->   memcpy(pBboxRight, &aCell[aaSorted[iBestDim][iBestSplit]], sizeof(RtreeCell));
# 2074|     for(ii=0; ii<nCell; ii++){
# 2075|       RtreeNode *pTarget = (ii<iBestSplit)?pLeft:pRight;

Error: COMPILER_WARNING (CWE-457): [#def231]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2073:47: warning[-Wmaybe-uninitialized]: ‘iBestSplit’ may be used uninitialized
# 2073 |   memcpy(pBboxRight, &aCell[aaSorted[iBestDim][iBestSplit]], sizeof(RtreeCell));
#      |                                               ^
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c: scope_hint: In function ‘rtreeInsertCell’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2003:7: note: ‘iBestSplit’ was declared here
# 2003 |   int iBestSplit;
#      |       ^~~~~~~~~~
# 2071|   
# 2072|     memcpy(pBboxLeft, &aCell[aaSorted[iBestDim][0]], sizeof(RtreeCell));
# 2073|->   memcpy(pBboxRight, &aCell[aaSorted[iBestDim][iBestSplit]], sizeof(RtreeCell));
# 2074|     for(ii=0; ii<nCell; ii++){
# 2075|       RtreeNode *pTarget = (ii<iBestSplit)?pLeft:pRight;

Error: CPPCHECK_WARNING (CWE-457): [#def232]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2355: warning[uninitvar]: Uninitialized variables: pParent.pParent, pParent.iNode, pParent.nRef, pParent.isDirty, pParent.zData, pParent.pNext
# 2353|       rc = deleteCell(pRtree, pParent, iCell, iHeight+1);
# 2354|     }
# 2355|->   rc2 = nodeRelease(pRtree, pParent);
# 2356|     if( rc==SQLITE_OK ){
# 2357|       rc = rc2;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def233]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c: scope_hint: In function ‘removeNode’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/ext/rtree/rtree.c:2355:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pParent’
# 2353|       rc = deleteCell(pRtree, pParent, iCell, iHeight+1);
# 2354|     }
# 2355|->   rc2 = nodeRelease(pRtree, pParent);
# 2356|     if( rc==SQLITE_OK ){
# 2357|       rc = rc2;

Error: COMPILER_WARNING (CWE-697): [#def234]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c: scope_hint: In function 'sqlite3SrcListShiftJoinType'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c:3335:9: warning[-Waddress]: the comparison will always evaluate as 'true' for the address of 'a' will never be NULL
# 3335 |   if( p && p->a ){
#      |         ^~
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c:25: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/sqliteInt.h:1855:5: note: 'a' declared here
# 1855 |   } a[1];             /* One entry for each identifier on the list */
#      |     ^
# 3333|   */
# 3334|   void sqlite3SrcListShiftJoinType(SrcList *p){
# 3335|->   if( p && p->a ){
# 3336|       int i;
# 3337|       for(i=p->nSrc-1; i>0; i--){

Error: COMPILER_WARNING (CWE-697): [#def235]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c: scope_hint: In function ‘sqlite3SrcListShiftJoinType’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c:3335:9: warning[-Waddress]: the comparison will always evaluate as ‘true’ for the address of ‘a’ will never be NULL
# 3335 |   if( p && p->a ){
#      |         ^~
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c:25: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/sqliteInt.h:1855:5: note: ‘a’ declared here
# 1855 |   } a[1];             /* One entry for each identifier on the list */
#      |     ^
# 3333|   */
# 3334|   void sqlite3SrcListShiftJoinType(SrcList *p){
# 3335|->   if( p && p->a ){
# 3336|       int i;
# 3337|       for(i=p->nSrc-1; i>0; i--){

Error: COMPILER_WARNING (CWE-563): [#def236]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c: scope_hint: In function 'sqlite3CommitTransaction'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c:3374:12: warning[-Wunused-but-set-variable]: variable 'db' set but not used
# 3374 |   sqlite3 *db;
#      |            ^~
# 3372|   */
# 3373|   void sqlite3CommitTransaction(Parse *pParse){
# 3374|->   sqlite3 *db;
# 3375|     Vdbe *v;
# 3376|   

Error: COMPILER_WARNING (CWE-563): [#def237]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c: scope_hint: In function ‘sqlite3CommitTransaction’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c:3374:12: warning[-Wunused-but-set-variable]: variable ‘db’ set but not used
# 3374 |   sqlite3 *db;
#      |            ^~
# 3372|   */
# 3373|   void sqlite3CommitTransaction(Parse *pParse){
# 3374|->   sqlite3 *db;
# 3375|     Vdbe *v;
# 3376|   

Error: COMPILER_WARNING (CWE-563): [#def238]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c: scope_hint: In function 'sqlite3RollbackTransaction'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c:3394:12: warning[-Wunused-but-set-variable]: variable 'db' set but not used
# 3394 |   sqlite3 *db;
#      |            ^~
# 3392|   */
# 3393|   void sqlite3RollbackTransaction(Parse *pParse){
# 3394|->   sqlite3 *db;
# 3395|     Vdbe *v;
# 3396|   

Error: COMPILER_WARNING (CWE-563): [#def239]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c: scope_hint: In function ‘sqlite3RollbackTransaction’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/build.c:3394:12: warning[-Wunused-but-set-variable]: variable ‘db’ set but not used
# 3394 |   sqlite3 *db;
#      |            ^~
# 3392|   */
# 3393|   void sqlite3RollbackTransaction(Parse *pParse){
# 3394|->   sqlite3 *db;
# 3395|     Vdbe *v;
# 3396|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def240]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/callback.c: scope_hint: In function ‘synthCollSeq’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/callback.c:59:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#   57|     for(i=0; i<3; i++){
#   58|       pColl2 = sqlite3FindCollSeq(db, aEnc[i], z, 0);
#   59|->     if( pColl2->xCmp!=0 ){
#   60|         memcpy(pColl, pColl2, sizeof(CollSeq));
#   61|         pColl->xDel = 0;         /* Do not copy the destructor */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def241]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/expr.c: scope_hint: In function ‘sqlite3ExprCodeTarget’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/expr.c:2562:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pFarg’
# 2560|           int endCoalesce = sqlite3VdbeMakeLabel(v);
# 2561|           assert( nFarg>=2 );
# 2562|->         sqlite3ExprCode(pParse, pFarg->a[0].pExpr, target);
# 2563|           for(i=1; i<nFarg; i++){
# 2564|             sqlite3VdbeAddOp2(v, OP_NotNull, target, endCoalesce);

Error: CPPCHECK_WARNING (CWE-758): [#def242]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/fkey.c:737: warning[objectIndex]: The address of variable 'iCol' might be accessed at non-zero index.
#  735|       }
#  736|       for(i=0; i<pFKey->nCol; i++){
#  737|->       if( aiCol[i]==pTab->iPKey ){
#  738|           aiCol[i] = -1;
#  739|         }

Error: CPPCHECK_WARNING (CWE-758): [#def243]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/fkey.c:738: warning[objectIndex]: The address of variable 'iCol' might be accessed at non-zero index.
#  736|       for(i=0; i<pFKey->nCol; i++){
#  737|         if( aiCol[i]==pTab->iPKey ){
#  738|->         aiCol[i] = -1;
#  739|         }
#  740|   #ifndef SQLITE_OMIT_AUTHORIZATION

Error: GCC_ANALYZER_WARNING (CWE-476): [#def244]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/fkey.c: scope_hint: In function ‘fkActionTrigger’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/fkey.c:1101:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pStep’
# 1099|       switch( action ){
# 1100|         case OE_Restrict:
# 1101|->         pStep->op = TK_SELECT; 
# 1102|           break;
# 1103|         case OE_Cascade: 

Error: GCC_ANALYZER_WARNING (CWE-476): [#def245]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/fkey.c:1105:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pStep’
# 1103|         case OE_Cascade: 
# 1104|           if( !pChanges ){ 
# 1105|->           pStep->op = TK_DELETE; 
# 1106|             break; 
# 1107|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def246]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/fkey.c:1109:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pStep’
# 1107|           }
# 1108|         default:
# 1109|->         pStep->op = TK_UPDATE;
# 1110|       }
# 1111|       pStep->pTrig = pTrigger;

Error: CPPCHECK_WARNING (CWE-758): [#def247]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/func.c:413: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
#  411|       ** therefore be no less than -9223372036854775807.
#  412|       */
#  413|->     r = -(r ^ (((sqlite3_int64)1)<<63));
#  414|     }
#  415|     sqlite3_result_int64(context, r);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def248]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/insert.c: scope_hint: In function ‘xferOptimization’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/insert.c:1803:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pSrcIdx’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/insert.c:15: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/insert.c:1796:31: note: in expansion of macro ‘ALWAYS’
# 1801|       sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
# 1802|       pKey = sqlite3IndexKeyinfo(pParse, pSrcIdx);
# 1803|->     sqlite3VdbeAddOp4(v, OP_OpenRead, iSrc, pSrcIdx->tnum, iDbSrc,
# 1804|                         (char*)pKey, P4_KEYINFO_HANDOFF);
# 1805|       VdbeComment((v, "%s", pSrcIdx->zName));

Error: CPPCHECK_WARNING (CWE-401): [#def249]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/mem1.c:94: error[memleakOnRealloc]: Common realloc mistake: 'p' nulled but not freed upon failure
#   92|     assert( nByte==ROUND8(nByte) ); /* EV: R-46199-30249 */
#   93|     p--;
#   94|->   p = realloc(p, nByte+8 );
#   95|     if( p ){
#   96|       p[0] = nByte;

Error: GCC_ANALYZER_WARNING (CWE-131): [#def250]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/mem1.c: scope_hint: In function ‘sqlite3MemRealloc’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/mem1.c:94:7: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
#   92|     assert( nByte==ROUND8(nByte) ); /* EV: R-46199-30249 */
#   93|     p--;
#   94|->   p = realloc(p, nByte+8 );
#   95|     if( p ){
#   96|       p[0] = nByte;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def251]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/memjournal.c: scope_hint: In function ‘memjrnlRead’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/memjournal.c:107:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pChunk’
#  105|       nRead -= iSpace;
#  106|       iChunkOffset = 0;
#  107|->   } while( nRead>=0 && (pChunk=pChunk->pNext)!=0 && nRead>0 );
#  108|     p->readpoint.iOffset = iOfst+iAmt;
#  109|     p->readpoint.pChunk = pChunk;

Error: COMPILER_WARNING (CWE-563): [#def252]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/os_unix.c: scope_hint: In function 'posixUnlock'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/os_unix.c:1545:7: warning[-Wunused-but-set-variable]: variable 'h' set but not used
# 1545 |   int h;
#      |       ^
# 1543|     struct flock lock;
# 1544|     int rc = SQLITE_OK;
# 1545|->   int h;
# 1546|   
# 1547|     assert( pFile );

Error: COMPILER_WARNING (CWE-563): [#def253]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/os_unix.c: scope_hint: In function ‘posixUnlock’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/os_unix.c:1545:7: warning[-Wunused-but-set-variable]: variable ‘h’ set but not used
# 1545 |   int h;
#      |       ^
# 1543|     struct flock lock;
# 1544|     int rc = SQLITE_OK;
# 1545|->   int h;
# 1546|   
# 1547|     assert( pFile );

Error: GCC_ANALYZER_WARNING (CWE-465): [#def254]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/resolve.c: scope_hint: In function ‘resolveSelectStep’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/resolve.c:962:10: warning[-Wanalyzer-deref-before-check]: check of ‘p’ for NULL after already dereferencing it
#  960|     nCompound = 0;
#  961|     pLeftmost = p;
#  962|->   while( p ){
#  963|       assert( (p->selFlags & SF_Expanded)!=0 );
#  964|       assert( (p->selFlags & SF_Resolved)==0 );

Error: COMPILER_WARNING (CWE-562): [#def255]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/select.c: scope_hint: In function ‘sqlite3SelectNew’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/select.c:93:10: warning[-Wreturn-local-addr]: function may return address of local variable
#   93 |   return pNew;
#      |          ^~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/select.c:63:10: note: declared here
#   63 |   Select standin;
#      |          ^~~~~~~
#   91|       pNew = 0;
#   92|     }
#   93|->   return pNew;
#   94|   }
#   95|   

Error: CPPCHECK_WARNING (CWE-401): [#def256]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/shell.c:352: error[memleakOnRealloc]: Common realloc mistake: 'zLine' nulled but not freed upon failure
#  350|       if( n+100>nLine ){
#  351|         nLine = nLine*2 + 100;
#  352|->       zLine = realloc(zLine, nLine);
#  353|         if( zLine==0 ) return 0;
#  354|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def257]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/shell.c: scope_hint: In function 'local_getline'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/shell.c:353:9: warning[-Wanalyzer-malloc-leak]: leak of 'zLine'
#  351|         nLine = nLine*2 + 100;
#  352|         zLine = realloc(zLine, nLine);
#  353|->       if( zLine==0 ) return 0;
#  354|       }
#  355|       if( fgets(&zLine[n], nLine - n, in)==0 ){

Error: CPPCHECK_WARNING (CWE-401): [#def258]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/shell.c:372: error[memleakOnRealloc]: Common realloc mistake: 'zLine' nulled but not freed upon failure
#  370|       }
#  371|     }
#  372|->   zLine = realloc( zLine, n+1 );
#  373|     return zLine;
#  374|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def259]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/shell.c:473:10: warning[-Wanalyzer-malloc-leak]: leak of 'find_home_dir()'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/shell.c: scope_hint: In function 'process_sqliterc'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/shell.c: scope_hint: In function 'process_sqliterc'
#  471|   static int strlen30(const char *z){
#  472|     const char *z2 = z;
#  473|->   while( *z2 ){ z2++; }
#  474|     return 0x3fffffff & (int)(z2 - z);
#  475|   }

Error: COMPILER_WARNING (CWE-131): [#def260]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/shell.c: scope_hint: In function 'do_meta_command'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/shell.c:1657:7: warning[-Wmemset-elt-size]: 'memset' used with length equal to number of elements without multiplication by element size
# 1657 |       memset(p->colWidth,0,ArraySize(p->colWidth));
#      |       ^~~~~~
# 1655|         p->mode = MODE_Explain;
# 1656|         p->showHeader = 1;
# 1657|->       memset(p->colWidth,0,ArraySize(p->colWidth));
# 1658|         p->colWidth[0] = 4;                  /* addr */
# 1659|         p->colWidth[1] = 13;                 /* opcode */

Error: COMPILER_WARNING (CWE-569): [#def261]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/shell.c:2148:32: warning[-Wparentheses]: suggest parentheses around '&&' within '||'
# 2148 |     if (nArg == 1 || nArg == 2 && strcmp(azArg[1], ":env:") == 0)
#      |                      ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2146|       open_db(p);
# 2147|   
# 2148|->     if (nArg == 1 || nArg == 2 && strcmp(azArg[1], ":env:") == 0)
# 2149|         rc = bdbSqlEnvStatPrint(p->db, p->out);
# 2150|       else if (nArg == 2 && strcmp(azArg[1], ":rep:") == 0)

Error: CPPCHECK_WARNING (CWE-823): [#def262]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/shell.c:2361: error[arrayIndexOutOfBounds]: Array 'azArg[50]' accessed at index 99, which is out of bounds.
# 2359|       assert( nArg<=ArraySize(azArg) );
# 2360|       for(j=1; j<nArg && j<ArraySize(p->colWidth); j++){
# 2361|->       p->colWidth[j-1] = atoi(azArg[j]);
# 2362|       }
# 2363|     }else

Error: CPPCHECK_WARNING (CWE-562): [#def263]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/table.c:175: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  173|       res.azResult = azNew;
#  174|     }
#  175|->   *pazResult = &res.azResult[1];
#  176|     if( pnColumn ) *pnColumn = res.nColumn;
#  177|     if( pnRow ) *pnRow = res.nRow;

Error: CPPCHECK_WARNING (CWE-401): [#def264]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/tclsqlite.c:960: error[memleakOnRealloc]: Common realloc mistake: 'zLine' nulled but not freed upon failure
#  958|       if( n+100>nLine ){
#  959|         nLine = nLine*2 + 100;
#  960|->       zLine = realloc(zLine, nLine);
#  961|         if( zLine==0 ) return 0;
#  962|       }

Error: CPPCHECK_WARNING (CWE-401): [#def265]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/tclsqlite.c:979: error[memleakOnRealloc]: Common realloc mistake: 'zLine' nulled but not freed upon failure
#  977|       }
#  978|     }
#  979|->   zLine = realloc( zLine, n+1 );
#  980|     return zLine;
#  981|   }

Error: COMPILER_WARNING (CWE-563): [#def266]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/tclsqlite.c: scope_hint: In function 'DbObjCmd'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/tclsqlite.c:2490:11: warning[-Wunused-but-set-variable]: variable 'pKey' set but not used
# 2490 |     void *pKey;
#      |           ^~~~
# 2488|     case DB_REKEY: {
# 2489|       int nKey;
# 2490|->     void *pKey;
# 2491|       if( objc!=3 ){
# 2492|         Tcl_WrongNumArgs(interp, 2, objv, "KEY");

Error: COMPILER_WARNING (CWE-563): [#def267]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/tclsqlite.c: scope_hint: In function 'DbMain'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/tclsqlite.c:2859:9: warning[-Wunused-but-set-variable]: variable 'pKey' set but not used
# 2859 |   void *pKey = 0;
#      |         ^~~~
# 2857|   static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
# 2858|     SqliteDb *p;
# 2859|->   void *pKey = 0;
# 2860|     int nKey = 0;
# 2861|     const char *zArg;

Error: COMPILER_WARNING (CWE-805): [#def268]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/tclsqlite.c: scope_hint: In function 'MD5Final'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/tclsqlite.c:3327:30: warning[-Wsizeof-pointer-memaccess]: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it?
# 3327 |         memset(ctx, 0, sizeof(ctx));    /* In case it is sensitive */
#      |                              ^
# 3325|           byteReverse((unsigned char *)ctx->buf, 4);
# 3326|           memcpy(digest, ctx->buf, 16);
# 3327|->         memset(ctx, 0, sizeof(ctx));    /* In case it is sensitive */
# 3328|   }
# 3329|   

Error: COMPILER_WARNING (CWE-563): [#def269]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c: scope_hint: In function 'test_key'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:669:7: warning[-Wunused-but-set-variable]: variable 'nKey' set but not used
#  669 |   int nKey;
#      |       ^~~~
#  667|     sqlite3 *db;
#  668|     const char *zKey;
#  669|->   int nKey;
#  670|     if( argc!=3 ){
#  671|       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],

Error: COMPILER_WARNING (CWE-563): [#def270]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c: scope_hint: In function 'test_rekey'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:697:7: warning[-Wunused-but-set-variable]: variable 'nKey' set but not used
#  697 |   int nKey;
#      |       ^~~~
#  695|     sqlite3 *db;
#  696|     const char *zKey;
#  697|->   int nKey;
#  698|     if( argc!=3 ){
#  699|       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],

Error: COMPILER_WARNING (CWE-563): [#def271]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:2016:12: warning[-Wunused-but-set-variable]: variable 'db' set but not used
# 2016 |   sqlite3 *db;
#      |            ^~
# 2014|   ){
# 2015|     Tcl_CmdInfo cmdInfo;
# 2016|->   sqlite3 *db;
# 2017|     int rc;
# 2018|     char *zDb;

Error: COMPILER_WARNING (CWE-563): [#def272]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:2019:9: warning[-Wunused-but-set-variable]: variable 'zFile' set but not used
# 2019 |   char *zFile;
#      |         ^~~~~
# 2017|     int rc;
# 2018|     char *zDb;
# 2019|->   char *zFile;
# 2020|     char *zProc = 0;
# 2021|     char *zErr = 0;

Error: COMPILER_WARNING (CWE-563): [#def273]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c: scope_hint: In function 'test_load_extension'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:2020:9: warning[-Wunused-but-set-variable]: variable 'zProc' set but not used
# 2020 |   char *zProc = 0;
#      |         ^~~~~
# 2018|     char *zDb;
# 2019|     char *zFile;
# 2020|->   char *zProc = 0;
# 2021|     char *zErr = 0;
# 2022|   

Error: COMPILER_WARNING (CWE-563): [#def274]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c: scope_hint: In function 'test_enable_load'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:2072:12: warning[-Wunused-but-set-variable]: variable 'db' set but not used
# 2072 |   sqlite3 *db;
#      |            ^~
# 2070|   ){
# 2071|     Tcl_CmdInfo cmdInfo;
# 2072|->   sqlite3 *db;
# 2073|     char *zDb;
# 2074|     int onoff;

Error: COMPILER_WARNING (CWE-563): [#def275]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c: scope_hint: In function 'test_open'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:3804:7: warning[-Wunused-but-set-variable]: variable 'rc' set but not used
# 3804 |   int rc;
#      |       ^~
# 3802|     const char *zFilename;
# 3803|     sqlite3 *db;
# 3804|->   int rc;
# 3805|     char zBuf[100];
# 3806|   

Error: COMPILER_WARNING (CWE-563): [#def276]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c: scope_hint: In function 'test_open16'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:3833:7: warning[-Wunused-but-set-variable]: variable 'rc' set but not used
# 3833 |   int rc;
#      |       ^~
# 3831|     const void *zFilename;
# 3832|     sqlite3 *db;
# 3833|->   int rc;
# 3834|     char zBuf[100];
# 3835|   

Error: CPPCHECK_WARNING (CWE-823): [#def277]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:4298: error[arrayIndexOutOfBounds]: Array 'bigBuf[65536]' accessed at index 262143, which is out of bounds.
# 4296|     int i;
# 4297|     u32 bigBuf[65536];
# 4298|->   for(i=0; i<sizeof(bigBuf); i++) bigBuf[i] = 0xdeadbeef;
# 4299|     sqlite3_stack_baseline = (u8*)&bigBuf[65536];
# 4300|   }

Error: COMPILER_WARNING: [#def278]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:4298:45: warning[-Waggressive-loop-optimizations]: iteration 65536 invokes undefined behavior
# 4298 |   for(i=0; i<sizeof(bigBuf); i++) bigBuf[i] = 0xdeadbeef;
#      |                                   ~~~~~~~~~~^~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:4298:13: note: within this loop
# 4298 |   for(i=0; i<sizeof(bigBuf); i++) bigBuf[i] = 0xdeadbeef;
#      |            ~^~~~~~~~~~~~~~~
# 4296|     int i;
# 4297|     u32 bigBuf[65536];
# 4298|->   for(i=0; i<sizeof(bigBuf); i++) bigBuf[i] = 0xdeadbeef;
# 4299|     sqlite3_stack_baseline = (u8*)&bigBuf[65536];
# 4300|   }

Error: CPPCHECK_WARNING (CWE-562): [#def279]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:4299: error[danglingLifetime]: Non-local variable 'sqlite3_stack_baseline' will use pointer to local variable 'bigBuf'.
# 4297|     u32 bigBuf[65536];
# 4298|     for(i=0; i<sizeof(bigBuf); i++) bigBuf[i] = 0xdeadbeef;
# 4299|->   sqlite3_stack_baseline = (u8*)&bigBuf[65536];
# 4300|   }
# 4301|   

Error: COMPILER_WARNING: [#def280]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c: scope_hint: In function 'prepStack'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:4299:26: warning[-Wdangling-pointer=]: storing the address of local variable 'bigBuf' in 'sqlite3_stack_baseline'
# 4299 |   sqlite3_stack_baseline = (u8*)&bigBuf[65536];
#      |   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:4297:7: note: 'bigBuf' declared here
# 4297 |   u32 bigBuf[65536];
#      |       ^~~~~~
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:4290:12: note: 'sqlite3_stack_baseline' declared here
# 4290 | static u8 *sqlite3_stack_baseline = 0;
#      |            ^~~~~~~~~~~~~~~~~~~~~~
# 4297|     u32 bigBuf[65536];
# 4298|     for(i=0; i<sizeof(bigBuf); i++) bigBuf[i] = 0xdeadbeef;
# 4299|->   sqlite3_stack_baseline = (u8*)&bigBuf[65536];
# 4300|   }
# 4301|   

Error: COMPILER_WARNING (CWE-563): [#def281]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c: scope_hint: In function 'file_control_test'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:4795:7: warning[-Wunused-but-set-variable]: variable 'rc' set but not used
# 4795 |   int rc;
#      |       ^~
# 4793|     int iArg = 0;
# 4794|     sqlite3 *db;
# 4795|->   int rc;
# 4796|   
# 4797|     if( objc!=2 ){

Error: COMPILER_WARNING (CWE-563): [#def282]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c: scope_hint: In function 'file_control_lockproxy_test'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:4943:15: warning[-Wunused-but-set-variable]: variable 'zPwd' set but not used
# 4943 |   const char *zPwd;
#      |               ^~~~
# 4941|   ){
# 4942|     sqlite3 *db;
# 4943|->   const char *zPwd;
# 4944|     int nPwd;
# 4945|     

Error: COMPILER_WARNING (CWE-563): [#def283]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c: scope_hint: In function 'save_prng_state'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test1.c:5098:7: warning[-Wunused-but-set-variable]: variable 'rc' set but not used
# 5098 |   int rc = sqlite3_test_control(9999);
#      |       ^~
# 5096|     Tcl_Obj *CONST objv[]  /* Command arguments */
# 5097|   ){
# 5098|->   int rc = sqlite3_test_control(9999);
# 5099|     assert( rc==0 );
# 5100|     rc = sqlite3_test_control(-1);

Error: COMPILER_WARNING (CWE-563): [#def284]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test2.c:56:12: warning[-Wunused-variable]: 'test_pagesize' defined but not used
#   56 | static int test_pagesize = 1024;
#      |            ^~~~~~~~~~~~~
#   54|   ** Page size and reserved size used for testing.
#   55|   */
#   56|-> static int test_pagesize = 1024;
#   57|   /*
#   58|   ** Usage:   fake_big_file  N  FILENAME

Error: COMPILER_WARNING (CWE-563): [#def285]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test5.c: scope_hint: In function 'test_value_overhead'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test5.c:67:15: warning[-Wunused-but-set-variable]: variable 'zVal' set but not used
#   67 |   const char *zVal;
#      |               ^~~~
#   65|     int i;
#   66|     Mem val;
#   67|->   const char *zVal;
#   68|   
#   69|     if( objc!=3 ){

Error: CPPCHECK_WARNING (CWE-758): [#def286]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test8.c:899: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  897|       /* Approximation of log2(nRow). */
#  898|       for( ii=0; ii<(sizeof(int)*8); ii++ ){
#  899|->       if( nRow & (1<<ii) ){
#  900|           pIdxInfo->estimatedCost = (double)ii;
#  901|         }

Error: COMPILER_WARNING (CWE-252): [#def287]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_demovfs.c: scope_hint: In function 'demoFullPathname'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_demovfs.c:541:5: warning[-Wunused-result]: ignoring return value of 'getcwd' declared with attribute 'warn_unused_result'
#  541 |     getcwd(zDir, sizeof(zDir));
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
#  539|       zDir[0] = '\0';
#  540|     }else{
#  541|->     getcwd(zDir, sizeof(zDir));
#  542|     }
#  543|     zDir[MAXPATHNAME] = '\0';

Error: COMPILER_WARNING (CWE-805): [#def288]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_init.c: scope_hint: In function 'init_wrapper_uninstall'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_init.c:217:29: warning[-Wsizeof-pointer-memaccess]: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to remove the addressof?
#  217 |   memset(&wrapped, 0, sizeof(&wrapped));
#      |                             ^
#  215|     }
#  216|   
#  217|->   memset(&wrapped, 0, sizeof(&wrapped));
#  218|     sqlite3_shutdown();
#  219|     sqlite3_config(SQLITE_CONFIG_MUTEX, &wrapped.mutex);

Error: COMPILER_WARNING (CWE-563): [#def289]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_journal.c: scope_hint: In function 'readJournalFile'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_journal.c:483:19: warning[-Wunused-variable]: unused variable 'cksum'
#  483 |               u32 cksum = genCksum(aPage, pMain->nPagesize);
#      |                   ^~~~~
#  481|               rc = sqlite3OsRead(pReal, aPage, pMain->nPagesize, iOff+4);
#  482|               if( rc==SQLITE_OK ){
#  483|->               u32 cksum = genCksum(aPage, pMain->nPagesize);
#  484|                 assert( cksum==pMain->aCksum[pgno-1] );
#  485|               }

Error: COMPILER_WARNING (CWE-563): [#def290]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_journal.c: scope_hint: In function 'jtWrite'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_journal.c:553:11: warning[-Wunused-variable]: unused variable 'pgno'
#  553 |       u32 pgno = (u32)(iOfst/p->nPagesize + 1);
#      |           ^~~~
#  551|         */
#  552|       }else{
#  553|->       u32 pgno = (u32)(iOfst/p->nPagesize + 1);
#  554|         assert( (iAmt==1||iAmt==p->nPagesize) && ((iOfst+iAmt)%p->nPagesize)==0 );
#  555|         assert( pgno<=p->nPage || p->nSync>0 );

Error: COMPILER_WARNING (CWE-563): [#def291]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_journal.c: scope_hint: In function 'jtTruncate'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_journal.c:581:9: warning[-Wunused-variable]: unused variable 'locking_page'
#  581 |     u32 locking_page = (u32)(PENDING_BYTE/p->nPagesize+1);
#      |         ^~~~~~~~~~~~
#  579|     if( p->flags&SQLITE_OPEN_MAIN_DB && p->pWritable ){
#  580|       u32 pgno;
#  581|->     u32 locking_page = (u32)(PENDING_BYTE/p->nPagesize+1);
#  582|       for(pgno=(u32)(size/p->nPagesize+1); pgno<=p->nPage; pgno++){
#  583|         assert( pgno==locking_page || sqlite3BitvecTest(p->pWritable, pgno) );

Error: COMPILER_WARNING (CWE-563): [#def292]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_malloc.c: scope_hint: In function 'test_memdebug_settitle'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_malloc.c:716:15: warning[-Wunused-but-set-variable]: variable 'zTitle' set but not used
#  716 |   const char *zTitle;
#      |               ^~~~~~
#  714|     Tcl_Obj *CONST objv[]
#  715|   ){
#  716|->   const char *zTitle;
#  717|     if( objc!=2 ){
#  718|       Tcl_WrongNumArgs(interp, 1, objv, "TITLE");

Error: COMPILER_WARNING (CWE-563): [#def293]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_malloc.c: scope_hint: In function 'test_config_lookaside'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_malloc.c:1036:7: warning[-Wunused-but-set-variable]: variable 'rc' set but not used
# 1036 |   int rc;
#      |       ^~
# 1034|     Tcl_Obj *CONST objv[]
# 1035|   ){
# 1036|->   int rc;
# 1037|     int sz, cnt;
# 1038|     Tcl_Obj *pRet;

Error: COMPILER_WARNING (CWE-563): [#def294]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_malloc.c: scope_hint: In function 'test_config_heap'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_malloc.c:1109:14: warning[-Wunused-but-set-variable]: variable 'szBuf' set but not used
# 1109 |   static int szBuf;  /* Bytes allocated for zBuf */
#      |              ^~~~~
# 1107|   ){
# 1108|     static char *zBuf; /* Use this memory */
# 1109|->   static int szBuf;  /* Bytes allocated for zBuf */
# 1110|     int nByte;         /* Size of buffer to pass to sqlite3_config() */
# 1111|     int nMinAlloc;     /* Size of minimum allocation */

Error: CPPCHECK_WARNING (CWE-401): [#def295]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_malloc.c:1130: error[memleakOnRealloc]: Common realloc mistake: 'zBuf' nulled but not freed upon failure
# 1128|       rc = sqlite3_config(SQLITE_CONFIG_HEAP, (void*)0, 0, 0);
# 1129|     }else{
# 1130|->     zBuf = realloc(zBuf, nByte);
# 1131|       szBuf = nByte;
# 1132|       rc = sqlite3_config(SQLITE_CONFIG_HEAP, zBuf, nByte, nMinAlloc);

Error: COMPILER_WARNING (CWE-704): [#def296]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_malloc.c: scope_hint: In function 'test_dump_memsys3'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_malloc.c:1196:11: warning[-Wpointer-to-int-cast]: cast from pointer to integer of different size
# 1196 |   switch( (int)clientData ){
#      |           ^
# 1194|     }
# 1195|   
# 1196|->   switch( (int)clientData ){
# 1197|       case 3: {
# 1198|   #ifdef SQLITE_ENABLE_MEMSYS3

Error: COMPILER_WARNING (CWE-704): [#def297]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_malloc.c: scope_hint: In function 'Sqlitetest_malloc_Init'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_malloc.c:1433:20: warning[-Wint-to-pointer-cast]: cast to pointer from integer of different size
# 1433 |     ClientData c = (ClientData)aObjCmd[i].clientData;
#      |                    ^
# 1431|     int i;
# 1432|     for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){
# 1433|->     ClientData c = (ClientData)aObjCmd[i].clientData;
# 1434|       Tcl_CreateObjCommand(interp, aObjCmd[i].zName, aObjCmd[i].xProc, c, 0);
# 1435|     }

Error: COMPILER_WARNING (CWE-563): [#def298]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_pcache.c: scope_hint: In function 'testpcacheCachesize'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_pcache.c:162:15: warning[-Wunused-variable]: unused variable 'p'
#  162 |   testpcache *p = (testpcache*)pCache;
#      |               ^
#  160|   */
#  161|   static void testpcacheCachesize(sqlite3_pcache *pCache, int newSize){
#  162|->   testpcache *p = (testpcache*)pCache;
#  163|     assert( p->iMagic==TESTPCACHE_VALID );
#  164|     assert( newSize>=1 );

Error: COMPILER_WARNING (CWE-563): [#def299]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_thread.c:276:9: warning[-Wunused-but-set-variable]: variable 'pKey' set but not used
#  276 |   void *pKey = 0;
#      |         ^~~~
#  274|     const char *zFilename;
#  275|     sqlite3 *db;
#  276|->   void *pKey = 0;
#  277|     int nKey = 0;
#  278|     char *zErrMsg;

Error: COMPILER_WARNING (CWE-563): [#def300]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_thread.c:278:9: warning[-Wunused-variable]: unused variable 'zErrMsg'
#  278 |   char *zErrMsg;
#      |         ^~~~~~~
#  276|     void *pKey = 0;
#  277|     int nKey = 0;
#  278|->   char *zErrMsg;
#  279|     int rc;
#  280|     char zBuf[100];

Error: COMPILER_WARNING (CWE-563): [#def301]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_thread.c: scope_hint: In function 'sqlthread_open'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_thread.c:279:7: warning[-Wunused-but-set-variable]: variable 'rc' set but not used
#  279 |   int rc;
#      |       ^~
#  277|     int nKey = 0;
#  278|     char *zErrMsg;
#  279|->   int rc;
#  280|     char zBuf[100];
#  281|     extern void Md5_Register(sqlite3*);

Error: COMPILER_WARNING (CWE-704): [#def302]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_thread.c: scope_hint: In function 'sqlthread_id'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_thread.c:322:42: warning[-Wpointer-to-int-cast]: cast from pointer to integer of different size
#  322 |   Tcl_SetObjResult(interp, Tcl_NewIntObj((int)id));
#      |                                          ^
#  320|   ){
#  321|     Tcl_ThreadId id = Tcl_GetCurrentThread();
#  322|->   Tcl_SetObjResult(interp, Tcl_NewIntObj((int)id));
#  323|     UNUSED_PARAMETER(clientData);
#  324|     UNUSED_PARAMETER(objc);

Error: COMPILER_WARNING (CWE-457): [#def303]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_vfs.c: scope_hint: In function 'tvfsSync'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_vfs.c:440:5: warning[-Wmaybe-uninitialized]: 'zFlags' may be used uninitialized
#  440 |     tvfsExecTcl(p, "xSync",
#      |     ^~~~~~~~~~~~~~~~~~~~~~~
#  441 |         Tcl_NewStringObj(pFd->zFilename, -1), pFd->pShmId,
#      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  442 |         Tcl_NewStringObj(zFlags, -1)
#      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  443 |     );
#      |     ~
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/test_vfs.c:421:11: note: 'zFlags' was declared here
#  421 |     char *zFlags;
#      |           ^~~~~~
#  438|       }
#  439|   
#  440|->     tvfsExecTcl(p, "xSync", 
#  441|           Tcl_NewStringObj(pFd->zFilename, -1), pFd->pShmId,
#  442|           Tcl_NewStringObj(zFlags, -1)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def304]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/update.c: scope_hint: In function ‘sqlite3Update’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/update.c:257:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘aRegIdx’
#  255|         }
#  256|       }
#  257|->     aRegIdx[j] = reg;
#  258|     }
#  259|   

Error: COMPILER_WARNING (CWE-563): [#def305]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/utf.c:514:19: warning[-Wunused-but-set-variable]: variable 't' set but not used
#  514 |   unsigned int i, t;
#      |                   ^
#  512|   */
#  513|   void sqlite3UtfSelfTest(void){
#  514|->   unsigned int i, t;
#  515|     unsigned char zBuf[20];
#  516|     unsigned char *z;

Error: COMPILER_WARNING (CWE-563): [#def306]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/utf.c: scope_hint: In function 'sqlite3UtfSelfTest'
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/utf.c:517:7: warning[-Wunused-but-set-variable]: variable 'n' set but not used
#  517 |   int n;
#      |       ^
#  515|     unsigned char zBuf[20];
#  516|     unsigned char *z;
#  517|->   int n;
#  518|     unsigned int c;
#  519|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def307]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c: scope_hint: In function ‘sqlite3VdbeExec’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:900:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pOut’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:585:3: note: in expansion of macro ‘CHECK_FOR_INTERRUPT’
#  898|   */
#  899|   case OP_Real: {            /* same as TK_FLOAT, out2-prerelease */
#  900|->   pOut->flags = MEM_Real;
#  901|     assert( !sqlite3IsNaN(*pOp->p4.pReal) );
#  902|     pOut->r = *pOp->p4.pReal;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def308]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:924:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pOut’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:585:3: note: in expansion of macro ‘CHECK_FOR_INTERRUPT’
#  922|       assert( pOut->zMalloc==pOut->z );
#  923|       assert( pOut->flags & MEM_Dyn );
#  924|->     pOut->zMalloc = 0;
#  925|       pOut->flags |= MEM_Static;
#  926|       pOut->flags &= ~MEM_Dyn;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def309]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:947:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pOut’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:585:3: note: in expansion of macro ‘CHECK_FOR_INTERRUPT’
#  945|   case OP_String: {          /* out2-prerelease */
#  946|     assert( pOp->p4.z!=0 );
#  947|->   pOut->flags = MEM_Str|MEM_Static|MEM_Term;
#  948|     pOut->z = pOp->p4.z;
#  949|     pOut->n = pOp->p1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def310]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:960:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pOut’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:585:3: note: in expansion of macro ‘CHECK_FOR_INTERRUPT’
#  958|   */
#  959|   case OP_Null: {           /* out2-prerelease */
#  960|->   pOut->flags = MEM_Null;
#  961|     break;
#  962|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def311]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:973:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pOut’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:585:3: note: in expansion of macro ‘CHECK_FOR_INTERRUPT’
#  971|     assert( pOp->p1 <= SQLITE_MAX_LENGTH );
#  972|     sqlite3VdbeMemSetStr(pOut, pOp->p4.z, pOp->p1, 0, 0);
#  973|->   pOut->enc = encoding;
#  974|     UPDATE_MAX_BLOBSIZE(pOut);
#  975|     break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def312]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:4138:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pOut’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:585:3: note: in expansion of macro ‘CHECK_FOR_INTERRUPT’
# 4136|     assert( pC->pseudoTableReg==0 );
# 4137|     if( pC->nullRow ){
# 4138|->     pOut->flags = MEM_Null;
# 4139|       break;
# 4140|     }else if( pC->deferredMoveto ){

Error: GCC_ANALYZER_WARNING (CWE-476): [#def313]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:4424:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pOut’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:585:3: note: in expansion of macro ‘CHECK_FOR_INTERRUPT’
# 4422|     assert( pC!=0 );
# 4423|     pCrsr = pC->pCursor;
# 4424|->   pOut->flags = MEM_Null;
# 4425|     if( ALWAYS(pCrsr!=0) ){
# 4426|       rc = sqlite3VdbeCursorMoveto(pC);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def314]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:4542:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pOut’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbe.c:585:3: note: in expansion of macro ‘CHECK_FOR_INTERRUPT’
# 4540|     iCnt = db->activeVdbeCnt;
# 4541|   #endif
# 4542|->   pOut->flags = MEM_Null;
# 4543|     if( iCnt>1 ){
# 4544|       rc = SQLITE_LOCKED;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def315]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbeaux.c: scope_hint: In function ‘sqlite3VdbeIdxRowid’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbeaux.c:3064:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘v.u.i’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbeaux.c:17: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/sqliteInt.h:2909:35: note: in definition of macro ‘getVarint32’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbeaux.c:3035:9: note: in expansion of macro ‘getVarint32’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/sqliteInt.h:2909:35: note: in definition of macro ‘getVarint32’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vdbeaux.c:3044:9: note: in expansion of macro ‘getVarint32’
# 3062|     /* Fetch the integer off the end of the index record */
# 3063|     sqlite3VdbeSerialGet((u8*)&m.z[m.n-lenRowid], typeRowid, &v);
# 3064|->   *rowid = v.u.i;
# 3065|     sqlite3VdbeMemRelease(&m);
# 3066|     return SQLITE_OK;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def316]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vtab.c: scope_hint: In function ‘sqlite3VtabCallDestroy’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vtab.c:710:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  708|   
#  709|       assert( rc==SQLITE_OK );
#  710|->     rc = p->pMod->pModule->xDestroy(p->pVtab);
#  711|   
#  712|       /* Remove the sqlite3_vtab* from the aVTrans[] array, if applicable */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def317]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vtab.c: scope_hint: In function ‘sqlite3VtabOverloadFunction’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vtab.c:878:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  876|     if( NEVER(pTab==0) ) return pDef;
#  877|     if( (pTab->tabFlags & TF_Virtual)==0 ) return pDef;
#  878|->   pVtab = sqlite3GetVTable(db, pTab)->pVtab;
#  879|     assert( pVtab!=0 );
#  880|     assert( pVtab->pModule!=0 );

Error: GCC_ANALYZER_WARNING (CWE-476): [#def318]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vtab.c: scope_hint: In function ‘sqlite3VtabOverloadFunction’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vtab.c:878:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pVtab’
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/src/vtab.c: scope_hint: In function ‘sqlite3VtabOverloadFunction’
#  876|     if( NEVER(pTab==0) ) return pDef;
#  877|     if( (pTab->tabFlags & TF_Virtual)==0 ) return pDef;
#  878|->   pVtab = sqlite3GetVTable(db, pTab)->pVtab;
#  879|     assert( pVtab!=0 );
#  880|     assert( pVtab->pModule!=0 );

Error: CPPCHECK_WARNING (CWE-404): [#def319]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/tool/lemon.c:2545: error[resourceLeak]: Resource leak: fp
# 2543|         filesize+1);
# 2544|       gp->errorcnt++;
# 2545|->     return;
# 2546|     }
# 2547|     if( fread(filebuf,1,filesize,fp)!=filesize ){

Error: CPPCHECK_WARNING (CWE-404): [#def320]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/tool/lemon.c:2552: error[resourceLeak]: Resource leak: fp
# 2550|       free(filebuf);
# 2551|       gp->errorcnt++;
# 2552|->     return;
# 2553|     }
# 2554|     fclose(fp);

Error: CPPCHECK_WARNING (CWE-401): [#def321]
libdb-5.3.28-build/db-5.3.28/lang/sql/sqlite/tool/lemon.c:3274: error[memleakOnRealloc]: Common realloc mistake: 'z' nulled but not freed upon failure
# 3272|     if( (int) (n+sizeof(zInt)*2+used) >= alloced ){
# 3273|       alloced = n + sizeof(zInt)*2 + used + 200;
# 3274|->     z = (char *) realloc(z,  alloced);
# 3275|     }
# 3276|     if( z==0 ) return empty;

Error: COMPILER_WARNING: [#def322]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db.c: scope_hint: In function 'tcl_DbGetFlags'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db.c:3711:47: warning[-Wstringop-overflow=]: 'strncat' specified bound 512 equals destination size
# 3709|   			if (LF_ISSET(db_flags[i].flag)) {
# 3710|   				if (strlen(buf) > 0)
# 3711|-> 					(void)strncat(buf, " ", sizeof(buf));
# 3712|   				(void)strncat(
# 3713|   				    buf, db_flags[i].arg, sizeof(buf));

Error: COMPILER_WARNING: [#def323]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db.c:3712:39: warning[-Wstringop-overflow=]: 'strncat' specified bound 512 equals destination size
# 3710|   				if (strlen(buf) > 0)
# 3711|   					(void)strncat(buf, " ", sizeof(buf));
# 3712|-> 				(void)strncat(
# 3713|   				    buf, db_flags[i].arg, sizeof(buf));
# 3714|   			}

Error: COMPILER_WARNING: [#def324]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db.c:3712:39: warning[-Wstringop-truncation]: '__strncat_chk' specified bound 512 equals destination size
# 3712 |                                 (void)strncat(
#      |                                       ^
# 3710|   				if (strlen(buf) > 0)
# 3711|   					(void)strncat(buf, " ", sizeof(buf));
# 3712|-> 				(void)strncat(
# 3713|   				    buf, db_flags[i].arg, sizeof(buf));
# 3714|   			}

Error: COMPILER_WARNING: [#def325]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db.c: scope_hint: In function 'tcl_DbGetOpenFlags'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db.c:3767:47: warning[-Wstringop-overflow=]: 'strncat' specified bound 512 equals destination size
# 3765|   			if (LF_ISSET(open_flags[i].flag)) {
# 3766|   				if (strlen(buf) > 0)
# 3767|-> 					(void)strncat(buf, " ", sizeof(buf));
# 3768|   				(void)strncat(
# 3769|   				    buf, open_flags[i].arg, sizeof(buf));

Error: COMPILER_WARNING: [#def326]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db.c:3768:39: warning[-Wstringop-overflow=]: 'strncat' specified bound 512 equals destination size
# 3766|   				if (strlen(buf) > 0)
# 3767|   					(void)strncat(buf, " ", sizeof(buf));
# 3768|-> 				(void)strncat(
# 3769|   				    buf, open_flags[i].arg, sizeof(buf));
# 3770|   			}

Error: COMPILER_WARNING: [#def327]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db.c: scope_hint: In function 'db_Cmd'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db.c:3768:39: warning[-Wstringop-truncation]: '__strncat_chk' specified bound 512 equals destination size
# 3768 |                                 (void)strncat(
#      |                                       ^
# 3766|   				if (strlen(buf) > 0)
# 3767|   					(void)strncat(buf, " ", sizeof(buf));
# 3768|-> 				(void)strncat(
# 3769|   				    buf, open_flags[i].arg, sizeof(buf));
# 3770|   			}

Error: COMPILER_WARNING (CWE-252): [#def328]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c: scope_hint: In function 'Db_tcl_Init'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c:95:15: warning[-Wunused-result]: ignoring return value of 'setuid' declared with attribute 'warn_unused_result'
#   95 |         (void)setuid(getuid());
#      |               ^~~~~~~~~~~~~~~~
#   93|   	 */
#   94|   #if defined(HAVE_SETUID) && defined(HAVE_GETUID)
#   95|-> 	(void)setuid(getuid());
#   96|   #endif
#   97|   #if defined(HAVE_SETGID) && defined(HAVE_GETGID)

Error: COMPILER_WARNING (CWE-252): [#def329]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c:98:15: warning[-Wunused-result]: ignoring return value of 'setgid' declared with attribute 'warn_unused_result'
#   98 |         (void)setgid(getgid());
#      |               ^~~~~~~~~~~~~~~~
#   96|   #endif
#   97|   #if defined(HAVE_SETGID) && defined(HAVE_GETGID)
#   98|-> 	(void)setgid(getgid());
#   99|   #endif
#  100|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def330]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c: scope_hint: In function 'bdb_DbRename'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c:3751:28: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dbenv'
# 3749|   	_debug_check();
# 3750|   	if (dbp == NULL)
# 3751|-> 		ret = dbenv->dbrename(dbenv, txn, db, subdb, newname, iflags);
# 3752|   	else
# 3753|   		ret = dbp->rename(dbp, db, subdb, newname, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def331]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c: scope_hint: In function 'bdb_DbVerify'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c:4150:33: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dbenv'
/usr/include/tcl.h:2424: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c:13: included_from: Included from here.
# 4148|   			 */
# 4149|   			if (errpfx != NULL)
# 4150|-> 				__os_free(dbenv->env, errpfx);
# 4151|   			if ((ret = __os_strdup(NULL, arg, &errpfx)) != 0) {
# 4152|   				result = _ReturnSetup(interp, ret,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def332]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c:4200:36: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dbenv'
# 4198|   			subdbtmp =
# 4199|   			    Tcl_GetByteArrayFromObj(objv[i++], &subdblen);
# 4200|-> 			if ((ret = __os_malloc(dbenv->env,
# 4201|   			   (size_t)subdblen + 1, &subdb)) != 0) {
# 4202|   				Tcl_SetResult(interp, db_strerror(ret),

Error: GCC_ANALYZER_WARNING (CWE-476): [#def333]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c:4278:17: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dbenv'
# 4276|   		(void)fclose(errf);
# 4277|   	if (errpfx != NULL)
# 4278|-> 		__os_free(dbenv->env, errpfx);
# 4279|   	if (subdb != NULL)
# 4280|   		__os_free(dbenv->env, subdb);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def334]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c:4280:17: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dbenv'
# 4278|   		__os_free(dbenv->env, errpfx);
# 4279|   	if (subdb != NULL)
# 4280|-> 		__os_free(dbenv->env, subdb);
# 4281|   	if (dbp)
# 4282|   		(void)dbp->close(dbp, 0);

Error: COMPILER_WARNING (CWE-805): [#def335]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c: scope_hint: In function 'tcl_db_malloc'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c:4997:33: warning[-Wsizeof-pointer-memaccess]: argument to 'sizeof' in 'memcpy' call is the same expression as the source; did you mean to remove the addressof?
# 4997 |         memcpy(buf, &obj, sizeof(&obj));
#      |                                 ^
# 4995|   	Tcl_SetObjLength(obj, (int)(size + sizeof(Tcl_Obj *)));
# 4996|   	buf = Tcl_GetString(obj);
# 4997|-> 	memcpy(buf, &obj, sizeof(&obj));
# 4998|   
# 4999|   	buf = (Tcl_Obj **)buf + 1;

Error: COMPILER_WARNING (CWE-805): [#def336]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c: scope_hint: In function 'tcl_db_realloc'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_db_pkg.c:5017:33: warning[-Wsizeof-pointer-memaccess]: argument to 'sizeof' in 'memcpy' call is the same expression as the source; did you mean to remove the addressof?
# 5017 |         memcpy(ptr, &obj, sizeof(&obj));
#      |                                 ^
# 5015|   
# 5016|   	ptr = Tcl_GetString(obj);
# 5017|-> 	memcpy(ptr, &obj, sizeof(&obj));
# 5018|   
# 5019|   	ptr = (Tcl_Obj **)ptr + 1;

Error: COMPILER_WARNING: [#def337]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_env.c: scope_hint: In function 'env_GetFlags'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_env.c:2867:47: warning[-Wstringop-overflow=]: 'strncat' specified bound 512 equals destination size
# 2865|   			if (LF_ISSET(open_flags[i].flag)) {
# 2866|   				if (strlen(buf) > 0)
# 2867|-> 					(void)strncat(buf, " ", sizeof(buf));
# 2868|   				(void)strncat(
# 2869|   				    buf, open_flags[i].arg, sizeof(buf));

Error: COMPILER_WARNING: [#def338]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_env.c:2868:39: warning[-Wstringop-overflow=]: 'strncat' specified bound 512 equals destination size
# 2866|   				if (strlen(buf) > 0)
# 2867|   					(void)strncat(buf, " ", sizeof(buf));
# 2868|-> 				(void)strncat(
# 2869|   				    buf, open_flags[i].arg, sizeof(buf));
# 2870|   			}

Error: COMPILER_WARNING: [#def339]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_env.c:2868:39: warning[-Wstringop-truncation]: '__strncat_chk' specified bound 512 equals destination size
# 2868 |                                 (void)strncat(
#      |                                       ^
# 2866|   				if (strlen(buf) > 0)
# 2867|   					(void)strncat(buf, " ", sizeof(buf));
# 2868|-> 				(void)strncat(
# 2869|   				    buf, open_flags[i].arg, sizeof(buf));
# 2870|   			}

Error: COMPILER_WARNING: [#def340]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_env.c: scope_hint: In function 'env_GetOpenFlag'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_env.c:2933:47: warning[-Wstringop-overflow=]: 'strncat' specified bound 512 equals destination size
# 2931|   			if (LF_ISSET(open_flags[i].flag)) {
# 2932|   				if (strlen(buf) > 0)
# 2933|-> 					(void)strncat(buf, " ", sizeof(buf));
# 2934|   				(void)strncat(
# 2935|   				    buf, open_flags[i].arg, sizeof(buf));

Error: COMPILER_WARNING: [#def341]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_env.c:2934:39: warning[-Wstringop-overflow=]: 'strncat' specified bound 512 equals destination size
# 2932|   				if (strlen(buf) > 0)
# 2933|   					(void)strncat(buf, " ", sizeof(buf));
# 2934|-> 				(void)strncat(
# 2935|   				    buf, open_flags[i].arg, sizeof(buf));
# 2936|   			}

Error: COMPILER_WARNING: [#def342]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_env.c: scope_hint: In function 'env_Cmd'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_env.c:2934:39: warning[-Wstringop-truncation]: '__strncat_chk' specified bound 512 equals destination size
# 2934 |                                 (void)strncat(
#      |                                       ^
# 2932|   				if (strlen(buf) > 0)
# 2933|   					(void)strncat(buf, " ", sizeof(buf));
# 2934|-> 				(void)strncat(
# 2935|   				    buf, open_flags[i].arg, sizeof(buf));
# 2936|   			}

Error: COMPILER_WARNING: [#def343]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_env.c: scope_hint: In function 'tcl_EnvGetEncryptFlags'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_env.c:2985:47: warning[-Wstringop-overflow=]: 'strncat' specified bound 512 equals destination size
# 2983|   			if (LF_ISSET(encrypt_flags[i].flag)) {
# 2984|   				if (strlen(buf) > 0)
# 2985|-> 					(void)strncat(buf, " ", sizeof(buf));
# 2986|   				(void)strncat(
# 2987|   				    buf, encrypt_flags[i].arg, sizeof(buf));

Error: COMPILER_WARNING: [#def344]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_env.c: scope_hint: In function 'tcl_EnvGetEncryptFlags.part.0'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_env.c:2986:39: warning[-Wstringop-overflow=]: 'strncat' specified bound 512 equals destination size
# 2984|   				if (strlen(buf) > 0)
# 2985|   					(void)strncat(buf, " ", sizeof(buf));
# 2986|-> 				(void)strncat(
# 2987|   				    buf, encrypt_flags[i].arg, sizeof(buf));
# 2988|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def345]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_internal.c: scope_hint: In function '_SetMultiList'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_internal.c:444:52: warning[-Wanalyzer-null-dereference]: dereference of NULL 'hsdbp'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:88: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_internal.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_internal.c:100:9: note: in expansion of macro 'LIST_FOREACH'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:85: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_internal.c:417:9: note: in expansion of macro 'DB_MULTIPLE_INIT'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_internal.c:431:33: note: in expansion of macro 'DB_MULTIPLE_KEY_NEXT'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_internal.c:431:33: note: in expansion of macro 'DB_MULTIPLE_KEY_NEXT'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_internal.c:431:33: note: in expansion of macro 'DB_MULTIPLE_KEY_NEXT'
#  442|   					hkey.data = kp;
#  443|   					hkey.size = klen;
#  444|-> 					ret = hsdbp->pget(hsdbp, txn,
#  445|   					    &hkey, &rkey, &rdata, 0);
#  446|   					result = _ReturnSetup(interp,

Error: COMPILER_WARNING (CWE-563): [#def346]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_internal.c: scope_hint: In function '_GetFlagsList'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_internal.c:809:13: warning[-Wunused-but-set-variable]: variable 'result' set but not used
#  809 |         int result;
#      |             ^~~~~~
#  807|   {
#  808|   	Tcl_Obj *newlist, *newobj;
#  809|-> 	int result;
#  810|   
#  811|   	newlist = Tcl_NewObj();

Error: GCC_ANALYZER_WARNING (CWE-688): [#def347]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_lock.c: scope_hint: In function '_LockPutInfo'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_lock.c:786:25: warning[-Wanalyzer-null-argument]: use of NULL 'otmp' where non-null expected
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:71: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_lock.c:11: included_from: Included from here.
/usr/include/string.h:64:12: note: argument 2 of 'memcmp' must be non-null
#  784|   		    (op == DB_LOCK_PUT_ALL && p->i_locker == lockid) ||
#  785|   		    (op == DB_LOCK_PUT_OBJ && p->i_lockobj.data &&
#  786|-> 			memcmp(p->i_lockobj.data, objp->data, objp->size) == 0))
#  787|   			found = 1;
#  788|   		if (found) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def348]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_seq.c:16: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_seq.c: scope_hint: In function 'seq_Cmd'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_seq.c:159:69: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dbip'
libdb-5.3.28-build/db-5.3.28/src/dbinc/tcl_db.h:188:37: note: in definition of macro 'NewStringObj'
/usr/include/tcl.h:2424: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_seq.c:14: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/dbinc/tcl_db.h:188:37: note: in definition of macro 'NewStringObj'
libdb-5.3.28-build/db-5.3.28/src/dbinc/tcl_db.h:188:37: note: in definition of macro 'NewStringObj'
#  157|   		if ((result = _ReturnSetup(interp, ret,
#  158|   		    DB_RETOK_STD(ret), "sequence get_db")) == TCL_OK)
#  159|-> 			res = NewStringObj(dbip->i_name, strlen(dbip->i_name));
#  160|   		break;
#  161|   	case SEQGETKEY:

Error: COMPILER_WARNING: [#def349]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_seq.c: scope_hint: In function 'tcl_SeqGetFlags'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_seq.c:558:47: warning[-Wstringop-overflow=]: 'strncat' specified bound 512 equals destination size
#  556|   			if (LF_ISSET(seq_flags[i].flag)) {
#  557|   				if (strlen(buf) > 0)
#  558|-> 					(void)strncat(buf, " ", sizeof(buf));
#  559|   				(void)strncat(
#  560|   				    buf, seq_flags[i].arg, sizeof(buf));

Error: COMPILER_WARNING: [#def350]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_seq.c:559:39: warning[-Wstringop-overflow=]: 'strncat' specified bound 512 equals destination size
#  557|   				if (strlen(buf) > 0)
#  558|   					(void)strncat(buf, " ", sizeof(buf));
#  559|-> 				(void)strncat(
#  560|   				    buf, seq_flags[i].arg, sizeof(buf));
#  561|   			}

Error: COMPILER_WARNING: [#def351]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_seq.c: scope_hint: In function 'seq_Cmd'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_seq.c:559:39: warning[-Wstringop-truncation]: '__strncat_chk' specified bound 512 equals destination size
#  559 |                                 (void)strncat(
#      |                                       ^
#  557|   				if (strlen(buf) > 0)
#  558|   					(void)strncat(buf, " ", sizeof(buf));
#  559|-> 				(void)strncat(
#  560|   				    buf, seq_flags[i].arg, sizeof(buf));
#  561|   			}

Error: GCC_ANALYZER_WARNING (CWE-674): [#def352]
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_txn.c: scope_hint: In function '_TxnInfoDelete'
libdb-5.3.28-build/db-5.3.28/lang/tcl/tcl_txn.c:44:25: warning[-Wanalyzer-infinite-recursion]: infinite recursion
#   42|   		nextp = LIST_NEXT(p, entries);
#   43|   		if (p->i_parent == txnip && p->i_type == I_TXN) {
#   44|-> 			_TxnInfoDelete(interp, p);
#   45|   			(void)Tcl_DeleteCommand(interp, p->i_name);
#   46|   			_DeleteInfo(p);

Error: CPPCHECK_WARNING (CWE-682): [#def353]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:265: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  263|   		}
#  264|   		next_recno += NUM_ENT(pg);
#  265|-> 		if (P_FREESPACE(dbp, pg) > factor ||
#  266|   		     (check_trunc && PGNO(pg) > c_data->compact_truncate))
#  267|   			break;

Error: CPPCHECK_WARNING (CWE-682): [#def354]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:592: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  590|   		 */
#  591|   
#  592|-> 		if (P_FREESPACE(dbp, pg) <= factor ||
#  593|   		     cp->csp[-1].indx != NUM_ENT(cp->csp[-1].page) - 1)
#  594|   			goto next_page;

Error: CPPCHECK_WARNING (CWE-682): [#def355]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:707: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  705|   
#  706|   		/* After re-locking check to see if we still need to fill. */
#  707|-> 		if (P_FREESPACE(dbp, pg) <= factor) {
#  708|   			if (check_trunc &&
#  709|   			    PGNO(pg) > c_data->compact_truncate) {

Error: CPPCHECK_WARNING (CWE-682): [#def356]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:770: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  768|   	/* Fetch pages until we fill this one. */
#  769|   	while (!isdone && npgno != PGNO_INVALID &&
#  770|-> 	     P_FREESPACE(dbp, pg) > factor && c_data->compact_pages != 0) {
#  771|   		/*
#  772|   		 * merging may have to free the parent page, if it does,

Error: CPPCHECK_WARNING (CWE-682): [#def357]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:1074: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1072|   	if ((dbc->dbtype == DB_BTREE &&
# 1073|   	    ncp->csp[-1].indx == 0 && ncp->csp[-1].entries != 1) ||
# 1074|-> 	    (int)(P_FREESPACE(dbp, pg) -
# 1075|   	    ((dbp->pgsize - P_OVERHEAD(dbp)) -
# 1076|   	    P_FREESPACE(dbp, npg))) < (int)factor) {

Error: CPPCHECK_WARNING (CWE-682): [#def358]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:1075: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1073|   	    ncp->csp[-1].indx == 0 && ncp->csp[-1].entries != 1) ||
# 1074|   	    (int)(P_FREESPACE(dbp, pg) -
# 1075|-> 	    ((dbp->pgsize - P_OVERHEAD(dbp)) -
# 1076|   	    P_FREESPACE(dbp, npg))) < (int)factor) {
# 1077|   		ret = __bam_merge_records(dbc, ndbc, factor, c_data, pgs_donep);

Error: CPPCHECK_WARNING (CWE-682): [#def359]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:1076: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1074|   	    (int)(P_FREESPACE(dbp, pg) -
# 1075|   	    ((dbp->pgsize - P_OVERHEAD(dbp)) -
# 1076|-> 	    P_FREESPACE(dbp, npg))) < (int)factor) {
# 1077|   		ret = __bam_merge_records(dbc, ndbc, factor, c_data, pgs_donep);
# 1078|   	} else {

Error: CPPCHECK_WARNING (CWE-682): [#def360]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:1141: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1139|   	 * npg is the next page, it is in the stack in ncp.
# 1140|   	 */
# 1141|-> 	freespace = P_FREESPACE(dbp, pg);
# 1142|   
# 1143|   	adj = TYPE(npg) == P_LBTREE ? P_INDX : O_INDX;

Error: CPPCHECK_WARNING (CWE-682): [#def361]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:1214: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1212|   	pfree = dbp->pgsize;
# 1213|   	for (epg = &ncp->csp[-1]; epg >= ncp->sp; epg--)
# 1214|-> 		if ((freespace = P_FREESPACE(dbp, epg->page)) < pfree) {
# 1215|   			bi = GET_BINTERNAL(dbp, epg->page, epg->indx);
# 1216|   			/* Add back in the key we will be deleting. */

Error: CPPCHECK_WARNING (CWE-682): [#def362]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:1436: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1434|   		memset(&hdr, 0, sizeof(hdr));
# 1435|   		hdr.data = npg;
# 1436|-> 		hdr.size = LOFFSET(dbp, npg);
# 1437|   		memset(&data, 0, sizeof(data));
# 1438|   		data.data = (u_int8_t *)npg + HOFFSET(npg);

Error: CPPCHECK_WARNING (CWE-682): [#def363]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:1634: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1632|   		 * the effort of determining that might not be worthwhile.
# 1633|   		 */
# 1634|-> 		freespace = P_FREESPACE(dbp, pg);
# 1635|   		/*
# 1636|   		 * The leftmost key of an internal page is not accurate.

Error: CPPCHECK_WARNING (CWE-682): [#def364]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:1661: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1659|   		pfree = dbp->pgsize;
# 1660|   		for (epg--; epg >= ncp->sp; epg--)
# 1661|-> 			if ((freespace = P_FREESPACE(dbp, epg->page)) < pfree) {
# 1662|   				bip = GET_BINTERNAL(dbp, epg->page, epg->indx);
# 1663|   				/* Add back in the key we will be deleting. */

Error: CPPCHECK_WARNING (CWE-682): [#def365]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:1707: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1705|   			     BINTERNAL_SIZE(bip->len) :
# 1706|   			     BINTERNAL_SIZE(fip->len);
# 1707|-> 			if (P_FREESPACE(dbp, pg) < size + sizeof(db_indx_t))
# 1708|   				break;
# 1709|   

Error: CPPCHECK_WARNING (CWE-682): [#def366]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compact.c:1748: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1746|   			rk = GET_RINTERNAL(dbp, npg, 0);
# 1747|   			size = RINTERNAL_SIZE;
# 1748|-> 			if (P_FREESPACE(dbp, pg) < size + sizeof(db_indx_t))
# 1749|   				break;
# 1750|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def367]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compress.c: scope_hint: In function '__bam_compress_set_dbt'
libdb-5.3.28-build/db-5.3.28/src/btree/bt_compress.c:100:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#   98|   		return (ret);
#   99|   
#  100|-> 	memcpy(dbt->data, data, size);
#  101|   	return (0);
#  102|   }

Error: CPPCHECK_WARNING (CWE-682): [#def368]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_cursor.c:287: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  285|   	if (t->bt_minkey == 0)
#  286|   		return (DB_RECOVER);
#  287|-> 	cp->ovflsize = B_MINKEY_TO_OVFLSIZE(
#  288|   	    dbp,  F_ISSET(dbc, DBC_OPD) ? 2 : t->bt_minkey, dbp->pgsize);
#  289|   

Error: COMPILER_WARNING (CWE-563): [#def369]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_cursor.c: scope_hint: In function '__bamc_cmp'
libdb-5.3.28-build/db-5.3.28/src/btree/bt_cursor.c:643:14: warning[-Wunused-but-set-variable]: variable 'env' set but not used
#  643 |         ENV *env;
#      |              ^~~
#  641|   	int *result;
#  642|   {
#  643|-> 	ENV *env;
#  644|   	BTREE_CURSOR *bcp, *obcp;
#  645|   

Error: CPPCHECK_WARNING (CWE-682): [#def370]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_open.c:94: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#   92|   	 * calculation of ovflsize to underflow [#2406] for this pagesize.
#   93|   	 */
#   94|-> 	if (B_MINKEY_TO_OVFLSIZE(dbp, t->bt_minkey, dbp->pgsize) >
#   95|   	    B_MINKEY_TO_OVFLSIZE(dbp, DEFMINKEYPAGE, dbp->pgsize)) {
#   96|   		__db_errx(dbp->env, DB_STR_A("1007",

Error: CPPCHECK_WARNING (CWE-682): [#def371]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_open.c:95: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#   93|   	 */
#   94|   	if (B_MINKEY_TO_OVFLSIZE(dbp, t->bt_minkey, dbp->pgsize) >
#   95|-> 	    B_MINKEY_TO_OVFLSIZE(dbp, DEFMINKEYPAGE, dbp->pgsize)) {
#   96|   		__db_errx(dbp->env, DB_STR_A("1007",
#   97|   		    "bt_minkey value of %lu too high for page size of %lu",

Error: CPPCHECK_WARNING (CWE-682): [#def372]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_put.c:154: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  152|   			if (cp->stream_start_pgno != ((BOVERFLOW *)bk)->pgno ||
#  153|   			    cp->stream_off > data->doff || data->doff >
#  154|-> 			    cp->stream_off + P_MAXSPACE(dbp, dbp->pgsize)) {
#  155|   				memset(&tdbt, 0, sizeof(DBT));
#  156|   				tdbt.doff = data->doff - 1;

Error: CPPCHECK_WARNING (CWE-682): [#def373]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_put.c:277: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  275|   
#  276|   	/* Split the page if there's not enough room. */
#  277|-> 	if (P_FREESPACE(dbp, h) < needed)
#  278|   		return (DB_NEEDSPLIT);
#  279|   

Error: CPPCHECK_WARNING (CWE-682): [#def374]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_put.c:286: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  284|   	if (F_ISSET(dbp, DB_AM_DUP) &&
#  285|   	    TYPE(h) == P_LBTREE && op != DB_KEYFIRST &&
#  286|-> 	    P_FREESPACE(dbp, h) - needed <= dbp->pgsize / 2 &&
#  287|   	    __bam_dup_check(dbc, op, h, indx, needed, &cnt)) {
#  288|   		pages = 1;

Error: CPPCHECK_WARNING (CWE-682): [#def375]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_put.c:299: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  297|   	 */
#  298|   	if (dbc->txn == NULL && mpf->mfp->maxpgno != 0) {
#  299|-> 		pagespace = P_MAXSPACE(dbp, dbp->pgsize);
#  300|   		if (bigdata)
#  301|   			pages += ((data_size - 1) / pagespace) + 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def376]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_put.c: scope_hint: In function '__bam_ritem_nolog'
libdb-5.3.28-build/db-5.3.28/src/btree/bt_put.c:773:28: warning[-Wanalyzer-null-dereference]: dereference of NULL 'hdr'
libdb-5.3.28-build/db-5.3.28/src/btree/bt_put.c:47: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/dbinc/db_page.h:535:51: note: in expansion of macro 'P_INP'
libdb-5.3.28-build/db-5.3.28/src/dbinc/db_page.h:796:23: note: in expansion of macro 'P_ENTRY'
libdb-5.3.28-build/db-5.3.28/src/btree/bt_put.c:768:22: note: in expansion of macro 'GET_BINTERNAL'
#  771|   		if (data == NULL) {
#  772|   			DB_ASSERT(dbp->env, hdr != NULL);
#  773|-> 			bi = (BINTERNAL*)hdr->data;
#  774|   			P_16_COPY(&bi->len, &cnt);
#  775|   			ln = (db_indx_t)BINTERNAL_SIZE(cnt);

Error: CPPCHECK_WARNING (CWE-457): [#def377]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_put.c:775: error[uninitvar]: Uninitialized variable: cnt
#  773|   			bi = (BINTERNAL*)hdr->data;
#  774|   			P_16_COPY(&bi->len, &cnt);
#  775|-> 			ln = (db_indx_t)BINTERNAL_SIZE(cnt);
#  776|   		} else
#  777|   			ln = (db_indx_t)BINTERNAL_SIZE(data->size);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def378]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_put.c:813:41: warning[-Wanalyzer-null-dereference]: dereference of NULL 'hdr'
libdb-5.3.28-build/db-5.3.28/src/btree/bt_put.c:46: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:185:12: note: in definition of macro 'DB_ALIGN'
libdb-5.3.28-build/db-5.3.28/src/btree/bt_put.c:777:41: note: in expansion of macro 'BINTERNAL_SIZE'
libdb-5.3.28-build/db-5.3.28/src/btree/bt_put.c:811:13: note: in expansion of macro 'TYPE'
#  811|   	if (TYPE(h) == P_IBTREE) {
#  812|   		DB_ASSERT(dbp->env, hdr != NULL);
#  813|-> 		memcpy(t, hdr->data, hdr->size);
#  814|   		bi = (BINTERNAL *)t;
#  815|   		if (data != NULL && data->size != 0)

Error: CPPCHECK_WARNING (CWE-682): [#def379]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_rec.c:1784: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1782|   			OV_REF(pagep) = OV_REF(argp->hdr.data);
# 1783|   			OV_LEN(pagep) = OV_LEN(argp->hdr.data);
# 1784|-> 			bp = (u_int8_t *) pagep + P_OVERHEAD(file_dbp);
# 1785|   			memcpy(bp, argp->data.data, argp->data.size);
# 1786|   		} else {

Error: CPPCHECK_WARNING (CWE-682): [#def380]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_rec.c:1874: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1872|   			OV_REF(pagep) = OV_REF(argp->hdr.data);
# 1873|   			OV_LEN(pagep) = OV_LEN(argp->hdr.data);
# 1874|-> 			bp = (u_int8_t *) pagep + P_OVERHEAD(file_dbp);
# 1875|   			memcpy(bp, argp->data.data, argp->data.size);
# 1876|   		} else {

Error: COMPILER_WARNING (CWE-563): [#def381]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_recno.c: scope_hint: In function '__ram_ca'
libdb-5.3.28-build/db-5.3.28/src/btree/bt_recno.c:903:14: warning[-Wunused-but-set-variable]: variable 'env' set but not used
#  903 |         ENV *env;
#      |              ^~~
#  901|   	BTREE_CURSOR *cp_arg;
#  902|   	DB *dbp;
#  903|-> 	ENV *env;
#  904|   	db_recno_t recno;
#  905|   	u_int32_t found, order;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def382]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_recno.c: scope_hint: In function '__ram_source'
libdb-5.3.28-build/db-5.3.28/src/btree/bt_recno.c:1072:12: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(source, "rb")'
# 1070|   	 * when it comes time to write the database back to the source.
# 1071|   	 */
# 1072|-> 	if ((t->re_fp = fopen(t->re_source, "rb")) == NULL) {
# 1073|   		ret = __os_get_errno();
# 1074|   		__db_err(env, ret, "%s", t->re_source);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def383]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_recno.c:1072:12: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(source, "rb")'
# 1070|   	 * when it comes time to write the database back to the source.
# 1071|   	 */
# 1072|-> 	if ((t->re_fp = fopen(t->re_source, "rb")) == NULL) {
# 1073|   		ret = __os_get_errno();
# 1074|   		__db_err(env, ret, "%s", t->re_source);

Error: CPPCHECK_WARNING (CWE-682): [#def384]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_split.c:142: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  140|   		 */
#  141|   		if (2 * B_MAXSIZEONPAGE(cp->ovflsize)
#  142|-> 		    <= (db_indx_t)P_FREESPACE(dbc->dbp, cp->csp[0].page)) {
#  143|   			if ((ret = __bam_stkrel(dbc, STK_NOLOCK)) != 0)
#  144|   				goto err;

Error: CPPCHECK_WARNING (CWE-682): [#def385]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_split.c:520: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  518|   	 */
#  519|   	save_lsn = alloc_rp->lsn;
#  520|-> 	memcpy(alloc_rp, rp, LOFFSET(dbp, rp));
#  521|   	memcpy((u_int8_t *)alloc_rp + HOFFSET(rp),
#  522|   	    (u_int8_t *)rp + HOFFSET(rp), dbp->pgsize - HOFFSET(rp));

Error: CPPCHECK_WARNING (CWE-682): [#def386]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_split.c:526: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  524|   
#  525|   	save_lsn = cp->page->lsn;
#  526|-> 	memcpy(cp->page, lp, LOFFSET(dbp, lp));
#  527|   	memcpy((u_int8_t *)cp->page + HOFFSET(lp),
#  528|   	    (u_int8_t *)lp + HOFFSET(lp), dbp->pgsize - HOFFSET(lp));

Error: CPPCHECK_WARNING (CWE-682): [#def387]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_split.c:875: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  873|   		nbytes = BINTERNAL_PSIZE(child_bi->len);
#  874|   
#  875|-> 		if (P_FREESPACE(dbp, ppage) + oldsize < nbytes)
#  876|   			return (DB_NEEDSPLIT);
#  877|   		if (LF_ISSET(BPI_SPACEONLY))

Error: CPPCHECK_WARNING (CWE-682): [#def388]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_split.c:977: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  975|   				nksize = child_bk->len;
#  976|   
#  977|-> noprefix:		if (P_FREESPACE(dbp, ppage) + oldsize < nbytes)
#  978|   				return (DB_NEEDSPLIT);
#  979|   			if (LF_ISSET(BPI_SPACEONLY))

Error: CPPCHECK_WARNING (CWE-682): [#def389]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_split.c:994: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  992|   			nbytes = BINTERNAL_PSIZE(BOVERFLOW_SIZE);
#  993|   
#  994|-> 			if (P_FREESPACE(dbp, ppage) + oldsize < nbytes)
#  995|   				return (DB_NEEDSPLIT);
#  996|   			if (LF_ISSET(BPI_SPACEONLY))

Error: CPPCHECK_WARNING (CWE-682): [#def390]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_split.c:1032: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1030|   		nbytes = RINTERNAL_PSIZE;
# 1031|   
# 1032|-> 		if (P_FREESPACE(dbp, ppage) + oldsize < nbytes)
# 1033|   			return (DB_NEEDSPLIT);
# 1034|   		if (LF_ISSET(BPI_SPACEONLY))

Error: CPPCHECK_WARNING (CWE-457): [#def391]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_split.c:1363: error[uninitvar]: Uninitialized variable: &internal.unused
# 1361|   			internal.pgno = bi->pgno;
# 1362|   			internal.nrecs = bi->nrecs;
# 1363|-> 			memcpy(P_ENTRY(dbp, cp, off), &internal, nbytes);
# 1364|   		}
# 1365|   		else

Error: CPPCHECK_WARNING (CWE-682): [#def392]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_stat.c:354: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  352|   	case P_IRECNO:
#  353|   		++sp->bt_int_pg;
#  354|-> 		sp->bt_int_pgfree += P_FREESPACE(dbp, h);
#  355|   		break;
#  356|   	case P_LBTREE:

Error: CPPCHECK_WARNING (CWE-682): [#def393]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_stat.c:378: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  376|   
#  377|   		++sp->bt_leaf_pg;
#  378|-> 		sp->bt_leaf_pgfree += P_FREESPACE(dbp, h);
#  379|   		break;
#  380|   	case P_LRECNO:

Error: CPPCHECK_WARNING (CWE-682): [#def394]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_stat.c:406: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  404|   
#  405|   			++sp->bt_leaf_pg;
#  406|-> 			sp->bt_leaf_pgfree += P_FREESPACE(dbp, h);
#  407|   		} else {
#  408|   			sp->bt_ndata += top;

Error: CPPCHECK_WARNING (CWE-682): [#def395]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_stat.c:411: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  409|   
#  410|   			++sp->bt_dup_pg;
#  411|-> 			sp->bt_dup_pgfree += P_FREESPACE(dbp, h);
#  412|   		}
#  413|   		break;

Error: CPPCHECK_WARNING (CWE-682): [#def396]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_stat.c:424: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  422|   
#  423|   		++sp->bt_dup_pg;
#  424|-> 		sp->bt_dup_pgfree += P_FREESPACE(dbp, h);
#  425|   		break;
#  426|   	case P_OVERFLOW:

Error: CPPCHECK_WARNING (CWE-682): [#def397]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_stat.c:428: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  426|   	case P_OVERFLOW:
#  427|   		++sp->bt_over_pg;
#  428|-> 		sp->bt_over_pgfree += P_OVFLSPACE(dbp, dbp->pgsize, h);
#  429|   		break;
#  430|   	default:

Error: CPPCHECK_WARNING (CWE-682): [#def398]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_verify.c:70: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#   68|   	/* avoid division by zero */
#   69|   	ovflsize = meta->minkey > 0 ?
#   70|-> 	    B_MINKEY_TO_OVFLSIZE(dbp, meta->minkey, dbp->pgsize) : 0;
#   71|   
#   72|   	if (meta->minkey < 2 ||

Error: CPPCHECK_WARNING (CWE-682): [#def399]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_verify.c:73: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#   71|   
#   72|   	if (meta->minkey < 2 ||
#   73|-> 	    ovflsize > B_MINKEY_TO_OVFLSIZE(dbp, DEFMINKEYPAGE, dbp->pgsize)) {
#   74|   		pip->bt_minkey = 0;
#   75|   		isbad = 1;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def400]
libdb-5.3.28-build/db-5.3.28/src/btree/bt_verify.c: scope_hint: In function '__bam_meta2pgset'
libdb-5.3.28-build/db-5.3.28/src/btree/bt_verify.c:2767:20: warning[-Wanalyzer-deref-before-check]: check of 'h' for NULL after already dereferencing it
libdb-5.3.28-build/db-5.3.28/src/btree/bt_verify.c:12: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/btree/bt_verify.c:2731:25: note: in expansion of macro 'TYPE'
libdb-5.3.28-build/db-5.3.28/src/btree/bt_verify.c:2731:25: note: in expansion of macro 'TYPE'
# 2765|   traverse:
# 2766|   	while (IS_VALID_PGNO(current) && current != PGNO_INVALID) {
# 2767|-> 		if (h == NULL && (ret = __memp_fget(mpf,
# 2768|   		    &current, vdp->thread_info, NULL, 0, &h)) != 0) {
# 2769|   			err_ret = ret;

Error: CPPCHECK_WARNING (CWE-682): [#def401]
libdb-5.3.28-build/db-5.3.28/src/crypto/crypto.c:328: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  326|   		 * and all other pages.
#  327|   		 */
#  328|-> 		pg_off = P_OVERHEAD(dbp);
#  329|   alg_retry:
#  330|   		/*

Error: GCC_ANALYZER_WARNING (CWE-476): [#def402]
libdb-5.3.28-build/db-5.3.28/src/db/db.c: scope_hint: In function '__db_refresh'
libdb-5.3.28-build/db-5.3.28/src/db/db.c:957:43: warning[-Wanalyzer-null-dereference]: dereference of NULL 'renv'
libdb-5.3.28-build/db-5.3.28/src/db/db.c:43: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/db/db.c:956:21: note: in expansion of macro 'F_ISSET'
libdb-5.3.28-build/db-5.3.28/src/dbinc/rep.h:544:10: note: in expansion of macro 'REP_ON'
libdb-5.3.28-build/db-5.3.28/src/db/db.c:956:52: note: in expansion of macro 'IS_REP_CLIENT'
#  955|   		DB_ASSERT(env, renv != NULL);
#  956|   		if (F_ISSET(dbp, DB_AM_RECOVER) || IS_REP_CLIENT(env) ||
#  957|-> 		    dbp->timestamp != renv->rep_timestamp) {
#  958|   			if ((t_ret = __dbreg_revoke_id(dbp,
#  959|   			    0, DB_LOGFILEID_INVALID)) == 0 && ret == 0)

Error: CPPCHECK_WARNING (CWE-457): [#def403]
libdb-5.3.28-build/db-5.3.28/src/db/db_cam.c:610: warning[uninitvar]: Uninitialized variable: *dbcp
#  608|   
#  609|   	dbp = dbc_orig->dbp;
#  610|-> 	dbc_n = *dbcp;
#  611|   	env = dbp->env;
#  612|   

Error: COMPILER_WARNING (CWE-563): [#def404]
libdb-5.3.28-build/db-5.3.28/src/db/db_cam.c: scope_hint: In function '__dbc_put_resolve_key'
libdb-5.3.28-build/db-5.3.28/src/db/db_cam.c:1197:14: warning[-Wunused-but-set-variable]: variable 'env' set but not used
# 1197 |         ENV *env;
#      |              ^~~
# 1195|   {
# 1196|   	DB *dbp;
# 1197|-> 	ENV *env;
# 1198|   	int ret, rmw;
# 1199|   

Error: COMPILER_WARNING (CWE-563): [#def405]
libdb-5.3.28-build/db-5.3.28/src/db/db_cam.c: scope_hint: In function '__dbc_put_partial'
libdb-5.3.28-build/db-5.3.28/src/db/db_cam.c:1335:14: warning[-Wunused-but-set-variable]: variable 'env' set but not used
# 1335 |         ENV *env;
#      |              ^~~
# 1333|   	DB *dbp;
# 1334|   	DBC *pdbc;
# 1335|-> 	ENV *env;
# 1336|   	int ret, rmw, t_ret;
# 1337|   

Error: COMPILER_WARNING (CWE-563): [#def406]
libdb-5.3.28-build/db-5.3.28/src/db/db_compact.c: scope_hint: In function '__db_exchange_page'
libdb-5.3.28-build/db-5.3.28/src/db/db_compact.c:421:19: warning[-Wunused-but-set-variable]: variable 'oldpgno' set but not used
#  421 |         db_pgno_t oldpgno, *pgnop;
#      |                   ^~~~~~~
#  419|   	EPG *epg;
#  420|   	PAGE *newpage;
#  421|-> 	db_pgno_t oldpgno, *pgnop;
#  422|   	int ret;
#  423|   

Error: CPPCHECK_WARNING (CWE-682): [#def407]
libdb-5.3.28-build/db-5.3.28/src/db/db_compact.c:472: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  470|   		memset(&hdr, 0, sizeof(hdr));
#  471|   		hdr.data = *pgp;
#  472|-> 		hdr.size = P_OVERHEAD(dbp);
#  473|   		memset(&data, 0, sizeof(data));
#  474|   		dp = &data;

Error: CPPCHECK_WARNING (CWE-682): [#def408]
libdb-5.3.28-build/db-5.3.28/src/db/db_compact.c:477: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  475|   		switch (TYPE(*pgp)) {
#  476|   		case P_OVERFLOW:
#  477|-> 			data.data = (u_int8_t *)*pgp + P_OVERHEAD(dbp);
#  478|   			data.size = OV_LEN(*pgp);
#  479|   			break;

Error: CPPCHECK_WARNING (CWE-682): [#def409]
libdb-5.3.28-build/db-5.3.28/src/db/db_conv.c:326: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  324|   		DB_ASSERT(env, F_ISSET(dbp, DB_AM_CHKSUM));
#  325|   
#  326|-> 		pg_off = P_OVERHEAD(dbp);
#  327|   		DB_ASSERT(env, db_cipher->adj_size(pg_off) == 0);
#  328|   

Error: CPPCHECK_WARNING (CWE-682): [#def410]
libdb-5.3.28-build/db-5.3.28/src/db/db_conv.c:388: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  386|   		DB_ASSERT(env, F_ISSET(dbp, DB_AM_CHKSUM));
#  387|   
#  388|-> 		pg_off = P_OVERHEAD(dbp);
#  389|   		DB_ASSERT(env, db_cipher->adj_size(pg_off) == 0);
#  390|   

Error: CPPCHECK_WARNING (CWE-682): [#def411]
libdb-5.3.28-build/db-5.3.28/src/db/db_dup.c:129: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  127|   	DB_ASSERT(dbp->env, IS_DIRTY(pagep));
#  128|   
#  129|-> 	if (nbytes > P_FREESPACE(dbp, pagep)) {
#  130|   		DB_ASSERT(dbp->env, nbytes <= P_FREESPACE(dbp, pagep));
#  131|   		return (EINVAL);

Error: COMPILER_WARNING (CWE-563): [#def412]
libdb-5.3.28-build/db-5.3.28/src/db/db_meta.c: scope_hint: In function '__db_new'
libdb-5.3.28-build/db-5.3.28/src/db/db_meta.c:109:19: warning[-Wunused-but-set-variable]: variable 'last' set but not used
#  109 |         db_pgno_t last, *list, pgno, newnext;
#      |                   ^~~~
#  107|   	ENV *env;
#  108|   	PAGE *h;
#  109|-> 	db_pgno_t last, *list, pgno, newnext;
#  110|   	int extend, hash, ret;
#  111|   

Error: CPPCHECK_WARNING (CWE-682): [#def413]
libdb-5.3.28-build/db-5.3.28/src/db/db_meta.c:446: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  444|   		memset(&ldbt, 0, sizeof(ldbt));
#  445|   		ldbt.data = h;
#  446|-> 		ldbt.size = P_OVERHEAD(dbp);
#  447|   		/*
#  448|   		 * If we are removing pages from the file, we need to make

Error: CPPCHECK_WARNING (CWE-682): [#def414]
libdb-5.3.28-build/db-5.3.28/src/db/db_overflow.c:159: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  157|   	if (cp->stream_start_pgno != PGNO_INVALID &&
#  158|   	    pgno == cp->stream_start_pgno && start >= cp->stream_off &&
#  159|-> 	    start < cp->stream_off + P_MAXSPACE(dbp, dbp->pgsize)) {
#  160|   		pgno = cp->stream_curr_pgno;
#  161|   		curoff = cp->stream_off;

Error: CPPCHECK_WARNING (CWE-682): [#def415]
libdb-5.3.28-build/db-5.3.28/src/db/db_overflow.c:181: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  179|   		if (curoff + OV_LEN(h) >= start) {
#  180|   			bytes = OV_LEN(h);
#  181|-> 			src = (u_int8_t *)h + P_OVERHEAD(dbp);
#  182|   			if (start > curoff) {
#  183|   				src += start - curoff;

Error: COMPILER_WARNING (CWE-563): [#def416]
libdb-5.3.28-build/db-5.3.28/src/db/db_overflow.c: scope_hint: In function '__db_poff'
libdb-5.3.28-build/db-5.3.28/src/db/db_overflow.c:236:30: warning[-Wunused-but-set-variable]: variable 'tlen' set but not used
#  236 |         u_int32_t space, sz, tlen;
#      |                              ^~~~
#  234|   	db_indx_t pagespace;
#  235|   	db_pgno_t pgno;
#  236|-> 	u_int32_t space, sz, tlen;
#  237|   	u_int8_t *p;
#  238|   	int ret, t_ret;

Error: CPPCHECK_WARNING (CWE-682): [#def417]
libdb-5.3.28-build/db-5.3.28/src/db/db_overflow.c:248: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  246|   	lastp = NULL;
#  247|   	mpf = dbp->mpf;
#  248|-> 	pagespace = P_MAXSPACE(dbp, dbp->pgsize);
#  249|   	p = dbt->data;
#  250|   	sz = dbt->size;

Error: CPPCHECK_WARNING (CWE-682): [#def418]
libdb-5.3.28-build/db-5.3.28/src/db/db_overflow.c:287: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  285|   			LSN_NOT_LOGGED(LSN(lastp));
#  286|   
#  287|-> 		memcpy((u_int8_t *)lastp + P_OVERHEAD(dbp) + OV_LEN(lastp),
#  288|   		    dbt->data, space);
#  289|   		OV_LEN(lastp) += space;

Error: CPPCHECK_WARNING (CWE-682): [#def419]
libdb-5.3.28-build/db-5.3.28/src/db/db_overflow.c:334: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  332|   		OV_LEN(pagep) = pagespace;
#  333|   		OV_REF(pagep) = 1;
#  334|-> 		memcpy((u_int8_t *)pagep + P_OVERHEAD(dbp), p, pagespace);
#  335|   
#  336|   		/*

Error: CPPCHECK_WARNING (CWE-682): [#def420]
libdb-5.3.28-build/db-5.3.28/src/db/db_overflow.c:464: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  462|   
#  463|   		if (DBC_LOGGING(dbc)) {
#  464|-> 			tmp_dbt.data = (u_int8_t *)pagep + P_OVERHEAD(dbp);
#  465|   			tmp_dbt.size = OV_LEN(pagep);
#  466|   			ZERO_LSN(null_lsn);

Error: CPPCHECK_WARNING (CWE-682): [#def421]
libdb-5.3.28-build/db-5.3.28/src/db/db_ovfl_vrfy.c:366: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  364|   		}
#  365|   
#  366|-> 		src = (u_int8_t *)h + P_OVERHEAD(dbp);
#  367|   		bytes = OV_LEN(h);
#  368|   

Error: CPPCHECK_WARNING (CWE-682): [#def422]
libdb-5.3.28-build/db-5.3.28/src/db/db_ovfl_vrfy.c:369: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  367|   		bytes = OV_LEN(h);
#  368|   
#  369|-> 		if (bytes + P_OVERHEAD(dbp) > dbp->pgsize)
#  370|   			bytes = dbp->pgsize - P_OVERHEAD(dbp);
#  371|   

Error: CPPCHECK_WARNING (CWE-682): [#def423]
libdb-5.3.28-build/db-5.3.28/src/db/db_ovfl_vrfy.c:370: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  368|   
#  369|   		if (bytes + P_OVERHEAD(dbp) > dbp->pgsize)
#  370|-> 			bytes = dbp->pgsize - P_OVERHEAD(dbp);
#  371|   
#  372|   		/*

Error: CPPCHECK_WARNING (CWE-682): [#def424]
libdb-5.3.28-build/db-5.3.28/src/db/db_pr.c:798: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  796|   		else
#  797|   			__db_prbytes(env,
#  798|-> 			    mbp, (u_int8_t *)h + P_OVERHEAD(dbp), OV_LEN(h));
#  799|   		return (0);
#  800|   	}

Error: CPPCHECK_WARNING (CWE-682): [#def425]
libdb-5.3.28-build/db-5.3.28/src/db/db_pr.c:820: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  818|   			continue;
#  819|   		if ((uintptr_t)(P_ENTRY(dbp, h, i) - (u_int8_t *)h) <
#  820|-> 		    (uintptr_t)(P_OVERHEAD(dbp)) ||
#  821|   		    (size_t)(P_ENTRY(dbp, h, i) - (u_int8_t *)h) >= pagesize) {
#  822|   			__db_msg(env,

Error: CPPCHECK_WARNING (CWE-682): [#def426]
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:224: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  222|   		OV_LEN(pagep) = argp->dbt.size;
#  223|   		OV_REF(pagep) = 1;
#  224|-> 		memcpy((u_int8_t *)pagep + P_OVERHEAD(file_dbp), argp->dbt.data,
#  225|   		    argp->dbt.size);
#  226|   		PREV_PGNO(pagep) = argp->prev_pgno;

Error: CPPCHECK_WARNING (CWE-682): [#def427]
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:240: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  238|   		/* We are redoing an append. */
#  239|   		REC_DIRTY(mpf, ip, file_dbp->priority, &pagep);
#  240|-> 		memcpy((u_int8_t *)pagep + P_OVERHEAD(file_dbp) +
#  241|   		    OV_LEN(pagep), argp->dbt.data, argp->dbt.size);
#  242|   		OV_LEN(pagep) += argp->dbt.size;

Error: CPPCHECK_WARNING (CWE-682): [#def428]
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:248: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  246|   		REC_DIRTY(mpf, ip, file_dbp->priority, &pagep);
#  247|   		OV_LEN(pagep) -= argp->dbt.size;
#  248|-> 		memset((u_int8_t *)pagep + P_OVERHEAD(file_dbp) +
#  249|   		    OV_LEN(pagep), 0, argp->dbt.size);
#  250|   		modified = 1;

Error: CPPCHECK_WARNING (CWE-682): [#def429]
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:380: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  378|   		OV_LEN(pagep) = argp->dbt.size;
#  379|   		OV_REF(pagep) = 1;
#  380|-> 		memcpy((u_int8_t *)pagep + P_OVERHEAD(file_dbp), argp->dbt.data,
#  381|   		    argp->dbt.size);
#  382|   		PREV_PGNO(pagep) = argp->prev_pgno;

Error: CPPCHECK_WARNING (CWE-682): [#def430]
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:396: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  394|   		/* We are redoing an append. */
#  395|   		REC_DIRTY(mpf, ip, file_dbp->priority, &pagep);
#  396|-> 		memcpy((u_int8_t *)pagep + P_OVERHEAD(file_dbp) +
#  397|   		    OV_LEN(pagep), argp->dbt.data, argp->dbt.size);
#  398|   		OV_LEN(pagep) += argp->dbt.size;

Error: CPPCHECK_WARNING (CWE-682): [#def431]
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:404: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  402|   		REC_DIRTY(mpf, ip, file_dbp->priority, &pagep);
#  403|   		OV_LEN(pagep) -= argp->dbt.size;
#  404|-> 		memset((u_int8_t *)pagep + P_OVERHEAD(file_dbp) +
#  405|   		    OV_LEN(pagep), 0, argp->dbt.size);
#  406|   		modified = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def432]
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c: scope_hint: In function '__db_pg_free_recover_int'
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:898:42: warning[-Wanalyzer-null-dereference]: dereference of NULL 'prevp'
libdb-5.3.28-build/db-5.3.28/src/dbinc/btree.h:552: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:17: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:870:9: note: in expansion of macro 'REC_FGET'
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:875:17: note: in expansion of macro 'LOG_COMPARE'
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:885:17: note: in expansion of macro 'REC_DIRTY'
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:885:17: note: in expansion of macro 'REC_DIRTY'
#  896|   			meta->free = argp->pgno;
#  897|   		else
#  898|-> 			NEXT_PGNO(prevp) = argp->pgno;
#  899|   		LSN(meta) = *lsnp;
#  900|   	} else if (cmp_n == 0 && DB_UNDO(op)) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def433]
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:908:42: warning[-Wanalyzer-null-dereference]: dereference of NULL 'prevp'
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:870:9: note: in expansion of macro 'REC_FGET'
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:875:17: note: in expansion of macro 'LOG_COMPARE'
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:902:17: note: in expansion of macro 'REC_DIRTY'
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:902:17: note: in expansion of macro 'REC_DIRTY'
#  906|   			meta->free = argp->next;
#  907|   		} else
#  908|-> 			NEXT_PGNO(prevp) = argp->next;
#  909|   		LSN(meta) = argp->meta_lsn;
#  910|   	}

Error: CPPCHECK_WARNING (CWE-682): [#def434]
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:2423: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 2421|   			OV_REF(pagep) = OV_REF(argp->hdr.data);
# 2422|   			OV_LEN(pagep) = OV_LEN(argp->hdr.data);
# 2423|-> 			bp = (u_int8_t *)pagep + P_OVERHEAD(file_dbp);
# 2424|   			memcpy(bp, argp->data.data, argp->data.size);
# 2425|   		} else {

Error: CPPCHECK_WARNING (CWE-682): [#def435]
libdb-5.3.28-build/db-5.3.28/src/db/db_rec.c:2572: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 2570|   			OV_REF(pagep) = OV_REF(argp->hdr.data);
# 2571|   			OV_LEN(pagep) = OV_LEN(argp->hdr.data);
# 2572|-> 			bp = (u_int8_t *)pagep + P_OVERHEAD(file_dbp);
# 2573|   			memcpy(bp, argp->data.data, argp->data.size);
# 2574|   		} else {

Error: CPPCHECK_WARNING (CWE-682): [#def436]
libdb-5.3.28-build/db-5.3.28/src/db/db_reclaim.c:215: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  213|   				memset(&ddbt, 0, sizeof(ddbt));
#  214|   				ldbt.data = p;
#  215|-> 				ldbt.size = P_OVERHEAD(dbp);
#  216|   				ldbt.size += p->entries * sizeof(db_indx_t);
#  217|   				ddbt.data = (u_int8_t *)p + HOFFSET(p);

Error: CPPCHECK_WARNING (CWE-682): [#def437]
libdb-5.3.28-build/db-5.3.28/src/db/db_upg_opd.c:214: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  212|   	case P_IBTREE:
#  213|   		child_bi = GET_BINTERNAL(dbp, page, 0);
#  214|-> 		if (P_FREESPACE(dbp, ipage) < BINTERNAL_PSIZE(child_bi->len)) {
#  215|   			*nomemp = 1;
#  216|   			return (0);

Error: CPPCHECK_WARNING (CWE-682): [#def438]
libdb-5.3.28-build/db-5.3.28/src/db/db_upg_opd.c:240: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  238|   		switch (B_TYPE(child_bk->type)) {
#  239|   		case B_KEYDATA:
#  240|-> 			if (P_FREESPACE(dbp, ipage) <
#  241|   			    BINTERNAL_PSIZE(child_bk->len)) {
#  242|   				*nomemp = 1;

Error: CPPCHECK_WARNING (CWE-682): [#def439]
libdb-5.3.28-build/db-5.3.28/src/db/db_upg_opd.c:258: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  256|   			break;
#  257|   		case B_OVERFLOW:
#  258|-> 			if (P_FREESPACE(dbp, ipage) <
#  259|   			    BINTERNAL_PSIZE(BOVERFLOW_SIZE)) {
#  260|   				*nomemp = 1;

Error: CPPCHECK_WARNING (CWE-682): [#def440]
libdb-5.3.28-build/db-5.3.28/src/db/db_upg_opd.c:308: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  306|   	COMPQUIET(fhp, NULL);
#  307|   	inp = P_INP(dbp, ipage);
#  308|-> 	if (P_FREESPACE(dbp, ipage) < RINTERNAL_PSIZE) {
#  309|   		*nomemp = 1;
#  310|   		return (0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def441]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_stat.c:12: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/hash/hash_stat.c: scope_hint: In function '__ham_traverse'
libdb-5.3.28-build/db-5.3.28/src/dbinc/db_page.h:317:37: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libdb-5.3.28-build/db-5.3.28/src/hash/hash_stat.c:441:29: note: in expansion of macro 'TYPE'
libdb-5.3.28-build/db-5.3.28/src/dbinc/db_page.h:317:35: note: in definition of macro 'TYPE'
libdb-5.3.28-build/db-5.3.28/src/dbinc/db_page.h:317:35: note: in definition of macro 'TYPE'
libdb-5.3.28-build/db-5.3.28/src/hash/hash_stat.c:441:29: note: in expansion of macro 'TYPE'
#  315|   #define	HOFFSET(p)	(((PAGE *)p)->hf_offset)
#  316|   #define	LEVEL(p)	(((PAGE *)p)->level)
#  317|-> #define	TYPE(p)		(((PAGE *)p)->type)
#  318|   
#  319|   /************************************************************************

Error: GCC_ANALYZER_WARNING (CWE-457): [#def442]
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:1117: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c: scope_hint: In function '__repmgr_send_internal'
libdb-5.3.28-build/db-5.3.28/src/dbinc/rep.h:166:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'total_written'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c:1032:9: note: in expansion of macro 'VPRINT'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:1115: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/dbinc/repmgr.h:219:36: note: in definition of macro 'REPMGR_IOVECS_ALLOC_SZ'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c:1032:9: note: in expansion of macro 'VPRINT'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c:1032:9: note: in expansion of macro 'VPRINT'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c:1032:9: note: in expansion of macro 'VPRINT'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c:1032:9: note: in expansion of macro 'VPRINT'
#  164|   #define	VPRINT(env, x) do {						\
#  165|   	if ((env)->dbenv->verbose != 0)					\
#  166|-> 		(void)__rep_print x;					\
#  167|   } while (0)
#  168|   #define	REP_PRINT_MESSAGE(env, eid, rp, str, fl) do {			\

Error: GCC_ANALYZER_WARNING (CWE-476): [#def443]
libdb-5.3.28-build/db-5.3.28/src/env/env_open.c: scope_hint: In function '__env_close'
libdb-5.3.28-build/db-5.3.28/src/env/env_open.c:639:24: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dbp'
#  637|   		 * close operation errors.
#  638|   		 */
#  639|-> 		if (dbp->alt_close != NULL)
#  640|   			t_ret = dbp->alt_close(dbp, close_flags);
#  641|   		else

Error: COMPILER_WARNING: [#def444]
libdb-5.3.28-build/db-5.3.28/src/env/env_recover.c:22:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   22 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   20|   
#   21|   #ifndef lint
#   22|-> static const char copyright[] =
#   23|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   24|   #endif

Error: COMPILER_WARNING (CWE-563): [#def445]
libdb-5.3.28-build/db-5.3.28/src/hash/hash.c: scope_hint: In function '__hamc_cmp'
libdb-5.3.28-build/db-5.3.28/src/hash/hash.c:346:14: warning[-Wunused-but-set-variable]: variable 'env' set but not used
#  346 |         ENV *env;
#      |              ^~~
#  344|   	int *result;
#  345|   {
#  346|-> 	ENV *env;
#  347|   	HASH_CURSOR *hcp, *ohcp;
#  348|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def446]
libdb-5.3.28-build/db-5.3.28/src/hash/hash.c: scope_hint: In function '__ham_expand_table'
libdb-5.3.28-build/db-5.3.28/src/hash/hash.c:1384:16: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libdb-5.3.28-build/db-5.3.28/src/hash/hash.c:50: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/hash/hash.c:1283:9: note: in expansion of macro 'LOCK_INIT'
libdb-5.3.28-build/db-5.3.28/src/hash/hash.c:46: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/hash/hash.c:1323:21: note: in expansion of macro 'F_ISSET'
# 1382|   
# 1383|   	/* Write out whatever page we ended up modifying. */
# 1384|-> 	h->lsn = lsn;
# 1385|   	if ((ret = __memp_fput(mpf, dbc->thread_info, h, dbc->priority)) != 0)
# 1386|   		goto err;

Error: CPPCHECK_WARNING (CWE-682): [#def447]
libdb-5.3.28-build/db-5.3.28/src/hash/hash.c:1923: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1921|   		if (hcp->seek_size != 0 &&
# 1922|   		    hcp->seek_found_page == PGNO_INVALID &&
# 1923|-> 		    hcp->seek_size < P_FREESPACE(dbp, hcp->page)) {
# 1924|   			hcp->seek_found_page = hcp->pgno;
# 1925|   			hcp->seek_found_indx = NDX_INVALID;

Error: CPPCHECK_WARNING (CWE-682): [#def448]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_compact.c:330: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  328|   			    LEN_HITEM(dbp, nextpage, dbp->pgsize, 1) +
#  329|   			    2 * sizeof(db_indx_t);
#  330|-> 			if (P_FREESPACE(dbp, pg) < len)
#  331|   				continue;
#  332|   

Error: GCC_ANALYZER_WARNING (CWE-465): [#def449]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_compact.c: scope_hint: In function '__ham_copy_data'
libdb-5.3.28-build/db-5.3.28/src/hash/hash_compact.c:356:20: warning[-Wanalyzer-deref-before-check]: check of 'nextpage' for NULL after already dereferencing it
libdb-5.3.28-build/db-5.3.28/src/hash/hash_compact.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/hash/hash_compact.c:320:29: note: in expansion of macro 'PGNO'
#  354|   			COMPACT_TRUNCATE(c_data);
#  355|   		}
#  356|-> 		if (ncp->page != NULL &&
#  357|   		    (t_ret = __memp_fput(mpf, dbc->thread_info,
#  358|   		    ncp->page, dbc->priority)) != 0 && ret == 0)

Error: CPPCHECK_WARNING (CWE-682): [#def450]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_dup.c:130: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  128|   	if (HPAGE_PTYPE(hk) != H_OFFDUP &&
#  129|   	    (HPAGE_PTYPE(hk) == H_OFFPAGE || ISBIG(hcp, new_size) ||
#  130|-> 	    add_bytes > P_FREESPACE(dbp, hcp->page))) {
#  131|   
#  132|   		if ((ret = __ham_dup_convert(dbc)) != 0)

Error: CPPCHECK_WARNING (CWE-682): [#def451]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_dup.c:504: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  502|   	 */
#  503|   	if (ISBIG(hcp, new_datalen) && (old_len > HOFFDUP_SIZE ||
#  504|-> 	    HOFFDUP_SIZE - old_len <= P_FREESPACE(dbp, hcp->page)))
#  505|   		return (0);
#  506|   

Error: CPPCHECK_WARNING (CWE-682): [#def452]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_dup.c:508: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  506|   
#  507|   	if (!ISBIG(hcp, new_datalen) &&
#  508|-> 	    (new_datalen - old_len) <= P_FREESPACE(dbp, hcp->page))
#  509|   		return (0);
#  510|   

Error: CPPCHECK_WARNING (CWE-682): [#def453]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_dup.c:536: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  534|   			return (ret);
#  535|   
#  536|-> 		if (P_FREESPACE(dbp, next_pagep) >= new_datalen) {
#  537|   			found = 1;
#  538|   			break;

Error: CPPCHECK_WARNING (CWE-682): [#def454]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:102: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  100|   	/* Check if we are looking for space in which to insert an item. */
#  101|   	if (hcp->seek_size != 0 && hcp->seek_found_page == PGNO_INVALID &&
#  102|-> 	    hcp->seek_size < P_FREESPACE(dbp, hcp->page)) {
#  103|   		hcp->seek_found_page = hcp->pgno;
#  104|   		hcp->seek_found_indx = NDX_INVALID;

Error: CPPCHECK_WARNING (CWE-682): [#def455]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:1476: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1474|   	newlen = (is_plus ? len + change : len - change);
# 1475|   	if (is_big || beyond_eor || ISBIG(hcp, newlen) ||
# 1476|-> 	    (is_plus && change > P_FREESPACE(dbp, hcp->page))) {
# 1477|   		/*
# 1478|   		 * If we are in cases 4 or 5 then is_plus will be true.

Error: CPPCHECK_WARNING (CWE-682): [#def456]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:1514: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1512|   			if (hcp->stream_start_pgno != off_pgno ||
# 1513|   			    hcp->stream_off > dbt->doff || dbt->doff >
# 1514|-> 			    hcp->stream_off + P_MAXSPACE(dbp, dbp->pgsize)) {
# 1515|   				memset(&tdata, 0, sizeof(DBT));
# 1516|   				tdata.doff = dbt->doff - 1;

Error: CPPCHECK_WARNING (CWE-682): [#def457]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:1871: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1869|   		 * variation in record size.
# 1870|   		 */
# 1871|-> 		while (P_FREESPACE(dbp, to_pagep) < len) {
# 1872|   			to_pgno = NEXT_PGNO(to_pagep);
# 1873|   			if (to_pgno == PGNO_INVALID) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def458]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c: scope_hint: In function '__ham_merge_pages'
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:1967:36: warning[-Wanalyzer-null-dereference]: dereference of NULL 'prev_pagep'
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:55: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/dbinc/hash.h:107:22: note: in definition of macro 'BS_TO_PAGE'
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:1835:21: note: in expansion of macro 'BUCKET_TO_PAGE'
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:54: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:1964:21: note: in expansion of macro 'NEXT_PGNO'
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:53: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:1966:21: note: in expansion of macro 'DBC_LOGGING'
# 1965|   	if (PREV_PGNO(from_pagep) != PGNO_INVALID) {
# 1966|   		if (DBC_LOGGING(dbc)) {
# 1967|-> 			if ((ret = __db_relink_log(dbp, dbc->txn,
# 1968|   			    &LSN(prev_pagep), 0, PGNO(from_pagep),
# 1969|   			    PGNO_INVALID, PGNO(prev_pagep),

Error: CPPCHECK_WARNING (CWE-682): [#def459]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:2023: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 2021|   		    DB_MPOOL_CREATE | DB_MPOOL_DIRTY, &from_pagep)) != 0)
# 2022|   			goto err;
# 2023|-> 		if (P_FREESPACE(dbp, to_pagep) >
# 2024|   		    (dbp->pgsize - HOFFSET(from_pagep)) +
# 2025|   		    (NUM_ENT(from_pagep) * sizeof(db_indx_t)))

Error: CPPCHECK_WARNING (CWE-682): [#def460]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:2263: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 2261|   			    2 * sizeof(db_indx_t);
# 2262|   
# 2263|-> 			if (P_FREESPACE(dbp, *pp) < len) {
# 2264|   				if (DBC_LOGGING(dbc)) {
# 2265|   					page_dbt.size = dbp->pgsize;

Error: CPPCHECK_WARNING (CWE-682): [#def461]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:2515: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 2513|   		 * pair that fits.
# 2514|   		 */
# 2515|-> 		if (P_FREESPACE(dbp, hcp->page) >= pairsize)
# 2516|   			break;
# 2517|   		next_pgno = NEXT_PGNO(hcp->page);

Error: CPPCHECK_WARNING (CWE-682): [#def462]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:2525: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 2523|   	 * Check if we need to allocate a new page.
# 2524|   	 */
# 2525|-> 	if (P_FREESPACE(dbp, hcp->page) < pairsize) {
# 2526|   		do_expand = 1;
# 2527|   		if ((ret = __memp_dirty(mpf, &hcp->page,

Error: CPPCHECK_WARNING (CWE-682): [#def463]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_page.c:2549: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 2547|   	if (dbc->txn == NULL &&
# 2548|   	    dbp->mpf->mfp->maxpgno != 0 && (is_keybig || is_databig)) {
# 2549|-> 		pagespace = P_MAXSPACE(dbp, dbp->pgsize);
# 2550|   		pages = 0;
# 2551|   		if (is_databig)

Error: CPPCHECK_WARNING (CWE-682): [#def464]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_stat.c:250: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  248|   		 */
#  249|   		if (PREV_PGNO(pagep) == PGNO_INVALID)
#  250|-> 			sp->hash_bfree += P_FREESPACE(dbp, pagep);
#  251|   		else {
#  252|   			sp->hash_overflows++;

Error: CPPCHECK_WARNING (CWE-682): [#def465]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_stat.c:253: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  251|   		else {
#  252|   			sp->hash_overflows++;
#  253|-> 			sp->hash_ovfl_free += P_FREESPACE(dbp, pagep);
#  254|   		}
#  255|   		top = NUM_ENT(pagep);

Error: CPPCHECK_WARNING (CWE-682): [#def466]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_stat.c:302: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  300|   	case P_OVERFLOW:
#  301|   		sp->hash_bigpages++;
#  302|-> 		sp->hash_big_bfree += P_OVFLSPACE(dbp, dbp->pgsize, pagep);
#  303|   		break;
#  304|   	default:

Error: CPPCHECK_WARNING (CWE-758): [#def467]
libdb-5.3.28-build/db-5.3.28/src/hash/hash_verify.c:158: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  156|   		 * than last_pgno.
#  157|   		 */
#  158|-> 		mbucket = (1 << i) - 1;
#  159|   		if (BS_TO_PAGE(mbucket, m->spares) > vdp->last_pgno) {
#  160|   			EPRINT((env, DB_STR_A("1101",

Error: COMPILER_WARNING (CWE-457): [#def468]
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c: scope_hint: In function '__heap_bulk'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:285:18: warning[-Wmaybe-uninitialized]: 'prev_rid.indx' may be used uninitialized
#  285 |         cp->indx = prev_rid.indx;
#      |         ~~~~~~~~~^~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:134:21: note: 'prev_rid.indx' was declared here
#  134 |         DB_HEAP_RID prev_rid, rid;
#      |                     ^~~~~~~~
#  283|   
#  284|   	DB_ASSERT(dbp->env, (ret == 0 || ret == DB_PAGE_NOTFOUND));
#  285|-> 	cp->indx = prev_rid.indx;
#  286|   	cp->pgno = prev_rid.pgno;
#  287|   

Error: COMPILER_WARNING (CWE-457): [#def469]
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:286:18: warning[-Wmaybe-uninitialized]: 'prev_rid.pgno' may be used uninitialized
#  286 |         cp->pgno = prev_rid.pgno;
#      |         ~~~~~~~~~^~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:134:21: note: 'prev_rid.pgno' was declared here
#  134 |         DB_HEAP_RID prev_rid, rid;
#      |                     ^~~~~~~~
#  284|   	DB_ASSERT(dbp->env, (ret == 0 || ret == DB_PAGE_NOTFOUND));
#  285|   	cp->indx = prev_rid.indx;
#  286|-> 	cp->pgno = prev_rid.pgno;
#  287|   
#  288|   	*offp = -1;

Error: COMPILER_WARNING (CWE-563): [#def470]
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c: scope_hint: In function '__heapc_close'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:299:23: warning[-Wunused-but-set-variable]: variable 'mpf' set but not used
#  299 |         DB_MPOOLFILE *mpf;
#      |                       ^~~
#  297|   	int *rmroot;
#  298|   {
#  299|-> 	DB_MPOOLFILE *mpf;
#  300|   	HEAP_CURSOR *cp;
#  301|   	int ret;

Error: COMPILER_WARNING (CWE-563): [#def471]
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c: scope_hint: In function '__heapc_get'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:540:15: warning[-Wunused-but-set-variable]: variable 'h' set but not used
#  540 |         HEAP *h;
#      |               ^
#  538|   	DB_LOCK meta_lock;
#  539|   	DBT tmp_val;
#  540|-> 	HEAP *h;
#  541|   	HEAPHDR *hdr;
#  542|   	HEAPMETA *meta;

Error: COMPILER_WARNING (CWE-563): [#def472]
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c: scope_hint: In function '__heap_getpage'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:1826:31: warning[-Wunused-but-set-variable]: variable 'lkd_pgs' set but not used
# 1826 |         db_pgno_t data_pgno, *lkd_pgs, meta_pgno, region_pgno, start_region;
#      |                               ^~~~~~~
# 1824|   	HEAPPG *rpage;
# 1825|   	HEAP_CURSOR *cp;
# 1826|-> 	db_pgno_t data_pgno, *lkd_pgs, meta_pgno, region_pgno, start_region;
# 1827|   	int i, lk_mode, max, p, ret, space, start, t_ret;
# 1828|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def473]
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c: scope_hint: In function '__heap_append'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:2224:14: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:59:9: note: in expansion of macro 'ACQUIRE'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:1912:17: note: in expansion of macro 'ACQUIRE_CUR'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:1912:17: note: in expansion of macro 'ACQUIRE_CUR'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:1944:17: note: in expansion of macro 'DISCARD'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:1944:17: note: in expansion of macro 'DISCARD'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:1944:17: note: in expansion of macro 'DISCARD'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:1944:17: note: in expansion of macro 'DISCARD'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:1944:17: note: in expansion of macro 'DISCARD'
libdb-5.3.28-build/db-5.3.28/src/dbinc/btree.h:552: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:13: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/dbinc/db_am.h:178:9: note: in expansion of macro '__ENV_LPUT'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:82:27: note: in expansion of macro '__LPUT'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:1944:17: note: in expansion of macro 'DISCARD'
libdb-5.3.28-build/db-5.3.28/src/heap/heap.c:12: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/dbinc/db_page.h:451:45: note: in definition of macro 'HEAP_FREEINDX'
libdb-5.3.28-build/db-5.3.28/src/dbinc/db_page.h:451:45: note: in definition of macro 'HEAP_FREEINDX'
# 2222|   		goto err;
# 2223|   
# 2224|-> 	indx = HEAP_FREEINDX(cp->page);
# 2225|   	memset(&hdr, 0, sizeof(HEAPHDR));
# 2226|   	hdr.size = data->size;

Error: COMPILER_WARNING (CWE-563): [#def474]
libdb-5.3.28-build/db-5.3.28/src/heap/heap_method.c: scope_hint: In function '__heap_db_close'
libdb-5.3.28-build/db-5.3.28/src/heap/heap_method.c:52:13: warning[-Wunused-but-set-variable]: variable 'ret' set but not used
#   52 |         int ret;
#      |             ^~~
#   50|   {
#   51|   	HEAP *h;
#   52|-> 	int ret;
#   53|   
#   54|   	ret = 0;

Error: COMPILER_WARNING (CWE-563): [#def475]
libdb-5.3.28-build/db-5.3.28/src/heap/heap_stat.c: scope_hint: In function '__heap_stat'
libdb-5.3.28-build/db-5.3.28/src/heap/heap_stat.c:32:17: warning[-Wunused-but-set-variable]: variable 'lock' set but not used
#   32 |         DB_LOCK lock, metalock;
#      |                 ^~~~
#   30|   	DB *dbp;
#   31|   	DB_HEAP_STAT *sp;
#   32|-> 	DB_LOCK lock, metalock;
#   33|   	DB_MPOOLFILE *mpf;
#   34|   	ENV *env;

Error: COMPILER_WARNING (CWE-569): [#def476]
libdb-5.3.28-build/db-5.3.28/src/lock/lock.c:495: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/lock/lock_alloc.incl: scope_hint: In function '__lock_alloclock'
libdb-5.3.28-build/db-5.3.28/src/lock/lock_alloc.incl:111:48: warning[-Wtautological-compare]: self-comparison always evaluates to true
#  111 |                         if (&cur_p->free_locks ==
#      |                                                ^~
#  109|   		for (i = 0; i < nobjs; i++) {
#  110|   			memset(sh_thing, 0, sizeof (struct STRUCT_NAME));
#  111|-> 			if (&cur_p->free_locks ==
#  112|   			    (struct __flock *)&cur_p->FREE_LIST_HEAD)
#  113|   				((struct __db_lock *)

Error: GCC_ANALYZER_WARNING (CWE-672): [#def477]
libdb-5.3.28-build/db-5.3.28/src/log/log_debug.c: scope_hint: In function '__log_printf_capi'
libdb-5.3.28-build/db-5.3.28/src/log/log_debug.c:44:9: warning[-Wanalyzer-va-list-use-after-va-end]: 'va_end' after 'va_end'
libdb-5.3.28-build/db-5.3.28/src/log/log_debug.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/log/log_debug.c:73:9: note: in expansion of macro 'ENV_REQUIRES_CONFIG'
libdb-5.3.28-build/db-5.3.28/src/log/log_debug.c:76:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/src/log/log_debug.c:76:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/src/dbinc/rep.h:571:10: note: in expansion of macro 'REP_ON'
libdb-5.3.28-build/db-5.3.28/src/dbinc/rep.h:617:23: note: in expansion of macro 'IS_ENV_REPLICATED'
libdb-5.3.28-build/db-5.3.28/src/log/log_debug.c:77:9: note: in expansion of macro 'REPLICATION_WRAP'
libdb-5.3.28-build/db-5.3.28/src/log/log_debug.c:79:9: note: in expansion of macro 'ENV_LEAVE'
#   42|   #endif
#   43|   	ret = __log_printf_pp(dbenv, txnid, fmt, ap);
#   44|-> 	va_end(ap);
#   45|   
#   46|   	return (ret);

Error: CPPCHECK_WARNING (CWE-457): [#def478]
libdb-5.3.28-build/db-5.3.28/src/log/log_put.c:1826: error[legacyUninitvar]: Uninitialized variable: *(&lsnp)
# 1824|   		 * in by the log_put code.
# 1825|   		 */
# 1826|-> 		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
# 1827|   		txn_num = txnp->txnid;
# 1828|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def479]
libdb-5.3.28-build/db-5.3.28/src/log/log_put.c: scope_hint: In function '__log_put_record_int'
libdb-5.3.28-build/db-5.3.28/src/log/log_put.c:1966:51: warning[-Wanalyzer-null-dereference]: dereference of NULL 'header'
libdb-5.3.28-build/db-5.3.28/src/log/log_put.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/log/log_put.c:1964:37: note: in expansion of macro 'F_ISSET'
# 1964|   				if (F_ISSET(dbp, DB_AM_SWAP) &&
# 1965|   				    (ret = __db_pageswap(env, dbp, pghdrstart,
# 1966|-> 				    (size_t)header->size, (DBT *)data, 0)) != 0)
# 1967|   					return (ret);
# 1968|   				LOGCOPY_32(env, bp, &data->size);

Error: COMPILER_WARNING (CWE-563): [#def480]
libdb-5.3.28-build/db-5.3.28/src/log/log_verify_int.c: scope_hint: In function '__lv_on_new_txn'
libdb-5.3.28-build/db-5.3.28/src/log/log_verify_int.c:4126:14: warning[-Wunused-but-set-variable]: variable 'env' set but not used
# 4126 |         ENV *env;
#      |              ^~~
# 4124|   	int ret, tret;
# 4125|   	u_int32_t txnid;
# 4126|-> 	ENV *env;
# 4127|   
# 4128|   	ret = tret = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def481]
libdb-5.3.28-build/db-5.3.28/src/log/log_verify_util.c:819: warning[nullPointer]: Possible null pointer dereference: retk
#  817|   				break;
#  818|   			DB_ASSERT(env, retkl == sizeof(txnid) && retk != NULL);
#  819|-> 			memcpy(&txnid, retk, retkl);
#  820|   			/*
#  821|   			 * Process it if txnid in range or no range specified.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def482]
libdb-5.3.28-build/db-5.3.28/src/mp/mp_bh.c: scope_hint: In function '__memp_pg'
libdb-5.3.28-build/db-5.3.28/src/mp/mp_bh.c:512:13: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dbmfp'
libdb-5.3.28-build/db-5.3.28/src/mp/mp_bh.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/mp/mp_bh.c:474:13: note: in expansion of macro 'F_ISSET'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:1113: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/dbinc/mutex.h:208:14: note: in definition of macro 'MUTEX_LOCK'
libdb-5.3.28-build/db-5.3.28/src/mp/mp_bh.c:707:13: note: in expansion of macro 'F_ISSET'
libdb-5.3.28-build/db-5.3.28/src/dbinc/mutex_int.h:12: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/dbinc/mutex.h:15: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/mp/mp_bh.c: scope_hint: In function '__memp_pg'
libdb-5.3.28-build/db-5.3.28/src/dbinc/mp.h:542:33: note: in expansion of macro 'atomic_read'
libdb-5.3.28-build/db-5.3.28/src/mp/mp_bh.c:481:34: note: in expansion of macro 'BH_REFCOUNT'
libdb-5.3.28-build/db-5.3.28/src/mp/mp_bh.c:482:21: note: in expansion of macro 'F_ISSET'
#  510|   	int ftype, ret;
#  511|   
#  512|-> 	env = dbmfp->env;
#  513|   	dbmp = env->mp_handle;
#  514|   	mfp = dbmfp->mfp;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def483]
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:1113: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/mp/mp_method.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/mp/mp_method.c: scope_hint: In function '__memp_nameop'
libdb-5.3.28-build/db-5.3.28/src/mp/mp_method.c:704:36: warning[-Wanalyzer-null-dereference]: dereference of NULL 'nhp'
libdb-5.3.28-build/db-5.3.28/src/dbinc/mutex.h:208:14: note: in definition of macro 'MUTEX_LOCK'
libdb-5.3.28-build/db-5.3.28/src/dbinc/mutex.h:208:14: note: in definition of macro 'MUTEX_LOCK'
libdb-5.3.28-build/db-5.3.28/src/dbinc/mutex.h:208:14: note: in definition of macro 'MUTEX_LOCK'
libdb-5.3.28-build/db-5.3.28/src/dbinc/mutex.h:208:14: note: in definition of macro 'MUTEX_LOCK'
#  702|   	MUTEX_LOCK(env, hp->mtx_hash);
#  703|   	if (nhp != NULL && nhp > hp)
#  704|-> 		MUTEX_LOCK(env, nhp->mtx_hash);
#  705|   	locked = 1;
#  706|   

Error: COMPILER_WARNING (CWE-563): [#def484]
libdb-5.3.28-build/db-5.3.28/src/mp/mp_resize.c: scope_hint: In function '__memp_add_bucket'
libdb-5.3.28-build/db-5.3.28/src/mp/mp_resize.c:332:14: warning[-Wunused-but-set-variable]: variable 'env' set but not used
#  332 |         ENV *env;
#      |              ^~~
#  330|   	DB_MPOOL *dbmp;
#  331|   {
#  332|-> 	ENV *env;
#  333|   	MPOOL *mp;
#  334|   	u_int32_t high_mask, new_bucket, old_bucket;

Error: COMPILER_WARNING (CWE-563): [#def485]
libdb-5.3.28-build/db-5.3.28/src/mp/mp_resize.c: scope_hint: In function '__memp_remove_bucket'
libdb-5.3.28-build/db-5.3.28/src/mp/mp_resize.c:404:14: warning[-Wunused-but-set-variable]: variable 'env' set but not used
#  404 |         ENV *env;
#      |              ^~~
#  402|   	DB_MPOOL *dbmp;
#  403|   {
#  404|-> 	ENV *env;
#  405|   	MPOOL *mp;
#  406|   	u_int32_t high_mask, new_bucket, old_bucket;

Error: COMPILER_WARNING (CWE-563): [#def486]
libdb-5.3.28-build/db-5.3.28/src/mp/mp_trickle.c:53:16: warning[-Wunused-variable]: unused variable 'c_mp'
#   53 |         MPOOL *c_mp, *mp;
#      |                ^~~~
#   51|   {
#   52|   	DB_MPOOL *dbmp;
#   53|-> 	MPOOL *c_mp, *mp;
#   54|   	u_int32_t clean, dirty, i, need_clean, total, dtmp, wrote;
#   55|   	int ret;

Error: COMPILER_WARNING (CWE-563): [#def487]
libdb-5.3.28-build/db-5.3.28/src/mp/mp_trickle.c:54:33: warning[-Wunused-variable]: unused variable 'i'
#   54 |         u_int32_t clean, dirty, i, need_clean, total, dtmp, wrote;
#      |                                 ^
#   52|   	DB_MPOOL *dbmp;
#   53|   	MPOOL *c_mp, *mp;
#   54|-> 	u_int32_t clean, dirty, i, need_clean, total, dtmp, wrote;
#   55|   	int ret;
#   56|   

Error: COMPILER_WARNING (CWE-563): [#def488]
libdb-5.3.28-build/db-5.3.28/src/mp/mp_trickle.c: scope_hint: In function '__memp_trickle'
libdb-5.3.28-build/db-5.3.28/src/mp/mp_trickle.c:54:55: warning[-Wunused-variable]: unused variable 'dtmp'
#   54 |         u_int32_t clean, dirty, i, need_clean, total, dtmp, wrote;
#      |                                                       ^~~~
#   52|   	DB_MPOOL *dbmp;
#   53|   	MPOOL *c_mp, *mp;
#   54|-> 	u_int32_t clean, dirty, i, need_clean, total, dtmp, wrote;
#   55|   	int ret;
#   56|   

Error: COMPILER_WARNING (CWE-691): [#def489]
libdb-5.3.28-build/db-5.3.28/src/mutex/mut_region.c: scope_hint: In function '__mutex_region_max'
libdb-5.3.28-build/db-5.3.28/src/mutex/mut_region.c:386:12: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous 'else'
#  386 |         if ((max = dbenv->mutex_max) == 0 && mutex_cnt != UINT32_MAX)
#      |            ^
#  384|   	 * mutexes. If mutex_cnt is UINT32_MAX, no more space is allowed.
#  385|   	 */
#  386|-> 	if ((max = dbenv->mutex_max) == 0 && mutex_cnt != UINT32_MAX)
#  387|   		if (F_ISSET(env, ENV_PRIVATE | ENV_THREAD) == ENV_PRIVATE)
#  388|   			if (dbenv->mutex_inc + 1 < UINT32_MAX - mutex_cnt)

Error: CPPCHECK_WARNING (CWE-476): [#def490]
libdb-5.3.28-build/db-5.3.28/src/qam/qam.c:1664: error[ctunullpointer]: Null pointer dereference: key
# 1662|   {
# 1663|   	/* If passed an empty DBT from Java, key->data may be NULL */
# 1664|-> 	if (key->size != sizeof(db_recno_t)) {
# 1665|   		__db_errx(dbp->env, DB_STR("1143",
# 1666|   		    "illegal record number size"));

Error: CPPCHECK_WARNING (CWE-457): [#def491]
libdb-5.3.28-build/db-5.3.28/src/qam/qam_verify.c:340: error[uninitvar]: Uninitialized variables: &fakedb.pgsize, &fakedb.priority, &fakedb.db_append_recno, &fakedb.db_feedback, &fakedb.dup_compare, &fakedb.app_private, &fakedb.dbenv, &fakedb.env, &fakedb.type, &fakedb.mpf, &fakedb.mutex, &fakedb.fname, &fakedb.dname, &fakedb.dirname, &fakedb.open_flags, &fakedb.adj_fileid, &fakedb.log_filename, &fakedb.meta_pgno, &fakedb.locker, &fakedb.cur_locker, &fakedb.cur_txn, &fakedb.associate_locker, &fakedb.handle_lock, &fakedb.timestamp, &fakedb.fid_gen, &fakedb.my_rskey, &fakedb.my_rk [...]
#  338|   
#  339|   	for (i = 0; i < vdp->rec_page; i++) {
#  340|-> 		qp = QAM_GET_RECORD(&fakedb, h, i);
#  341|   		if ((u_int8_t *)qp >= (u_int8_t *)h + dbp->pgsize) {
#  342|   			EPRINT((dbp->env, DB_STR_A("1150",
libdb-5.3.28-build/db-5.3.28/src/qam/qam_verify.c:340: note: trimmed 1 message(s) with length over 512

Error: COMPILER_WARNING (CWE-457): [#def492]
libdb-5.3.28-build/db-5.3.28/src/rep/rep_backup.c: scope_hint: In function '__rep_reset_init'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_backup.c:3264:20: warning[-Wmaybe-uninitialized]: 'dbtvers' may be used uninitialized
# 3264 |         if ((ret = __rep_update_unmarshal(env, dbtvers,
#      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3265 |             &rup, dbt.data, dbt.size, &next)) != 0)
#      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/src/rep/rep_backup.c:3169:19: note: 'dbtvers' was declared here
# 3169 |         u_int32_t dbtvers, fvers, zero;
#      |                   ^~~~~~~
# 3262|   	 * searching them out on a walk through the data_dir's.
# 3263|   	 */
# 3264|-> 	if ((ret = __rep_update_unmarshal(env, dbtvers,
# 3265|   	    &rup, dbt.data, dbt.size, &next)) != 0)
# 3266|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def493]
libdb-5.3.28-build/db-5.3.28/src/rep/rep_lease.c: scope_hint: In function '__rep_lease_grant'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_lease.c:215:15: warning[-Wanalyzer-null-dereference]: dereference of NULL 'le'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:1109: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/rep/rep_lease.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/dbinc/clock.h:102:42: note: in definition of macro 'timespecset'
#  213|   	    "lease_grant: grant msg time %lu %lu",
#  214|   	    (u_long)msg_time.tv_sec, (u_long)msg_time.tv_nsec));
#  215|-> 	if (le->eid == DB_EID_INVALID ||
#  216|   	    timespeccmp(&msg_time, &le->start_time, >)) {
#  217|   		le->eid = eid;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def494]
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:1113: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c: scope_hint: In function '__rep_start_int'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c:480:28: warning[-Wanalyzer-null-dereference]: dereference of NULL 'rep'
libdb-5.3.28-build/db-5.3.28/src/dbinc/mutex.h:208:14: note: in definition of macro 'MUTEX_LOCK'
libdb-5.3.28-build/db-5.3.28/src/dbinc/rep.h:552:10: note: in expansion of macro 'REP_ON'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c:471:13: note: in expansion of macro 'IS_USING_LEASES'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c:477:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c:477:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:629:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c:477:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:629:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c:477:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_method.c:477:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/src/dbinc/mutex.h:208:14: note: in definition of macro 'MUTEX_LOCK'
libdb-5.3.28-build/db-5.3.28/src/dbinc/mutex.h:208:14: note: in definition of macro 'MUTEX_LOCK'
#  478|   
#  479|   	/* Serialize rep_start() calls. */
#  480|-> 	MUTEX_LOCK(env, rep->mtx_repstart);
#  481|   	start_th = 1;
#  482|   

Error: COMPILER_WARNING (CWE-563): [#def495]
libdb-5.3.28-build/db-5.3.28/src/rep/rep_util.c: scope_hint: In function '__rep_lockout_int'
libdb-5.3.28-build/db-5.3.28/src/rep/rep_util.c:1557:18: warning[-Wunused-but-set-variable]: variable 'wait_cnt' set but not used
# 1557 |         int ret, wait_cnt;
#      |                  ^~~~~~~~
# 1555|   	u_int32_t field_val, lockout_flag;
# 1556|   {
# 1557|-> 	int ret, wait_cnt;
# 1558|   
# 1559|   	FLD_SET(rep->lockout_flags, lockout_flag);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def496]
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_method.c: scope_hint: In function 'set_local_site'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_method.c:2940:29: warning[-Wanalyzer-null-dereference]: dereference of NULL 'db_rep'
# 2938|   			db_rep->self_eid = rep->self_eid;
# 2939|   	}
# 2940|-> 	if (!value && db_rep->self_eid == dbsite->eid) {
# 2941|   		__db_errx(env, DB_STR("3666",
# 2942|   		    "A previously given local site may not be unset"));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def497]
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:1115: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_method.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_method.c:2944:39: warning[-Wanalyzer-null-dereference]: dereference of NULL 'db_rep'
libdb-5.3.28-build/db-5.3.28/src/dbinc/repmgr.h:484:35: note: in definition of macro 'IS_VALID_EID'
libdb-5.3.28-build/db-5.3.28/src/dbinc/repmgr.h:484:35: note: in definition of macro 'IS_VALID_EID'
libdb-5.3.28-build/db-5.3.28/src/dbinc/repmgr.h:484:35: note: in definition of macro 'IS_VALID_EID'
# 2942|   		    "A previously given local site may not be unset"));
# 2943|   		ret = EINVAL;
# 2944|-> 	} else if (IS_VALID_EID(db_rep->self_eid) &&
# 2945|   	    db_rep->self_eid != dbsite->eid) {
# 2946|   		__db_errx(env, DB_STR("3667",

Error: COMPILER_WARNING (CWE-563): [#def498]
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_msg.c: scope_hint: In function 'dispatch_app_message'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_msg.c:190:13: warning[-Wunused-but-set-variable]: variable 'ret' set but not used
#  190 |         int ret;
#      |             ^~~
#  188|   	u_int8_t *data;
#  189|   	void *ptr;
#  190|-> 	int ret;
#  191|   
#  192|   	COMPQUIET(size, 0);

Error: COMPILER_WARNING (CWE-563): [#def499]
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_msg.c: scope_hint: In function 'reject_fwd'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_msg.c:1563:13: warning[-Wunused-but-set-variable]: variable 'ret' set but not used
# 1563 |         int ret;
#      |             ^~~
# 1561|   	u_int32_t msg_type;
# 1562|   	size_t len;
# 1563|-> 	int ret;
# 1564|   
# 1565|   	db_rep = env->rep_handle;

Error: COMPILER_WARNING (CWE-563): [#def500]
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_msg.c: scope_hint: In function 'marshal_site_key'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_msg.c:1607:13: warning[-Wunused-but-set-variable]: variable 'ret' set but not used
# 1607 |         int ret;
#      |             ^~~
# 1605|   	__repmgr_membership_key_args key;
# 1606|   	size_t len;
# 1607|-> 	int ret;
# 1608|   
# 1609|   	DB_INIT_DBT(key.host, addr->host, strlen(addr->host) + 1);

Error: COMPILER_WARNING (CWE-563): [#def501]
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_msg.c: scope_hint: In function '__repmgr_set_sites'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_msg.c:1643:13: warning[-Wunused-but-set-variable]: variable 'ret' set but not used
# 1643 |         int ret;
#      |             ^~~
# 1641|   {
# 1642|   	DB_REP *db_rep;
# 1643|-> 	int ret;
# 1644|   	u_int32_t n;
# 1645|   	u_int i;

Error: COMPILER_WARNING (CWE-457): [#def502]
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c:184:20: warning[-Wmaybe-uninitialized]: 'sock' may be used uninitialized
#  184 |         if ((ret = __repmgr_new_connection(env, &conn, s, CONN_CONNECTED)) != 0)
#      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c: scope_hint: In function '__repmgr_connect'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c:104:18: note: 'sock' was declared here
#  104 |         socket_t sock;
#      |                  ^~~~
#  182|   	int ret;
#  183|   
#  184|-> 	if ((ret = __repmgr_new_connection(env, &conn, s, CONN_CONNECTED)) != 0)
#  185|   		return (ret);
#  186|   

Error: COMPILER_WARNING (CWE-563): [#def503]
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c: scope_hint: In function 'send_connection'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c:797:17: warning[-Wunused-but-set-variable]: variable 'db_rep' set but not used
#  797 |         DB_REP *db_rep;
#      |                 ^~~~~~
#  795|   	int *sent;
#  796|   {
#  797|-> 	DB_REP *db_rep;
#  798|   	int ret;
#  799|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def504]
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c:1040:20: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'total_written'
libdb-5.3.28-build/db-5.3.28/src/dbinc/repmgr.h:219:36: note: in definition of macro 'REPMGR_IOVECS_ALLOC_SZ'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c:1032:9: note: in expansion of macro 'VPRINT'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_net.c:1032:9: note: in expansion of macro 'VPRINT'
# 1038|   	 * finish sending it later.
# 1039|   	 */
# 1040|-> 	if ((ret = enqueue_msg(env, conn, msg, total_written)) != 0)
# 1041|   		return (ret);
# 1042|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def505]
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_stat.c: scope_hint: In function '__repmgr_site_list'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_stat.c:291:58: warning[-Wanalyzer-null-dereference]: dereference of NULL 'db_rep'
#  289|   	 * the local site.
#  290|   	 */
#  291|-> 	for (i = 0, count = 0, total_size = 0; i < db_rep->site_cnt; i++) {
#  292|   		site = &db_rep->sites[i];
#  293|   

Error: COMPILER_WARNING (CWE-563): [#def506]
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_util.c: scope_hint: In function 'read_gmdb'
libdb-5.3.28-build/db-5.3.28/src/repmgr/repmgr_util.c:1404:15: warning[-Wunused-but-set-variable]: variable 'host' set but not used
# 1404 |         char *host;
#      |               ^~~~
# 1402|   	u_int8_t key_buf[MAX_MSG_BUF];
# 1403|   	u_int8_t metadata_buf[__REPMGR_MEMBER_METADATA_SIZE];
# 1404|-> 	char *host;
# 1405|   	size_t bufsize, len;
# 1406|   	u_int8_t *buf, *p;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def507]
libdb-5.3.28-build/db-5.3.28/src/sequence/seq_stat.c:12: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/sequence/seq_stat.c: scope_hint: In function '__seq_print_stats'
libdb-5.3.28-build/db-5.3.28/src/sequence/seq_stat.c:198:36: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'sp'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:281:17: note: in definition of macro 'DB_PCT'
libdb-5.3.28-build/db-5.3.28/src/sequence/seq_stat.c:14: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/sequence/seq_stat.c:132:9: note: in expansion of macro 'SEQ_ILLEGAL_BEFORE_OPEN'
libdb-5.3.28-build/db-5.3.28/src/sequence/seq_stat.c:134:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:629:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/sequence/seq_stat.c:134:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:629:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/sequence/seq_stat.c:134:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/src/sequence/seq_stat.c:134:9: note: in expansion of macro 'ENV_ENTER'
libdb-5.3.28-build/db-5.3.28/src/dbinc/rep.h:571:10: note: in expansion of macro 'REP_ON'
libdb-5.3.28-build/db-5.3.28/src/sequence/seq_stat.c:137:24: note: in expansion of macro 'IS_ENV_REPLICATED'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:281:17: note: in definition of macro 'DB_PCT'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:281:17: note: in definition of macro 'DB_PCT'
#  196|   	__db_dl_pct(env, "The number of sequence locks that required waiting",
#  197|   	    (u_long)sp->st_wait,
#  198|-> 	     DB_PCT(sp->st_wait, sp->st_wait + sp->st_nowait), NULL);
#  199|   	STAT_FMT("The current sequence value",
#  200|   	    INT64_FMT, db_seq_t, sp->st_current);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def508]
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c: scope_hint: In function '__xa_get_txn'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:133:44: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:1110: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:11: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:95:9: note: in expansion of macro 'COMPQUIET'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:95:9: note: in expansion of macro 'COMPQUIET'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:96:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:96:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:117:21: note: in expansion of macro 'LF_ISSET'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:89: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/src/dbinc/shqueue.h:332:14: note: in definition of macro 'SH_TAILQ_INSERT_HEAD'
libdb-5.3.28-build/db-5.3.28/src/dbinc/shqueue.h:332:14: note: in definition of macro 'SH_TAILQ_INSERT_HEAD'
#  131|   			    *txnp, xa_links, __db_txn);
#  132|   			(*txnp)->xa_thr_status = TXN_XA_THREAD_ASSOCIATED;
#  133|-> 			ip->dbth_xa_status = TXN_XA_THREAD_ASSOCIATED;
#  134|   
#  135|   			/* Initialize XA fields in the detail structure. */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def509]
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:176:52: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:95:9: note: in expansion of macro 'COMPQUIET'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:95:9: note: in expansion of macro 'COMPQUIET'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:96:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:96:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/dbinc/shqueue.h:253:11: note: in definition of macro 'SH_TAILQ_EMPTY'
libdb-5.3.28-build/db-5.3.28/src/dbinc/shqueue.h:317:22: note: in expansion of macro 'SH_TAILQ_FIRST'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:151:17: note: in expansion of macro 'SH_TAILQ_FOREACH'
libdb-5.3.28-build/db-5.3.28/src/dbinc/shqueue.h:253:11: note: in definition of macro 'SH_TAILQ_EMPTY'
libdb-5.3.28-build/db-5.3.28/src/dbinc/shqueue.h:317:22: note: in expansion of macro 'SH_TAILQ_FIRST'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:151:17: note: in expansion of macro 'SH_TAILQ_FOREACH'
libdb-5.3.28-build/db-5.3.28/src/dbinc/shqueue.h:317:22: note: in expansion of macro 'SH_TAILQ_FIRST'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:151:17: note: in expansion of macro 'SH_TAILQ_FOREACH'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:169:36: note: in expansion of macro 'LF_ISSET'
#  174|   				(*txnp)->xa_thr_status =
#  175|   				    TXN_XA_THREAD_ASSOCIATED;
#  176|-> 				ip->dbth_xa_status = TXN_XA_THREAD_ASSOCIATED;
#  177|   				if ((*txnp) !=
#  178|   				    SH_TAILQ_FIRST(&ip->dbth_xatxn, __db_txn)) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def510]
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:202:52: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:95:9: note: in expansion of macro 'COMPQUIET'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:95:9: note: in expansion of macro 'COMPQUIET'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:96:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:96:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/dbinc/shqueue.h:253:11: note: in definition of macro 'SH_TAILQ_EMPTY'
libdb-5.3.28-build/db-5.3.28/src/dbinc/shqueue.h:317:22: note: in expansion of macro 'SH_TAILQ_FIRST'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:151:17: note: in expansion of macro 'SH_TAILQ_FOREACH'
libdb-5.3.28-build/db-5.3.28/src/dbinc/shqueue.h:253:11: note: in definition of macro 'SH_TAILQ_EMPTY'
libdb-5.3.28-build/db-5.3.28/src/dbinc/shqueue.h:317:22: note: in expansion of macro 'SH_TAILQ_FIRST'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:151:17: note: in expansion of macro 'SH_TAILQ_FOREACH'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:151:17: note: in expansion of macro 'SH_TAILQ_FOREACH'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:189:29: note: in expansion of macro 'LF_ISSET'
#  200|   					ret = XAER_RMFAIL;
#  201|   				}
#  202|-> 				ip->dbth_xa_status = TXN_XA_THREAD_ASSOCIATED;
#  203|   				(*txnp)->xa_thr_status =
#  204|   				    TXN_XA_THREAD_ASSOCIATED;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def511]
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c: scope_hint: In function '__xa_thread_enter'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:253:36: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:250:9: note: in expansion of macro 'COMPQUIET'
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:1111: included_from: Included from here.
libdb-5.3.28-build/db-5.3.28/dist/dist-tls/db_int.h:617:9: note: in expansion of macro 'PANIC_CHECK_RET'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:251:9: note: in expansion of macro 'ENV_ENTER_RET'
libdb-5.3.28-build/db-5.3.28/src/xa/xa.c:251:9: note: in expansion of macro 'ENV_ENTER_RET'
#  251|   	ENV_ENTER_RET(env, ip, ret);
#  252|   	if (ret == 0)
#  253|-> 		ip->dbth_xa_status = TXN_XA_THREAD_UNASSOCIATED;
#  254|   	*ipp = ip;
#  255|   	return (ret);

Error: COMPILER_WARNING: [#def512]
libdb-5.3.28-build/db-5.3.28/util/db_archive.c:14:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   14 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   12|   
#   13|   #ifndef lint
#   14|-> static const char copyright[] =
#   15|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   16|   #endif

Error: COMPILER_WARNING: [#def513]
libdb-5.3.28-build/db-5.3.28/util/db_checkpoint.c:14:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   14 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   12|   
#   13|   #ifndef lint
#   14|-> static const char copyright[] =
#   15|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   16|   #endif

Error: COMPILER_WARNING: [#def514]
libdb-5.3.28-build/db-5.3.28/util/db_deadlock.c:14:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   14 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   12|   
#   13|   #ifndef lint
#   14|-> static const char copyright[] =
#   15|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   16|   #endif

Error: COMPILER_WARNING: [#def515]
libdb-5.3.28-build/db-5.3.28/util/db_dump.c:16:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   16 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   14|   
#   15|   #ifndef lint
#   16|-> static const char copyright[] =
#   17|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   18|   #endif

Error: COMPILER_WARNING: [#def516]
libdb-5.3.28-build/db-5.3.28/util/db_dump185.c:10:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   10 | static const char copyright[] =
#      |                   ^~~~~~~~~
#    8|   
#    9|   #ifndef lint
#   10|-> static const char copyright[] =
#   11|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   12|   #endif

Error: COMPILER_WARNING: [#def517]
libdb-5.3.28-build/db-5.3.28/util/db_hotbackup.c:17:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   17 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   15|   
#   16|   #ifndef lint
#   17|-> static const char copyright[] =
#   18|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   19|   #endif

Error: CPPCHECK_WARNING (CWE-401): [#def518]
libdb-5.3.28-build/db-5.3.28/util/db_hotbackup.c:102: error[memleakOnRealloc]: Common realloc mistake: 'data_dir' nulled but not freed upon failure
#  100|   			if (data_dir == NULL || data_next >= data_cnt - 2) {
#  101|   				data_cnt = data_cnt == 0 ? 20 : data_cnt * 2;
#  102|-> 				if ((data_dir = realloc(data_dir,
#  103|   				    data_cnt * sizeof(*data_dir))) == NULL) {
#  104|   					fprintf(stderr, "%s: %s\n",

Error: COMPILER_WARNING: [#def519]
libdb-5.3.28-build/db-5.3.28/util/db_load.c:16:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   16 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   14|   
#   15|   #ifndef lint
#   16|-> static const char copyright[] =
#   17|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   18|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def520]
libdb-5.3.28-build/db-5.3.28/util/db_load.c: scope_hint: In function 'dbt_rprint'
libdb-5.3.28-build/db-5.3.28/util/db_load.c:1271:40: warning[-Wanalyzer-malloc-leak]: leak of 'p'
libdb-5.3.28-build/db-5.3.28/util/db_load.c:1277:29: note: in expansion of macro 'G'
# 1269|   			if (len == 0) {
# 1270|   				G(endofile) = G(endodata) = 1;
# 1271|-> 				return (0);
# 1272|   			}
# 1273|   			return (badend(dbenv));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def521]
libdb-5.3.28-build/db-5.3.28/util/db_load.c: scope_hint: In function 'dbt_rdump'
libdb-5.3.28-build/db-5.3.28/util/db_load.c:1340:40: warning[-Wanalyzer-malloc-leak]: leak of 'p'
libdb-5.3.28-build/db-5.3.28/util/db_load.c:1346:29: note: in expansion of macro 'G'
libdb-5.3.28-build/db-5.3.28/util/db_load.c: scope_hint: In function 'dbt_rdump'
libdb-5.3.28-build/db-5.3.28/util/db_load.c:1371:17: note: in expansion of macro 'DIGITIZE'
libdb-5.3.28-build/db-5.3.28/util/db_load.c: scope_hint: In function 'dbt_rdump'
# 1338|   			if (len == 0) {
# 1339|   				G(endofile) = G(endodata) = 1;
# 1340|-> 				return (0);
# 1341|   			}
# 1342|   			return (badend(dbenv));

Error: COMPILER_WARNING: [#def522]
libdb-5.3.28-build/db-5.3.28/util/db_printlog.c:23:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   23 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   21|   
#   22|   #ifndef lint
#   23|-> static const char copyright[] =
#   24|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   25|   #endif

Error: COMPILER_WARNING: [#def523]
libdb-5.3.28-build/db-5.3.28/util/db_recover.c:14:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   14 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   12|   
#   13|   #ifndef lint
#   14|-> static const char copyright[] =
#   15|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   16|   #endif

Error: COMPILER_WARNING: [#def524]
libdb-5.3.28-build/db-5.3.28/util/db_replicate.c: scope_hint: At top level
libdb-5.3.28-build/db-5.3.28/util/db_replicate.c:14:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   14 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   12|   
#   13|   #ifndef lint
#   14|-> static const char copyright[] =
#   15|       "Copyright (c) 2010, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   16|   #endif

Error: COMPILER_WARNING (CWE-563): [#def525]
libdb-5.3.28-build/db-5.3.28/util/db_replicate.c: scope_hint: In function 'main'
libdb-5.3.28-build/db-5.3.28/util/db_replicate.c:63:19: warning[-Wunused-but-set-variable]: variable 'flags' set but not used
#   63 |         u_int32_t flags, repmgr_th, seconds, start_state;
#      |                   ^~~~~
#   61|   	long argval;
#   62|   	db_timeout_t max_req;
#   63|-> 	u_int32_t flags, repmgr_th, seconds, start_state;
#   64|   	int ch, count, done, exitval, ret, verbose;
#   65|   	char *home, *passwd, *prog, time_buf[CTIME_BUFLEN];

Error: COMPILER_WARNING: [#def526]
libdb-5.3.28-build/db-5.3.28/util/db_stat.c:14:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   14 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   12|   
#   13|   #ifndef lint
#   14|-> static const char copyright[] =
#   15|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   16|   #endif

Error: COMPILER_WARNING: [#def527]
libdb-5.3.28-build/db-5.3.28/util/db_tuner.c: scope_hint: At top level
libdb-5.3.28-build/db-5.3.28/util/db_tuner.c:56:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   56 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   54|   
#   55|   #ifndef lint
#   56|-> static const char copyright[] =
#   57|       "Copyright (c) 2011, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   58|   #endif

Error: COMPILER_WARNING (CWE-563): [#def528]
libdb-5.3.28-build/db-5.3.28/util/db_tuner.c: scope_hint: In function '__tuner_opd_data'
libdb-5.3.28-build/db-5.3.28/util/db_tuner.c:670:19: warning[-Wunused-but-set-variable]: variable 'pgsize' set but not used
#  670 |         u_int32_t pgsize;
#      |                   ^~~~~~
#  668|   	PAGE *p;
#  669|   	db_pgno_t next_pgno;
#  670|-> 	u_int32_t pgsize;
#  671|   	int ret;
#  672|   

Error: CPPCHECK_WARNING (CWE-682): [#def529]
libdb-5.3.28-build/db-5.3.28/util/db_tuner.c:805: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  803|   	pgsize = (1 << indx_pgsz) * DB_MIN_PGSIZE;
#  804|   
#  805|-> 	if (key_sz > B_MINKEY_TO_OVFLSIZE(dbp, 2, pgsize))
#  806|   		is_big_key = 1;
#  807|   

Error: CPPCHECK_WARNING (CWE-682): [#def530]
libdb-5.3.28-build/db-5.3.28/util/db_tuner.c:808: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  806|   		is_big_key = 1;
#  807|   
#  808|-> 	if (data_sz > B_MINKEY_TO_OVFLSIZE(dbp, 2, pgsize))
#  809|   		is_big_data = 1;
#  810|   

Error: CPPCHECK_WARNING (CWE-682): [#def531]
libdb-5.3.28-build/db-5.3.28/util/db_tuner.c:902: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  900|   	pgsize = (1 << indx_pgsz) * DB_MIN_PGSIZE;
#  901|   
#  902|-> 	if (data_sz > B_MINKEY_TO_OVFLSIZE(dbp, 2, pgsize))
#  903|   		is_big_data = 1;
#  904|   

Error: COMPILER_WARNING: [#def532]
libdb-5.3.28-build/db-5.3.28/util/db_upgrade.c:14:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   14 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   12|   
#   13|   #ifndef lint
#   14|-> static const char copyright[] =
#   15|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   16|   #endif

Error: COMPILER_WARNING: [#def533]
libdb-5.3.28-build/db-5.3.28/util/db_verify.c:14:19: warning[-Wunused-const-variable=]: 'copyright' defined but not used
#   14 | static const char copyright[] =
#      |                   ^~~~~~~~~
#   12|   
#   13|   #ifndef lint
#   14|-> static const char copyright[] =
#   15|       "Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.\n";
#   16|   #endif

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-126.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namelibdb-5.3.28-64.fc42
store-results-to/tmp/tmpzas_ehdz/libdb-5.3.28-64.fc42.tar.xz
time-created2024-11-13 01:34:13
time-finished2024-11-13 01:49:31
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpzas_ehdz/libdb-5.3.28-64.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpzas_ehdz/libdb-5.3.28-64.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9