zvbi-0.2.44-1.fc43

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
zvbi-0.2.44/contrib/../src/exp-gfx.c:1581:24: warning[-Wanalyzer-malloc-leak]: leak of ‘indexed_image’
zvbi-0.2.44/contrib/../src/exp-gfx.c:1495:12: branch_false: following ‘false’ branch...
zvbi-0.2.44/contrib/../src/exp-gfx.c:1503:29: branch_false: ...to here
zvbi-0.2.44/contrib/../src/exp-gfx.c:1520:25: acquire_memory: allocated here
zvbi-0.2.44/contrib/../src/exp-gfx.c:1521:12: branch_false: following ‘false’ branch...
zvbi-0.2.44/contrib/../src/exp-gfx.c:1526:17: branch_false: ...to here
zvbi-0.2.44/contrib/../src/exp-gfx.c:1580:20: branch_true: following ‘true’ branch...
zvbi-0.2.44/contrib/../src/exp-gfx.c:1581:24: branch_true: ...to here
zvbi-0.2.44/contrib/../src/exp-gfx.c:1581:24: danger: ‘indexed_image’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1579|   
# 1580|   		if (unlikely (!_vbi_export_grow_buffer_space (e, needed)))
# 1581|-> 		return FALSE;
# 1582|   	}
# 1583|   

Error: COMPILER_WARNING: [#def2]
zvbi-0.2.44/contrib/atsc-cc.c: scope_hint: In function ‘open_minicut_file’
zvbi-0.2.44/contrib/atsc-cc.c:1159:9: warning[-Wuse-after-free]: pointer ‘buf_56’ used after ‘free’
# 1159 |         log_message (verb, /* print_errno */ TRUE, templ , ##args)
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
zvbi-0.2.44/contrib/atsc-cc.c:1413:9: note: call to ‘free’ here
# 1413 |         free (buf);
#      |         ^~~~~~~~~~
# 1157|   
# 1158|   #define log_errno(verb, templ, args...) \
# 1159|-> 	log_message (verb, /* print_errno */ TRUE, templ , ##args)
# 1160|   
# 1161|   #define bug(templ, args...) \

Error: COMPILER_WARNING (CWE-457): [#def3]
zvbi-0.2.44/contrib/atsc-cc.c:2926:31: warning[-Wmaybe-uninitialized]: ‘window_rows’ may be used uninitialized
# 2926 |                  (window_rows - 1) * sizeof (ch->buffer[0][0]));
#      |                  ~~~~~~~~~~~~~^~~~
zvbi-0.2.44/contrib/atsc-cc.c: scope_hint: In function ‘decode_cc_data.part.0’
zvbi-0.2.44/contrib/atsc-cc.c:2836:22: note: ‘window_rows’ was declared here
# 2836 |         unsigned int window_rows;
#      |                      ^~~~~~~~~~~
# 2924|   	memmove (ch->buffer[curr_buffer][first_row],
# 2925|   		 ch->buffer[curr_buffer][first_row + 1],
# 2926|-> 		 (window_rows - 1) * sizeof (ch->buffer[0][0]));
# 2927|   
# 2928|   	ch->dirty[curr_buffer] >>= 1;

Error: CPPCHECK_WARNING (CWE-457): [#def4]
zvbi-0.2.44/contrib/atsc-cc.c:4694: warning[uninitvar]: Uninitialized variable: ucs2_str
# 4692|   
# 4693|   		vbi_fputs_iconv_ucs2 (fp, locale_codeset,
# 4694|-> 				      ucs2_str, dw->column_count,
# 4695|   				      /* repl_char */ '?');
# 4696|   		fputs ("'\n", fp);

Error: COMPILER_WARNING (CWE-457): [#def5]
zvbi-0.2.44/contrib/atsc-cc.c:5458:33: warning[-Wmaybe-uninitialized]: ‘mask’ may be used uninitialized
# 5458 |                 dw->streamed &= ~mask;
#      |                                 ^~~~~
zvbi-0.2.44/contrib/atsc-cc.c: scope_hint: In function ‘dtvcc_decode_packet.isra.0’
zvbi-0.2.44/contrib/atsc-cc.c:5418:22: note: ‘mask’ was declared here
# 5418 |         unsigned int mask;
#      |                      ^~~~
# 5456|   
# 5457|   	if (0 != dw->buffer[row][column]) {
# 5458|-> 		dw->streamed &= ~mask;
# 5459|   		dw->buffer[row][column] = 0;
# 5460|   	}

Error: COMPILER_WARNING (CWE-457): [#def6]
zvbi-0.2.44/contrib/atsc-cc.c:5512:25: warning[-Wmaybe-uninitialized]: ‘mask’ may be used uninitialized
# 5512 |         dw->streamed &= ~mask;
#      |                         ^~~~~
zvbi-0.2.44/contrib/atsc-cc.c: scope_hint: In function ‘dtvcc_decode_packet.isra.0’
zvbi-0.2.44/contrib/atsc-cc.c:5475:22: note: ‘mask’ was declared here
# 5475 |         unsigned int mask;
#      |                      ^~~~
# 5510|   	}
# 5511|   
# 5512|-> 	dw->streamed &= ~mask;
# 5513|   
# 5514|   	return TRUE;

Error: CPPCHECK_WARNING (CWE-758): [#def7]
zvbi-0.2.44/contrib/atsc-cc.c:6235: error[shiftTooManyBits]: Shifting 32-bit value by 56 bits is undefined behaviour
# 6233|   			pts = 0;
# 6234|   			for (i = 0; i < 8; ++i) {
# 6235|-> 				pts |= buffer[i] << (56 - i * 8);
# 6236|   			}
# 6237|   			decode_cc_data (pr, pts, &buffer[8], actual);

Error: CPPCHECK_WARNING (CWE-758): [#def8]
zvbi-0.2.44/contrib/atsc-cc.c:6450: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 6448|   			c = i << 24;
# 6449|   			for (j = 0; j < 8; ++j) {
# 6450|-> 				if (c & (1 << 31))
# 6451|   					c = (c << 1) ^ poly;
# 6452|   				else

Error: COMPILER_WARNING (CWE-569): [#def9]
zvbi-0.2.44/contrib/atsc-cc.c: scope_hint: In function ‘same_transponder’
zvbi-0.2.44/contrib/atsc-cc.c:7852:43: warning[-Wtautological-compare]: self-comparison always evaluates to false
# 7852 |                 if (s1->u.atsc.modulation != s1->u.atsc.modulation)
#      |                                           ^~
# 7850|   	switch (s1->type) {
# 7851|   	case FE_ATSC:
# 7852|-> 		if (s1->u.atsc.modulation != s1->u.atsc.modulation)
# 7853|   			return FALSE;
# 7854|   		break;

Error: COMPILER_WARNING (CWE-1164): [#def10]
zvbi-0.2.44/contrib/atsc-cc.c: scope_hint: In function ‘parse_time’
zvbi-0.2.44/contrib/atsc-cc.c:9505:1: warning[-Wunused-label]: label ‘dangit’ defined but not used
# 9505 | dangit:
#      | ^~~~~~
# 9503|   invalid:
# 9504|   	error_exit ("Invalid date format '%s'\n", s);
# 9505|-> dangit:
# 9506|   	error_exit ("Cannot parse dates, sorry.\n");
# 9507|   }

Error: COMPILER_WARNING (CWE-1164): [#def11]
zvbi-0.2.44/contrib/ntsc-cc.c: scope_hint: At top level
zvbi-0.2.44/contrib/ntsc-cc.c:162:12: warning[-Wunused-function]: ‘decode’ defined but not used
#  162 | static int decode(unsigned char *vbiline)
#      |            ^~~~~~
#  160|   }
#  161|   
#  162|-> static int decode(unsigned char *vbiline)
#  163|   {
#  164|       int max[7], min[7], val[7], i, clk, tmp, sample, packedbits = 0;

Error: COMPILER_WARNING (CWE-563): [#def12]
zvbi-0.2.44/contrib/ntsc-cc.c: scope_hint: In function ‘CCdecode’
zvbi-0.2.44/contrib/ntsc-cc.c:557:21: warning[-Wunused-but-set-variable]: variable ‘row’ set but not used
#  557 |         int b1, b2, row, x,y;
#      |                     ^~~
#  555|   static int CCdecode(int data)
#  556|   {
#  557|-> 	int b1, b2, row, x,y;
#  558|   
#  559|   	if (cur_ch[field] < 0)

Error: COMPILER_WARNING (CWE-483): [#def13]
zvbi-0.2.44/contrib/ntsc-cc.c: scope_hint: In function ‘print_raw’
zvbi-0.2.44/contrib/ntsc-cc.c:727:11: warning[-Wmisleading-indentation]: this ‘if’ clause does not guard...
#  727 |           if ( ( b2 >= 0x20 ) && ( b2 <= 0x7F ) )
#      |           ^~
zvbi-0.2.44/contrib/ntsc-cc.c:729:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
#  729 |             fflush(stderr);
#      |             ^~~~~~
#  725|   	// a control code.
#  726|   	if ( ( b1 >= 0x10 ) && ( b1 <= 0x1F ) ) {
#  727|-> 	  if ( ( b2 >= 0x20 ) && ( b2 <= 0x7F ) ) 
#  728|   	    fprintf(stderr,"[%02X-%02X]",b1,b2); 
#  729|   	    fflush(stderr);

Error: COMPILER_WARNING (CWE-483): [#def14]
zvbi-0.2.44/contrib/ntsc-cc.c: scope_hint: In function ‘check_fread’
zvbi-0.2.44/contrib/ntsc-cc.c:1061:17: warning[-Wmisleading-indentation]: this ‘if’ clause does not guard...
# 1061 |                 if (ferror (stdin))
#      |                 ^~
zvbi-0.2.44/contrib/ntsc-cc.c:1063:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
# 1063 |                         exit (EXIT_FAILURE);
#      |                         ^~~~
# 1059|   {
# 1060|   	if (n_expected_items != n_actual_items) {
# 1061|-> 		if (ferror (stdin))
# 1062|   			fprintf (stderr, "Error reading stream\n");
# 1063|   			exit (EXIT_FAILURE);

Error: COMPILER_WARNING (CWE-563): [#def15]
zvbi-0.2.44/contrib/ntsc-cc.c: scope_hint: In function ‘read_test_stream’
zvbi-0.2.44/contrib/ntsc-cc.c:1073:16: warning[-Wunused-but-set-variable]: variable ‘dt’ set but not used
# 1073 |         double dt;
#      |                ^~
# 1071|   {
# 1072|   	char buf[256];
# 1073|-> 	double dt;
# 1074|   	unsigned int n_items;
# 1075|   	vbi_sliced *s;

Error: COMPILER_WARNING (CWE-563): [#def16]
zvbi-0.2.44/contrib/ntsc-cc.c:1350:18: warning[-Wunused-variable]: unused variable ‘buf’
# 1350 |    unsigned char buf[65536];
#      |                  ^~~
# 1348|   int main(int argc,char **argv)
# 1349|   {
# 1350|->    unsigned char buf[65536];
# 1351|      int arg;
# 1352|      int args=0;

Error: COMPILER_WARNING (CWE-563): [#def17]
zvbi-0.2.44/contrib/ntsc-cc.c:1351:8: warning[-Wunused-variable]: unused variable ‘arg’
# 1351 |    int arg;
#      |        ^~~
# 1349|   {
# 1350|      unsigned char buf[65536];
# 1351|->    int arg;
# 1352|      int args=0;
# 1353|   

Error: COMPILER_WARNING (CWE-563): [#def18]
zvbi-0.2.44/contrib/ntsc-cc.c:1352:8: warning[-Wunused-variable]: unused variable ‘args’
# 1352 |    int args=0;
#      |        ^~~~
# 1350|      unsigned char buf[65536];
# 1351|      int arg;
# 1352|->    int args=0;
# 1353|   
# 1354|   #ifndef HAVE_ZVBI

Error: COMPILER_WARNING (CWE-563): [#def19]
zvbi-0.2.44/contrib/ntsc-cc.c: scope_hint: In function ‘main’
zvbi-0.2.44/contrib/ntsc-cc.c:1364:18: warning[-Wunused-but-set-variable]: variable ‘use_cc_filter’ set but not used
# 1364 |         vbi_bool use_cc_filter;
#      |                  ^~~~~~~~~~~~~
# 1362|   	int verbose;
# 1363|   	int have_xds_filter_option;
# 1364|-> 	vbi_bool use_cc_filter;
# 1365|   	unsigned int i;
# 1366|   	unsigned int channels;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def20]
zvbi-0.2.44/contrib/ntsc-cc.c:1605:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cap’
zvbi-0.2.44/contrib/ntsc-cc.c:1390:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
zvbi-0.2.44/contrib/ntsc-cc.c:1391:17: branch_true: ...to here
zvbi-0.2.44/contrib/ntsc-cc.c:1521:12: branch_false: following ‘false’ branch...
zvbi-0.2.44/contrib/ntsc-cc.c:1527:12: branch_false: ...to here
zvbi-0.2.44/contrib/ntsc-cc.c:1550:10: branch_true: following ‘true’ branch...
 branch_true: ...to here
zvbi-0.2.44/contrib/ntsc-cc.c:1601:7: branch_false: following ‘false’ branch...
zvbi-0.2.44/contrib/ntsc-cc.c:1605:18: danger: use of uninitialized value ‘cap’ here
# 1603|   	   src_h = 50;
# 1604|      } else {
# 1605|-> 	   par = vbi_capture_parameters (cap);
# 1606|   	   assert (NULL != par);
# 1607|   

Error: COMPILER_WARNING (CWE-457): [#def21]
zvbi-0.2.44/contrib/ntsc-cc.c: scope_hint: In function ‘main’
zvbi-0.2.44/contrib/ntsc-cc.c:1605:18: warning[-Wmaybe-uninitialized]: ‘cap’ may be used uninitialized
# 1605 |            par = vbi_capture_parameters (cap);
#      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
zvbi-0.2.44/contrib/ntsc-cc.c:1370:17: note: ‘cap’ was declared here
# 1370 |    vbi_capture *cap;
#      |                 ^~~
# 1603|   	   src_h = 50;
# 1604|      } else {
# 1605|-> 	   par = vbi_capture_parameters (cap);
# 1606|   	   assert (NULL != par);
# 1607|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def22]
zvbi-0.2.44/contrib/ntsc-cc.c:1681:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cap’
zvbi-0.2.44/contrib/ntsc-cc.c:1390:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
zvbi-0.2.44/contrib/ntsc-cc.c:1391:17: branch_true: ...to here
zvbi-0.2.44/contrib/ntsc-cc.c:1521:12: branch_false: following ‘false’ branch...
zvbi-0.2.44/contrib/ntsc-cc.c:1527:12: branch_false: ...to here
zvbi-0.2.44/contrib/ntsc-cc.c:1550:10: branch_true: following ‘true’ branch...
 branch_true: ...to here
zvbi-0.2.44/contrib/ntsc-cc.c:1601:7: branch_true: following ‘true’ branch...
zvbi-0.2.44/contrib/ntsc-cc.c:1618:21: branch_true: ...to here
zvbi-0.2.44/contrib/ntsc-cc.c:1621:4: branch_true: following ‘true’ branch (when ‘raw’ is non-NULL)...
zvbi-0.2.44/contrib/ntsc-cc.c:1622:4: branch_true: ...to here
zvbi-0.2.44/contrib/ntsc-cc.c:1622:4: branch_true: following ‘true’ branch (when ‘sliced’ is non-NULL)...
zvbi-0.2.44/contrib/ntsc-cc.c:1625:4: branch_true: ...to here
zvbi-0.2.44/contrib/ntsc-cc.c:1676:20: branch_false: following ‘false’ branch...
zvbi-0.2.44/contrib/ntsc-cc.c:1678:28: branch_false: ...to here
zvbi-0.2.44/contrib/ntsc-cc.c:1678:27: branch_false: following ‘false’ branch...
zvbi-0.2.44/contrib/ntsc-cc.c:1681:29: branch_false: ...to here
zvbi-0.2.44/contrib/ntsc-cc.c:1681:29: danger: use of uninitialized value ‘cap’ here
# 1679|   			r = read_test_stream (sliced, &n_lines, src_h);
# 1680|   		} else {
# 1681|-> 			r = vbi_capture_read (cap, raw, sliced,
# 1682|   					      &n_lines, &timestamp, &timeout);
# 1683|   		}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def23]
zvbi-0.2.44/contrib/x11font.c:13:5: warning[-Wanalyzer-null-argument]: use of NULL ‘fp’ where non-null expected
zvbi-0.2.44/contrib/x11font.c:54:1: enter_function: entry to ‘print_font’
zvbi-0.2.44/contrib/x11font.c:64:8: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
zvbi-0.2.44/contrib/x11font.c:65:14: branch_true: ...to here
zvbi-0.2.44/contrib/x11font.c:65:14: acquire_memory: allocated here
zvbi-0.2.44/contrib/x11font.c:66:12: release_memory: assuming ‘fopen(filename, "w")’ is NULL
zvbi-0.2.44/contrib/x11font.c:66:12: branch_true: following ‘true’ branch...
zvbi-0.2.44/contrib/x11font.c:67:62: branch_true: ...to here
zvbi-0.2.44/contrib/x11font.c:71:5: call_function: calling ‘print_head’ from ‘print_font’
#   11|   		       int width, int height)
#   12|   {
#   13|->     fprintf(fp,
#   14|   	    "STARTFONT 2.1\n"
#   15|   	    "FONT -%s-%s-Medium-%s-Normal--%d-%d-75-75-C-%d-ISO10646-1\n"

Error: COMPILER_WARNING (CWE-681): [#def24]
zvbi-0.2.44/contrib/x11font.c: scope_hint: In function ‘main’
zvbi-0.2.44/contrib/x11font.c:129:48: warning[-Wpointer-sign]: pointer targets in passing argument 5 of ‘print_font’ differ in signedness
#  129 |     print_font("caption.bdf","Ets","Caption",0,ccfont2_bits,
#      |                                                ^~~~~~~~~~~~
#      |                                                |
#      |                                                char *
zvbi-0.2.44/contrib/x11font.c:57:21: note: expected ‘uint8_t *’ {aka ‘unsigned char *’} but argument is of type ‘char *’
#   57 |            uint8_t *font, int cw, int ch, int cpl, int hs,
#      |            ~~~~~~~~~^~~~
#  127|       print_font("teletext4i.bdf","Ets","Teletext",1,wstfont2_bits,
#  128|   	       TCW,TCH,TCPL,4,1449,unicode_wstfont2,357);
#  129|->     print_font("caption.bdf","Ets","Caption",0,ccfont2_bits,
#  130|   	       CCW,CCH,CCPL,1,120,unicode_ccfont2,15);
#  131|       print_font("captioni.bdf","Ets","Caption",1,ccfont2_bits,

Error: COMPILER_WARNING (CWE-681): [#def25]
zvbi-0.2.44/contrib/x11font.c:131:49: warning[-Wpointer-sign]: pointer targets in passing argument 5 of ‘print_font’ differ in signedness
#  131 |     print_font("captioni.bdf","Ets","Caption",1,ccfont2_bits,
#      |                                                 ^~~~~~~~~~~~
#      |                                                 |
#      |                                                 char *
zvbi-0.2.44/contrib/x11font.c:57:21: note: expected ‘uint8_t *’ {aka ‘unsigned char *’} but argument is of type ‘char *’
#   57 |            uint8_t *font, int cw, int ch, int cpl, int hs,
#      |            ~~~~~~~~~^~~~
#  129|       print_font("caption.bdf","Ets","Caption",0,ccfont2_bits,
#  130|   	       CCW,CCH,CCPL,1,120,unicode_ccfont2,15);
#  131|->     print_font("captioni.bdf","Ets","Caption",1,ccfont2_bits,
#  132|   	       CCW,CCH,CCPL,1,120,unicode_ccfont2,15 + 4 * 32);
#  133|       return 0;

Error: COMPILER_WARNING: [#def26]
zvbi-0.2.44/daemon/chains.c:48:19: warning[-Wunused-const-variable=]: ‘rcsid’ defined but not used
#   48 | static const char rcsid[] = "$Id: chains.c,v 1.4 2008-07-26 06:22:28 mschimek Exp $";
#      |                   ^~~~~
#   46|    */
#   47|   
#   48|-> static const char rcsid[] = "$Id: chains.c,v 1.4 2008-07-26 06:22:28 mschimek Exp $";
#   49|   
#   50|   #include "config.h"

Error: CPPCHECK_WARNING (CWE-476): [#def27]
zvbi-0.2.44/daemon/proxyd.c:361: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_buf
#  359|   
#  360|            p_buf = malloc(QUEUE_ELEM_SIZE(p_buf, p_proxy_dev->max_lines));
#  361|->          p_buf->p_raw_data = NULL;
#  362|            p_buf->max_lines = p_proxy_dev->max_lines;
#  363|            p_proxy_dev->p_tmp_buf = p_buf;

Error: CPPCHECK_WARNING (CWE-476): [#def28]
zvbi-0.2.44/daemon/proxyd.c:362: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_buf
#  360|            p_buf = malloc(QUEUE_ELEM_SIZE(p_buf, p_proxy_dev->max_lines));
#  361|            p_buf->p_raw_data = NULL;
#  362|->          p_buf->max_lines = p_proxy_dev->max_lines;
#  363|            p_proxy_dev->p_tmp_buf = p_buf;
#  364|         }

Error: COMPILER_WARNING (CWE-563): [#def29]
zvbi-0.2.44/daemon/proxyd.c: scope_hint: In function ‘vbi_proxyd_get_token_owner’
zvbi-0.2.44/daemon/proxyd.c:1220:18: warning[-Wunused-but-set-variable]: variable ‘p_proxy_dev’ set but not used
# 1220 |    PROXY_DEV   * p_proxy_dev;
#      |                  ^~~~~~~~~~~
# 1218|   static PROXY_CLNT * vbi_proxyd_get_token_owner( int dev_idx )
# 1219|   {
# 1220|->    PROXY_DEV   * p_proxy_dev;
# 1221|      PROXY_CLNT  * p_walk;
# 1222|      PROXY_CLNT  * p_owner;

Error: COMPILER_WARNING (CWE-563): [#def30]
zvbi-0.2.44/daemon/proxyd.c: scope_hint: In function ‘vbi_proxyd_channel_schedule’
zvbi-0.2.44/daemon/proxyd.c:1417:18: warning[-Wunused-but-set-variable]: variable ‘p_proxy_dev’ set but not used
# 1417 |    PROXY_DEV   * p_proxy_dev;
#      |                  ^~~~~~~~~~~
# 1415|      PROXY_CLNT  * p_sched;
# 1416|      PROXY_CLNT  * p_active;
# 1417|->    PROXY_DEV   * p_proxy_dev;
# 1418|      time_t        now;
# 1419|   

Error: CPPCHECK_WARNING (CWE-476): [#def31]
zvbi-0.2.44/daemon/proxyd.c:1864: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_msg
# 1862|         /* filter for services requested by this client */
# 1863|         max_lines = req->vbi_count[0] + req->vbi_count[1];
# 1864|->       p_msg->body.sliced_ind.timestamp = req->p_sliced->timestamp;
# 1865|         p_msg->body.sliced_ind.sliced_lines = 0;
# 1866|         p_msg->body.sliced_ind.raw_lines = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def32]
zvbi-0.2.44/daemon/proxyd.c:1865: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_msg
# 1863|         max_lines = req->vbi_count[0] + req->vbi_count[1];
# 1864|         p_msg->body.sliced_ind.timestamp = req->p_sliced->timestamp;
# 1865|->       p_msg->body.sliced_ind.sliced_lines = 0;
# 1866|         p_msg->body.sliced_ind.raw_lines = 0;
# 1867|   

Error: CPPCHECK_WARNING (CWE-476): [#def33]
zvbi-0.2.44/daemon/proxyd.c:1866: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_msg
# 1864|         p_msg->body.sliced_ind.timestamp = req->p_sliced->timestamp;
# 1865|         p_msg->body.sliced_ind.sliced_lines = 0;
# 1866|->       p_msg->body.sliced_ind.raw_lines = 0;
# 1867|   
# 1868|         /* XXX TODO allow both raw and sliced in the same message */

Error: CPPCHECK_WARNING (CWE-476): [#def34]
zvbi-0.2.44/daemon/proxyd.c:1891: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_msg
# 1889|            }
# 1890|         }
# 1891|->       msg_size = VBIPROXY_SLICED_IND_SIZE(p_msg->body.sliced_ind.sliced_lines,
# 1892|                                             p_msg->body.sliced_ind.raw_lines);
# 1893|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
zvbi-0.2.44/daemon/proxyd.c:2710:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup(1)’
zvbi-0.2.44/daemon/proxyd.c:3129:5: enter_function: entry to ‘main’
zvbi-0.2.44/daemon/proxyd.c:3139:7: branch_false: following ‘false’ branch...
zvbi-0.2.44/daemon/proxyd.c:3145:4: branch_false: ...to here
zvbi-0.2.44/daemon/proxyd.c:3147:4: call_function: calling ‘vbi_proxyd_init’ from ‘main’
# 2708|            open("/dev/null", O_WRONLY, 0);
# 2709|            close(2);
# 2710|->          if (dup(1) == -1)
# 2711|                exit(1);
# 2712|   

Error: COMPILER_WARNING: [#def36]
zvbi-0.2.44/examples/pdc2.c:227:1: warning[-Wunused-const-variable=]: ‘signal_period’ defined but not used
#  227 | signal_period [VBI_MAX_PID_CHANNELS] = {
#      | ^~~~~~~~~~~~~
#  225|   
#  226|   static const double
#  227|-> signal_period [VBI_MAX_PID_CHANNELS] = {
#  228|   	/* EN 300 231 Section 8.3: "In the case of the packet 8/30
#  229|   	   version (Method B) the repetition rate of labels in any

Error: GCC_ANALYZER_WARNING (CWE-476): [#def37]
zvbi-0.2.44/src/cache.c:1008:28: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cp'
zvbi-0.2.44/src/cache.c:1782:1: enter_function: entry to 'vbi_cache_delete'
zvbi-0.2.44/src/cache.c:1789:9: call_function: calling 'vbi_cache_purge' from 'vbi_cache_delete'
# 1006|   
# 1007|   	FOR_ALL_NODES (cp, cp1, &ca->priority, pri_node)
# 1008|-> 		if (!cn || cp->network == cn)
# 1009|   			delete_page (ca, cp);
# 1010|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def38]
zvbi-0.2.44/src/cache.c:1555:36: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cp'
zvbi-0.2.44/src/cache.c:1449:9: branch_true: following 'true' branch (when 'ca' is non-NULL)...
zvbi-0.2.44/src/cache.c:1450:9: branch_true: ...to here
zvbi-0.2.44/src/cache.c:1450:9: branch_true: following 'true' branch (when 'cn' is non-NULL)...
zvbi-0.2.44/src/cache.c:1451:9: branch_true: ...to here
zvbi-0.2.44/src/cache.c:1451:9: branch_true: following 'true' branch (when 'cp' is non-NULL)...
zvbi-0.2.44/src/cache.c:1453:9: branch_true: ...to here
zvbi-0.2.44/src/cache.c:1453:9: branch_true: following 'true' branch...
zvbi-0.2.44/src/cache.c:1455:25: branch_true: ...to here
zvbi-0.2.44/src/cache.c:1473:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/cache.c:1479:9: branch_false: ...to here
zvbi-0.2.44/src/cache.c:1521:12: branch_false: following 'false' branch...
 branch_false: ...to here
zvbi-0.2.44/src/cache.c:1543:12: branch_false: following 'false' branch (when 'memory_available < memory_needed')...
 branch_false: ...to here
zvbi-0.2.44/src/cache.c:1548:38: branch_true: following 'true' branch (when 'pri != 3')...
zvbi-0.2.44/src/cache.c:1551:17: branch_true: ...to here
zvbi-0.2.44/src/cache.c:1551:17: branch_false: following 'false' branch (when '_p' is NULL)...
zvbi-0.2.44/src/cache.c:1551:17: branch_false: ...to here
zvbi-0.2.44/src/cache.c:1551:17: branch_true: following 'true' branch...
zvbi-0.2.44/src/cache.c:1552:28: branch_true: ...to here
zvbi-0.2.44/src/cache.c:1552:28: branch_false: following 'false' branch (when 'memory_available < memory_needed')...
zvbi-0.2.44/src/cache.c:1555:36: branch_false: ...to here
zvbi-0.2.44/src/cache.c:1555:36: danger: dereference of NULL 'cp'
# 1553|   				goto replace;
# 1554|   
# 1555|-> 			if (pri != cp->priority
# 1556|   			    || cp->network->ref_count > 0
# 1557|   			    || cp == old_cp)

Error: COMPILER_WARNING (CWE-457): [#def39]
zvbi-0.2.44/src/cc608_decoder.c:1373:31: warning[-Wmaybe-uninitialized]: 'window_rows' may be used uninitialized
# 1373 |                  (window_rows - 1) * sizeof (ch->buffer[0][0]));
#      |                  ~~~~~~~~~~~~~^~~~
zvbi-0.2.44/src/cc608_decoder.c: scope_hint: In function '_vbi_cc608_decoder_feed'
zvbi-0.2.44/src/cc608_decoder.c:1289:22: note: 'window_rows' was declared here
# 1289 |         unsigned int window_rows;
#      |                      ^~~~~~~~~~~
# 1371|   	memmove (ch->buffer[curr_buffer][first_row],
# 1372|   		 ch->buffer[curr_buffer][first_row + 1],
# 1373|-> 		 (window_rows - 1) * sizeof (ch->buffer[0][0]));
# 1374|   
# 1375|   	ch->dirty[curr_buffer] >>= 1;

Error: COMPILER_WARNING: [#def40]
zvbi-0.2.44/src/conv.c: scope_hint: In function '_vbi_strndup_iconv'
zvbi-0.2.44/src/conv.c:876:28: warning[-Wnonnull-compare]: 'nonnull' argument 'out_size' compared to NULL
#  876 |                         if (NULL != out_size)
#      |                            ^
#  874|   	} else if (same_codeset (src_codeset, "UCS2")) {
#  875|   		if (NULL != src && 0 != (src_size & 1)) {
#  876|-> 			if (NULL != out_size)
#  877|   				*out_size = 0;
#  878|   			errno = EILSEQ;

Error: COMPILER_WARNING (CWE-563): [#def41]
zvbi-0.2.44/src/decoder.c: scope_hint: In function 'vbi_raw_decoder_resize'
zvbi-0.2.44/src/decoder.c:544:25: warning[-Wunused-but-set-variable]: variable 'service_set' set but not used
#  544 |         vbi_service_set service_set;
#      |                         ^~~~~~~~~~~
#  542|   				 unsigned int *		count)
#  543|   {
#  544|-> 	vbi_service_set service_set;
#  545|   	vbi3_raw_decoder *rd3;
#  546|   

Error: COMPILER_WARNING: [#def42]
zvbi-0.2.44/src/dvb_mux.c:85:27: warning[-Wunused-const-variable=]: 'BT601_525_OFFSET' defined but not used
#   85 | static const unsigned int BT601_525_OFFSET = 858 - 16 - 720;
#      |                           ^~~~~~~~~~~~~~~~
#   83|      For 625/50 systems the numbers are 864, 720 and 12 respectively. */
#   84|   /* vbi_sampling_par->offset just counts samples since 0H. */
#   85|-> static const unsigned int BT601_525_OFFSET = 858 - 16 - 720;
#   86|   static const unsigned int BT601_625_OFFSET = 864 - 12 - 720;
#   87|   

Error: COMPILER_WARNING (CWE-691): [#def43]
zvbi-0.2.44/src/exp-gfx.c: scope_hint: In function 'vbi_draw_vt_page_region'
zvbi-0.2.44/src/exp-gfx.c:645:12: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous 'else'
#  645 |         if (pg->drcs_clut)
#      |            ^
#  643|   	off = !flash_on;
#  644|   
#  645|-> 	if (pg->drcs_clut)
#  646|   		for (i = 2; i < 2 + 8 + 32; i++)
#  647|                           if (canvas_type == 1)

Error: COMPILER_WARNING (CWE-691): [#def44]
zvbi-0.2.44/contrib/x11font.c:5: included_from: Included from here.
zvbi-0.2.44/src/exp-gfx.c: scope_hint: In function ‘vbi_draw_vt_page_region’
zvbi-0.2.44/src/exp-gfx.c:645:12: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’
#  645 |         if (pg->drcs_clut)
#      |            ^
#  643|   	off = !flash_on;
#  644|   
#  645|-> 	if (pg->drcs_clut)
#  646|   		for (i = 2; i < 2 + 8 + 32; i++)
#  647|                           if (canvas_type == 1)

Error: COMPILER_WARNING (CWE-697): [#def45]
zvbi-0.2.44/src/exp-gfx.c: scope_hint: In function 'xpm_export'
zvbi-0.2.44/src/exp-gfx.c:1558:31: warning[-Waddress]: the comparison will always evaluate as 'true' for the address of 'title' will never be NULL
# 1558 |                 if (   ((NULL != title) && (0 != title[0]))
#      |                               ^~
zvbi-0.2.44/src/exp-gfx.c:1482:14: note: 'title' declared here
# 1482 |         char title[80];
#      |              ^~~~~
# 1556|   		footer_size = 3;	/* closing bracket */
# 1557|   
# 1558|->                 if (   ((NULL != title) && (0 != title[0]))
# 1559|                       || ((NULL != e->creator) && (0 != e->creator[0])) ) {
# 1560|   			header_size += 7; /* XPMEXT keyword */

Error: COMPILER_WARNING (CWE-697): [#def46]
zvbi-0.2.44/src/exp-gfx.c: scope_hint: In function ‘xpm_export’
zvbi-0.2.44/src/exp-gfx.c:1558:31: warning[-Waddress]: the comparison will always evaluate as ‘true’ for the address of ‘title’ will never be NULL
# 1558 |                 if (   ((NULL != title) && (0 != title[0]))
#      |                               ^~
zvbi-0.2.44/src/exp-gfx.c:1482:14: note: ‘title’ declared here
# 1482 |         char title[80];
#      |              ^~~~~
# 1556|   		footer_size = 3;	/* closing bracket */
# 1557|   
# 1558|->                 if (   ((NULL != title) && (0 != title[0]))
# 1559|                       || ((NULL != e->creator) && (0 != e->creator[0])) ) {
# 1560|   			header_size += 7; /* XPMEXT keyword */

Error: COMPILER_WARNING (CWE-697): [#def47]
zvbi-0.2.44/src/exp-gfx.c:1562:34: warning[-Waddress]: the comparison will always evaluate as 'true' for the address of 'title' will never be NULL
# 1562 |                         if (NULL != title) {
#      |                                  ^~
zvbi-0.2.44/src/exp-gfx.c:1482:14: note: 'title' declared here
# 1482 |         char title[80];
#      |              ^~~~~
# 1560|   			header_size += 7; /* XPMEXT keyword */
# 1561|   			footer_size += 12; /* XPMENDEXT keyword */
# 1562|-> 			if (NULL != title) {
# 1563|   				/* XPMEXT keywords + label + content */
# 1564|   				footer_size += 17 + strlen (title);

Error: COMPILER_WARNING (CWE-697): [#def48]
zvbi-0.2.44/src/exp-gfx.c:1562:34: warning[-Waddress]: the comparison will always evaluate as ‘true’ for the address of ‘title’ will never be NULL
# 1562 |                         if (NULL != title) {
#      |                                  ^~
zvbi-0.2.44/src/exp-gfx.c:1482:14: note: ‘title’ declared here
# 1482 |         char title[80];
#      |              ^~~~~
# 1560|   			header_size += 7; /* XPMEXT keyword */
# 1561|   			footer_size += 12; /* XPMENDEXT keyword */
# 1562|-> 			if (NULL != title) {
# 1563|   				/* XPMEXT keywords + label + content */
# 1564|   				footer_size += 17 + strlen (title);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
zvbi-0.2.44/src/exp-gfx.c:1581:24: warning[-Wanalyzer-malloc-leak]: leak of 'indexed_image'
zvbi-0.2.44/src/exp-gfx.c:1495:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/exp-gfx.c:1503:29: branch_false: ...to here
zvbi-0.2.44/src/exp-gfx.c:1520:25: acquire_memory: allocated here
zvbi-0.2.44/src/exp-gfx.c:1521:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/exp-gfx.c:1526:17: branch_false: ...to here
zvbi-0.2.44/src/exp-gfx.c:1580:20: branch_true: following 'true' branch...
zvbi-0.2.44/src/exp-gfx.c:1581:24: branch_true: ...to here
zvbi-0.2.44/src/exp-gfx.c:1581:24: danger: 'indexed_image' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1579|   
# 1580|   		if (unlikely (!_vbi_export_grow_buffer_space (e, needed)))
# 1581|-> 		return FALSE;
# 1582|   	}
# 1583|   

Error: CPPCHECK_WARNING (CWE-476): [#def50]
zvbi-0.2.44/src/exp-html.c:573: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: s
#  571|   				s = calloc(1, sizeof(style));
#  572|   				*sp = s;
#  573|-> 				s->foreground = ac.foreground;
#  574|   				s->background = ac.background;
#  575|   				s->flash = ac.flash;

Error: CPPCHECK_WARNING (CWE-476): [#def51]
zvbi-0.2.44/src/exp-html.c:574: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: s
#  572|   				*sp = s;
#  573|   				s->foreground = ac.foreground;
#  574|-> 				s->background = ac.background;
#  575|   				s->flash = ac.flash;
#  576|   			}

Error: CPPCHECK_WARNING (CWE-476): [#def52]
zvbi-0.2.44/src/exp-html.c:575: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: s
#  573|   				s->foreground = ac.foreground;
#  574|   				s->background = ac.background;
#  575|-> 				s->flash = ac.flash;
#  576|   			}
#  577|   

Error: CPPCHECK_WARNING (CWE-476): [#def53]
zvbi-0.2.44/src/exp-html.c:578: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: s
#  576|   			}
#  577|   
#  578|-> 			s->ref_count++;
#  579|   		}
#  580|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
zvbi-0.2.44/src/exp-templ.c:56:16: warning[-Wanalyzer-malloc-leak]: leak of 'tmpl'
zvbi-0.2.44/src/exp-templ.c:45:22: acquire_memory: allocated here
zvbi-0.2.44/src/exp-templ.c:45:12: branch_false: following 'false' branch (when 'tmpl' is non-NULL)...
zvbi-0.2.44/src/exp-templ.c:56:16: branch_false: ...to here
zvbi-0.2.44/src/exp-templ.c:56:16: danger: 'tmpl' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   54|   	tmpl->counter = 0;
#   55|   
#   56|-> 	return &tmpl->export;
#   57|   }
#   58|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
zvbi-0.2.44/src/exp-txt.c:60:16: warning[-Wanalyzer-malloc-leak]: leak of 'text'
zvbi-0.2.44/src/exp-txt.c:57:22: acquire_memory: allocated here
zvbi-0.2.44/src/exp-txt.c:57:12: branch_false: following 'false' branch (when 'text' is non-NULL)...
zvbi-0.2.44/src/exp-txt.c:60:16: branch_false: ...to here
zvbi-0.2.44/src/exp-txt.c:60:16: danger: 'text' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   58|   		return NULL;
#   59|   
#   60|-> 	return &text->export;
#   61|   }
#   62|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
zvbi-0.2.44/src/exp-txt.c:374:12: warning[-Wanalyzer-malloc-leak]: leak of 'iconv_open(format, "UCS-2")'
zvbi-0.2.44/src/exp-txt.c:368:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/exp-txt.c:368:13: branch_false: following 'false' branch...
zvbi-0.2.44/src/exp-txt.c:368:13: branch_false: following 'false' branch...
zvbi-0.2.44/src/exp-txt.c:368:13: branch_false: following 'false' branch...
zvbi-0.2.44/src/exp-txt.c:374:19: branch_false: ...to here
zvbi-0.2.44/src/exp-txt.c:374:19: acquire_memory: allocated here
zvbi-0.2.44/src/exp-txt.c:374:12: danger: 'iconv_open(format, "UCS-2")' leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  372|   		return 0;
#  373|   
#  374|-> 	if ((cd = iconv_open(format, "UCS-2")) == (iconv_t) -1)
#  375|   		return 0;
#  376|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def57]
zvbi-0.2.44/src/export.c:781:24: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
zvbi-0.2.44/src/export.c:900:1: enter_function: entry to 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:905:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:908:9: call_function: inlined call to 'reset_error' from 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:910:20: call_function: calling 'vbi_export_option_info_keyword' from 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:910:20: return_function: returning to 'vbi_export_option_menu_set' from 'vbi_export_option_info_keyword'
zvbi-0.2.44/src/export.c:910:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:913:21: branch_false: ...to here
zvbi-0.2.44/src/export.c:913:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:919:20: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:921:75: branch_false: ...to here
zvbi-0.2.44/src/export.c:921:24: call_function: calling 'vbi_export_option_set' from 'vbi_export_option_menu_set'
#  779|   
#  780|   	if (!export || !keyword)
#  781|-> 		return FALSE;
#  782|   
#  783|   	reset_error(export);

Error: GCC_ANALYZER_WARNING (CWE-686): [#def58]
zvbi-0.2.44/src/export.c:788:36: warning[-Wanalyzer-va-arg-type-mismatch]: 'va_arg' expected 'int' but received 'double' for variadic argument 1 of 'args'
zvbi-0.2.44/src/export.c:900:1: enter_function: entry to 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:905:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:908:9: call_function: inlined call to 'reset_error' from 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:910:20: call_function: calling 'vbi_export_option_info_keyword' from 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:910:20: return_function: returning to 'vbi_export_option_menu_set' from 'vbi_export_option_info_keyword'
zvbi-0.2.44/src/export.c:910:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:913:21: branch_false: ...to here
zvbi-0.2.44/src/export.c:913:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:924:20: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:926:75: branch_false: ...to here
zvbi-0.2.44/src/export.c:926:24: call_function: calling 'vbi_export_option_set' from 'vbi_export_option_menu_set' with 1 variadic argument
#  786|   
#  787|   	if (strcmp(keyword, "reveal") == 0) {
#  788|-> 		export->reveal = !!va_arg(args, int);
#  789|   	} else if (strcmp(keyword, "network") == 0) {
#  790|   		char *network = va_arg(args, char *);

Error: GCC_ANALYZER_WARNING (CWE-686): [#def59]
zvbi-0.2.44/src/export.c:790:23: warning[-Wanalyzer-va-arg-type-mismatch]: 'va_arg' expected 'char *' but received 'double' for variadic argument 1 of 'args'
zvbi-0.2.44/src/export.c:900:1: enter_function: entry to 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:905:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:908:9: call_function: inlined call to 'reset_error' from 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:910:20: call_function: calling 'vbi_export_option_info_keyword' from 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:910:20: return_function: returning to 'vbi_export_option_menu_set' from 'vbi_export_option_info_keyword'
zvbi-0.2.44/src/export.c:910:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:913:21: branch_false: ...to here
zvbi-0.2.44/src/export.c:913:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:924:20: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:926:75: branch_false: ...to here
zvbi-0.2.44/src/export.c:926:24: call_function: calling 'vbi_export_option_set' from 'vbi_export_option_menu_set' with 1 variadic argument
#  788|   		export->reveal = !!va_arg(args, int);
#  789|   	} else if (strcmp(keyword, "network") == 0) {
#  790|-> 		char *network = va_arg(args, char *);
#  791|   		if (!network || !network[0]) {
#  792|   			if (export->network) {

Error: GCC_ANALYZER_WARNING (CWE-686): [#def60]
zvbi-0.2.44/src/export.c:790:23: warning[-Wanalyzer-va-arg-type-mismatch]: 'va_arg' expected 'char *' but received 'int' for variadic argument 1 of 'args'
zvbi-0.2.44/src/export.c:900:1: enter_function: entry to 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:905:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:908:9: call_function: inlined call to 'reset_error' from 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:910:20: call_function: calling 'vbi_export_option_info_keyword' from 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:910:20: return_function: returning to 'vbi_export_option_menu_set' from 'vbi_export_option_info_keyword'
zvbi-0.2.44/src/export.c:910:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:913:21: branch_false: ...to here
zvbi-0.2.44/src/export.c:913:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:919:20: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:921:75: branch_false: ...to here
zvbi-0.2.44/src/export.c:921:24: call_function: calling 'vbi_export_option_set' from 'vbi_export_option_menu_set' with 1 variadic argument
#  788|   		export->reveal = !!va_arg(args, int);
#  789|   	} else if (strcmp(keyword, "network") == 0) {
#  790|-> 		char *network = va_arg(args, char *);
#  791|   		if (!network || !network[0]) {
#  792|   			if (export->network) {

Error: GCC_ANALYZER_WARNING (CWE-686): [#def61]
zvbi-0.2.44/src/export.c:800:23: warning[-Wanalyzer-va-arg-type-mismatch]: 'va_arg' expected 'char *' but received 'double' for variadic argument 1 of 'args'
zvbi-0.2.44/src/export.c:900:1: enter_function: entry to 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:905:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:908:9: call_function: inlined call to 'reset_error' from 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:910:20: call_function: calling 'vbi_export_option_info_keyword' from 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:910:20: return_function: returning to 'vbi_export_option_menu_set' from 'vbi_export_option_info_keyword'
zvbi-0.2.44/src/export.c:910:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:913:21: branch_false: ...to here
zvbi-0.2.44/src/export.c:913:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:924:20: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:926:75: branch_false: ...to here
zvbi-0.2.44/src/export.c:926:24: call_function: calling 'vbi_export_option_set' from 'vbi_export_option_menu_set' with 1 variadic argument
#  798|   		}
#  799|   	} else if (strcmp(keyword, "creator") == 0) {
#  800|-> 		char *creator = va_arg(args, char *);
#  801|   		if (!vbi_export_strdup(export, &export->creator, creator))
#  802|   			return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-686): [#def62]
zvbi-0.2.44/src/export.c:800:23: warning[-Wanalyzer-va-arg-type-mismatch]: 'va_arg' expected 'char *' but received 'int' for variadic argument 1 of 'args'
zvbi-0.2.44/src/export.c:900:1: enter_function: entry to 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:905:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:908:9: call_function: inlined call to 'reset_error' from 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:910:20: call_function: calling 'vbi_export_option_info_keyword' from 'vbi_export_option_menu_set'
zvbi-0.2.44/src/export.c:910:20: return_function: returning to 'vbi_export_option_menu_set' from 'vbi_export_option_info_keyword'
zvbi-0.2.44/src/export.c:910:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:913:21: branch_false: ...to here
zvbi-0.2.44/src/export.c:913:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:919:20: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:921:75: branch_false: ...to here
zvbi-0.2.44/src/export.c:921:24: call_function: calling 'vbi_export_option_set' from 'vbi_export_option_menu_set' with 1 variadic argument
#  798|   		}
#  799|   	} else if (strcmp(keyword, "creator") == 0) {
#  800|-> 		char *creator = va_arg(args, char *);
#  801|   		if (!vbi_export_strdup(export, &export->creator, creator))
#  802|   			return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def63]
zvbi-0.2.44/src/export.c:1461:24: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
zvbi-0.2.44/src/export.c:1448:1: enter_function: entry to 'vbi_export_vprintf'
zvbi-0.2.44/src/export.c:1458:9: branch_true: following 'true' branch...
zvbi-0.2.44/src/export.c:1460:13: branch_true: ...to here
zvbi-0.2.44/src/export.c:1460:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:1463:12: branch_false: ...to here
zvbi-0.2.44/src/export.c:1463:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:1475:9: branch_false: ...to here
zvbi-0.2.44/src/export.c:1475:9: acquire_resource: 'va_copy' called here
zvbi-0.2.44/src/export.c:1488:28: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:1494:30: branch_false: ...to here
zvbi-0.2.44/src/export.c:1494:30: call_function: calling '_vbi_export_grow_buffer_space' from 'vbi_export_vprintf'
zvbi-0.2.44/src/export.c:1494:30: return_function: returning to 'vbi_export_vprintf' from '_vbi_export_grow_buffer_space'
zvbi-0.2.44/src/export.c:1461:24: danger: missing call to 'va_end' to match 'va_copy' at [(8)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/7)
# 1459|   
# 1460|   	if (unlikely (e->write_error))
# 1461|-> 		return FALSE;
# 1462|   
# 1463|   	if (VBI_EXPORT_TARGET_FP == e->target) {

Error: CPPCHECK_WARNING (CWE-401): [#def64]
zvbi-0.2.44/src/export.c:1690: error[memleakOnRealloc]: Common realloc mistake: 'data' nulled but not freed upon failure
# 1688|   		/* Let's not waste space. */
# 1689|   		if (e->buffer.capacity - offset >= 256) {
# 1690|-> 			data = realloc (data, offset);
# 1691|   			if (NULL == data)
# 1692|   				data = e->buffer.data;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def65]
zvbi-0.2.44/src/export.c:1780:21: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'fd'
zvbi-0.2.44/src/export.c:1780:21: release_resource: first 'close' here
zvbi-0.2.44/src/export.c:1780:20: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:1782:30: branch_false: ...to here
zvbi-0.2.44/src/export.c:1782:20: branch_false: following 'false' branch...
zvbi-0.2.44/src/export.c:1784:18: branch_false: ...to here
zvbi-0.2.44/src/export.c:1784:18: branch_true: following 'true' branch (when 'retry != 0')...
 branch_true: ...to here
zvbi-0.2.44/src/export.c:1780:21: danger: second 'close' here; first 'close' was at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 1778|   
# 1779|   	do {
# 1780|-> 		if (likely (0 == close (fd)))
# 1781|   			return 0;
# 1782|   		if (EINTR != errno)

Error: COMPILER_WARNING (CWE-563): [#def66]
zvbi-0.2.44/src/idl_demux.c: scope_hint: In function 'idl_a_demux_feed'
zvbi-0.2.44/src/idl_demux.c:83:22: warning[-Wunused-but-set-variable]: variable 'flags' set but not used
#   83 |         unsigned int flags;
#      |                      ^~~~~
#   81|   	unsigned int dl;	/* data length */
#   82|   	unsigned int crc;
#   83|-> 	unsigned int flags;
#   84|   	unsigned int i;
#   85|   	unsigned int j;

Error: GCC_ANALYZER_WARNING (CWE-686): [#def67]
zvbi-0.2.44/src/inout.c:613:17: warning[-Wanalyzer-va-arg-type-mismatch]: 'va_arg' expected 'long unsigned int' but received 'int' for variadic argument 2 of 'ap'
zvbi-0.2.44/src/inout.c:793:1: enter_function: entry to 'device_mmap'
zvbi-0.2.44/src/inout.c:805:12: branch_true: following 'true' branch (when 'fp' is non-NULL)...
zvbi-0.2.44/src/inout.c:808:31: branch_true: ...to here
zvbi-0.2.44/src/inout.c:812:17: call_function: calling 'fprint_symbolic' from 'device_mmap' with 9 variadic arguments
#  611|   
#  612|   	for (i = 0; (s = va_arg (ap, const char *)); ++i) {
#  613|-> 		v = va_arg (ap, unsigned long);
#  614|   
#  615|   		if (v == value

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
zvbi-0.2.44/src/io-dvb.c:532:16: warning[-Wanalyzer-malloc-leak]: leak of 'dvb'
zvbi-0.2.44/src/io-dvb.c:482:15: acquire_memory: allocated here
zvbi-0.2.44/src/io-dvb.c:483:12: branch_false: following 'false' branch (when 'dvb' is non-NULL)...
zvbi-0.2.44/src/io-dvb.c:486:9: branch_false: ...to here
zvbi-0.2.44/src/io-dvb.c:506:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/io-dvb.c:509:14: branch_false: ...to here
zvbi-0.2.44/src/io-dvb.c:509:12: branch_false: following 'false' branch...
zvbi-0.2.44/src/io-dvb.c:514:9: branch_false: ...to here
zvbi-0.2.44/src/io-dvb.c:532:16: danger: 'dvb' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  530|   	}
#  531|   
#  532|-> 	return &dvb->capture;
#  533|   
#  534|    no_memory:

Error: COMPILER_WARNING (CWE-483): [#def69]
zvbi-0.2.44/src/io-v4l.c: scope_hint: In function 'guess_bttv_v4l'
zvbi-0.2.44/src/io-v4l.c:649:25: warning[-Wmisleading-indentation]: this 'if' clause does not guard...
#  649 |                         if (get_videostd(v, given_fd, &mode))
#      |                         ^~
zvbi-0.2.44/src/io-v4l.c:651:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
#  651 |                                 goto finish;
#      |                                 ^~~~
#  647|   
#  648|   		if (reverse_lookup(v, given_fd, &vbi_stat)) {
#  649|-> 			if (get_videostd(v, given_fd, &mode))
#  650|                                   v->fd_video = given_fd;
#  651|   				goto finish;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
zvbi-0.2.44/src/io-v4l2.c:154:24: warning[-Wanalyzer-malloc-leak]: leak of 'v'
zvbi-0.2.44/src/io-v4l2.c:100:1: enter_function: entry to 'vbi_capture_v4l2_new'
zvbi-0.2.44/src/io-v4l2.c:116:19: acquire_memory: allocated here
zvbi-0.2.44/src/io-v4l2.c:116:12: branch_false: following 'false' branch (when 'v' is non-NULL)...
zvbi-0.2.44/src/io-v4l2.c:122:9: branch_false: ...to here
zvbi-0.2.44/src/io-v4l2.c:128:12: branch_true: following 'true' branch...
zvbi-0.2.44/src/io-v4l2.c:129:25: branch_true: ...to here
zvbi-0.2.44/src/io-v4l2.c:131:20: branch_true: following 'true' branch...
zvbi-0.2.44/src/io-v4l2.c:133:62: branch_true: ...to here
zvbi-0.2.44/src/io-v4l2.c:164:12: branch_true: following 'true' branch (when 'v' is non-NULL)...
zvbi-0.2.44/src/io-v4l2.c:165:17: branch_true: ...to here
zvbi-0.2.44/src/io-v4l2.c:165:17: call_function: calling 'v4l2_delete' from 'vbi_capture_v4l2_new'
zvbi-0.2.44/src/io-v4l2.c:165:17: return_function: returning to 'vbi_capture_v4l2_new' from 'v4l2_delete'
zvbi-0.2.44/src/io-v4l2.c:154:24: danger: 'v' leaks here; was allocated at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  152|   
#  153|   		/* Try V4L2 2.6. */
#  154|-> 		return vbi_capture_v4l2k_new (dev_name, -1, buffers,
#  155|   					      services, strict,
#  156|   					      errstr, trace);

Error: COMPILER_WARNING (CWE-563): [#def71]
zvbi-0.2.44/src/io-v4l2k.c: scope_hint: In function 'v4l2_stream_alloc'
zvbi-0.2.44/src/io-v4l2k.c:197:16: warning[-Wunused-but-set-variable]: variable 'guess' set but not used
#  197 |         char * guess = NULL;
#      |                ^~~~~
#  195|   	struct v4l2_requestbuffers vrbuf;
#  196|   	struct v4l2_buffer vbuf;
#  197|-> 	char * guess = NULL;
#  198|           int errno_copy;
#  199|   

Error: COMPILER_WARNING (CWE-563): [#def72]
zvbi-0.2.44/src/io-v4l2k.c: scope_hint: In function 'v4l2_get_videostd'
zvbi-0.2.44/src/io-v4l2k.c:759:16: warning[-Wunused-but-set-variable]: variable 'guess' set but not used
#  759 |         char * guess = NULL;
#      |                ^~~~~
#  757|   	unsigned int i;
#  758|   	int r;
#  759|-> 	char * guess = NULL;
#  760|   
#  761|   	if (-1 == xioctl (v, VIDIOC_G_STD, &stdid)) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def73]
zvbi-0.2.44/src/io-v4l2k.c:762:17: warning[-Wanalyzer-null-argument]: use of NULL 'errstr' where non-null expected
zvbi-0.2.44/src/io-v4l2k.c:814:1: enter_function: entry to 'v4l2_get_scanning'
zvbi-0.2.44/src/io-v4l2k.c:820:14: call_function: calling 'v4l2_get_videostd' from 'v4l2_get_scanning'
#  760|   
#  761|   	if (-1 == xioctl (v, VIDIOC_G_STD, &stdid)) {
#  762|-> 		asprintf (errstr,
#  763|   			  _("Cannot query current videostandard "
#  764|   			    "of %s (%s): %s."),

Error: GCC_ANALYZER_WARNING (CWE-688): [#def74]
zvbi-0.2.44/src/io-v4l2k.c:789:17: warning[-Wanalyzer-null-argument]: use of NULL 'errstr' where non-null expected
zvbi-0.2.44/src/io-v4l2k.c:814:1: enter_function: entry to 'v4l2_get_scanning'
zvbi-0.2.44/src/io-v4l2k.c:820:14: call_function: calling 'v4l2_get_videostd' from 'v4l2_get_scanning'
#  787|   
#  788|   	if (-1 == r) {
#  789|-> 		asprintf(errstr, _("Cannot query current "
#  790|   				   "videostandard of %s (%s): %s."),
#  791|   			 v->p_dev_name, v->vcap.card, strerror(errno));

Error: COMPILER_WARNING (CWE-563): [#def75]
zvbi-0.2.44/src/io-v4l2k.c: scope_hint: In function 'v4l2_update_services'
zvbi-0.2.44/src/io-v4l2k.c:870:16: warning[-Wunused-but-set-variable]: variable 'guess' set but not used
#  870 |         char * guess = NULL;
#      |                ^~~~~
#  868|   	int    g_fmt;
#  869|   	int    s_fmt;
#  870|-> 	char * guess = NULL;
#  871|   
#  872|   	/* suspend capturing, or driver will return EBUSY */

Error: COMPILER_WARNING (CWE-563): [#def76]
zvbi-0.2.44/src/io-v4l2k.c: scope_hint: In function 'vbi_capture_v4l2k_new'
zvbi-0.2.44/src/io-v4l2k.c:1320:15: warning[-Wunused-but-set-variable]: variable 'guess' set but not used
# 1320 |         char *guess = NULL;
#      |               ^~~~~
# 1318|   				 vbi_bool		trace)
# 1319|   {
# 1320|-> 	char *guess = NULL;
# 1321|   	char *error = NULL;
# 1322|   	vbi_capture_v4l2 *v;

Error: GCC_ANALYZER_WARNING (CWE-787): [#def77]
zvbi-0.2.44/src/lang.c:467:32: warning[-Wanalyzer-out-of-bounds]: buffer over-read
zvbi-0.2.44/src/lang.c:392:9: branch_true: following 'true' branch...
zvbi-0.2.44/src/lang.c:394:9: branch_true: ...to here
zvbi-0.2.44/src/lang.c:464:20: branch_false: following 'false' branch (when 'c > 90')...
zvbi-0.2.44/src/lang.c:467:42: branch_false: ...to here
zvbi-0.2.44/src/lang.c:467:32: danger: read of 2 bytes at offset 'c * 2 + 8589934410' exceeds 'hebrew_g0'
#  465|   			return c;
#  466|   		else
#  467|-> 			return hebrew_g0[c - 0x5B];
#  468|   
#  469|   	case BLOCK_MOSAIC_G1:

Error: COMPILER_WARNING: [#def78]
zvbi-0.2.44/src/misc.c: scope_hint: In function '_vbi_strndup'
zvbi-0.2.44/src/misc.c:120:12: warning[-Wnonnull-compare]: 'nonnull' argument 's' compared to NULL
#  120 |         if (NULL == s)
#      |            ^
#  118|   	char *r;
#  119|   
#  120|-> 	if (NULL == s)
#  121|   		return NULL;
#  122|   

Error: CPPCHECK_WARNING (CWE-664): [#def79]
zvbi-0.2.44/src/misc.c:159: error[va_list_usedBeforeStarted]: va_list 'ap2' used before va_start() was called.
#  157|   	size = 64;
#  158|   
#  159|-> 	va_copy (ap2, ap);
#  160|   
#  161|   	for (;;) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def80]
zvbi-0.2.44/src/misc.c:196:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
zvbi-0.2.44/src/misc.c:207:1: enter_function: entry to '_vbi_asprintf'
zvbi-0.2.44/src/misc.c:217:15: call_function: calling '_vbi_vasprintf' from '_vbi_asprintf'
#  194|   	   asprintf NULLs *dstp, which is safer. */
#  195|   	*dstp = NULL;
#  196|-> 	errno = temp;
#  197|   
#  198|   	return -1;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def81]
zvbi-0.2.44/src/misc.c:199:1: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
zvbi-0.2.44/src/misc.c:159:9: acquire_resource: 'va_copy' called here
zvbi-0.2.44/src/misc.c:166:20: branch_true: following 'true' branch (when 'buf2' is NULL)...
zvbi-0.2.44/src/misc.c:189:9: branch_true: ...to here
zvbi-0.2.44/src/misc.c:199:1: danger: missing call to 'va_end' to match 'va_copy' at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  197|   
#  198|   	return -1;
#  199|-> }
#  200|   
#  201|   /**

Error: COMPILER_WARNING: [#def82]
zvbi-0.2.44/src/misc.c: scope_hint: In function '_vbi_log_vprintf'
zvbi-0.2.44/src/misc.c:402:12: warning[-Wnonnull-compare]: 'nonnull' argument 'log_fn' compared to NULL
#  402 |         if (NULL == log_fn)
#      |            ^
#  400|   	assert (NULL != templ);
#  401|   
#  402|-> 	if (NULL == log_fn)
#  403|   		return;
#  404|   

Error: COMPILER_WARNING (CWE-563): [#def83]
zvbi-0.2.44/src/packet.c: scope_hint: In function 'parse_28_29'
zvbi-0.2.44/src/packet.c:1888:36: warning[-Wunused-but-set-variable]: variable 'coding' set but not used
# 1888 |         int designation, function, coding;
#      |                                    ^~~~~~
# 1886|   	    cache_page *cvtp, int mag8, int packet)
# 1887|   {
# 1888|-> 	int designation, function, coding;
# 1889|   	int triplets[13];
# 1890|   	struct bit_stream bs;

Error: COMPILER_WARNING (CWE-563): [#def84]
zvbi-0.2.44/src/packet.c: scope_hint: In function 'vbi_decode_teletext'
zvbi-0.2.44/src/packet.c:2197:30: warning[-Wunused-but-set-variable]: variable 'mag' set but not used
# 2197 |         struct ttx_magazine *mag;
#      |                              ^~~
# 2195|   	struct raw_page *rvtp;
# 2196|   	int pmag, mag0, mag8, packet;
# 2197|-> 	struct ttx_magazine *mag;
# 2198|   	uint8_t *p;
# 2199|   

Error: COMPILER_WARNING (CWE-563): [#def85]
zvbi-0.2.44/src/pdc.c: scope_hint: In function 'vbi_pil_to_time'
zvbi-0.2.44/src/pdc.c:842:13: warning[-Wunused-but-set-variable]: variable 'saved_errno' set but not used
#  842 |         int saved_errno;
#      |             ^~~~~~~~~~~
#  840|   	char *old_tz;
#  841|   	time_t result;
#  842|-> 	int saved_errno;
#  843|   
#  844|   	if (unlikely (!vbi_pil_is_valid_date (pil))) {

Error: COMPILER_WARNING (CWE-563): [#def86]
zvbi-0.2.44/src/pdc.c: scope_hint: In function 'vbi_pty_validity_window'
zvbi-0.2.44/src/pdc.c:1027:13: warning[-Wunused-but-set-variable]: variable 'saved_errno' set but not used
# 1027 |         int saved_errno;
#      |             ^~~~~~~~~~~
# 1025|   	struct tm tm;
# 1026|   	time_t stop;
# 1027|-> 	int saved_errno;
# 1028|   
# 1029|   	assert (NULL != begin);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def87]
zvbi-0.2.44/src/proxy-client.c:224:4: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*(VBIPROXY_MSG_HEADER *)pMsg.type'
zvbi-0.2.44/src/proxy-client.c:1390:1: enter_function: entry to 'vbi_proxy_client_flush'
zvbi-0.2.44/src/proxy-client.c:1396:7: call_function: calling 'vbi_proxy_client_channel_notify' from 'vbi_proxy_client_flush'
#  222|   
#  223|      /*if (vpc->p_client_msg->head.type != MSG_TYPE_SLICED_IND) */
#  224|->    dprintf2("check_msg: recv msg type %d, len %d (%s)\n", pHead->type, pHead->len, vbi_proxy_msg_debug_get_type_str(pHead->type));
#  225|   
#  226|      switch (pHead->type)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def88]
zvbi-0.2.44/src/proxy-client.c:226:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*(VBIPROXY_MSG_HEADER *)pMsg.type'
zvbi-0.2.44/src/proxy-client.c:1390:1: enter_function: entry to 'vbi_proxy_client_flush'
zvbi-0.2.44/src/proxy-client.c:1396:7: call_function: calling 'vbi_proxy_client_channel_notify' from 'vbi_proxy_client_flush'
#  224|      dprintf2("check_msg: recv msg type %d, len %d (%s)\n", pHead->type, pHead->len, vbi_proxy_msg_debug_get_type_str(pHead->type));
#  225|   
#  226|->    switch (pHead->type)
#  227|      {
#  228|         case MSG_TYPE_CONNECT_CNF:

Error: GCC_ANALYZER_WARNING (CWE-476): [#def89]
zvbi-0.2.44/src/proxy-client.c:453:7: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  451|      }
#  452|      else
#  453|->       dprintf1("proxy_client-close: illegal NULL ptr param");
#  454|   }
#  455|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def90]
zvbi-0.2.44/src/proxy-client.c:1485:7: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
zvbi-0.2.44/src/proxy-client.c:1442:7: branch_false: following 'false' branch (when 'vpc' is NULL)...
zvbi-0.2.44/src/proxy-client.c:1485:7: branch_false: ...to here
zvbi-0.2.44/src/proxy-client.c:1485:7: danger: dereference of NULL '0'
# 1483|      }
# 1484|      else
# 1485|->       dprintf1("vbi_proxy-client_start: illegal NULL ptr param\n");
# 1486|   
# 1487|      if (pp_errorstr != NULL)

Error: CPPCHECK_WARNING (CWE-476): [#def91]
zvbi-0.2.44/src/proxy-msg.c:793: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  791|         *ppResult = res;
#  792|   
#  793|->       memset(res, 0, sizeof(*res));
#  794|         res->ai_socktype  = pInParams->ai_socktype;
#  795|         res->ai_family    = pInParams->ai_family;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def92]
zvbi-0.2.44/src/proxy-msg.c:793:7: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'res' where non-null expected
zvbi-0.2.44/src/proxy-msg.c:787:7: branch_true: following 'true' branch...
zvbi-0.2.44/src/proxy-msg.c:790:13: acquire_memory: this call could return NULL
zvbi-0.2.44/src/proxy-msg.c:793:7: danger: argument 1 ('res') from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) could be NULL where non-null expected
#argument 1 of '__builtin_memset' must be non-null
#  791|         *ppResult = res;
#  792|   
#  793|->       memset(res, 0, sizeof(*res));
#  794|         res->ai_socktype  = pInParams->ai_socktype;
#  795|         res->ai_family    = pInParams->ai_family;

Error: CPPCHECK_WARNING (CWE-476): [#def93]
zvbi-0.2.44/src/proxy-msg.c:794: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  792|   
#  793|         memset(res, 0, sizeof(*res));
#  794|->       res->ai_socktype  = pInParams->ai_socktype;
#  795|         res->ai_family    = pInParams->ai_family;
#  796|         res->ai_protocol  = pInParams->ai_protocol;

Error: CPPCHECK_WARNING (CWE-476): [#def94]
zvbi-0.2.44/src/proxy-msg.c:795: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  793|         memset(res, 0, sizeof(*res));
#  794|         res->ai_socktype  = pInParams->ai_socktype;
#  795|->       res->ai_family    = pInParams->ai_family;
#  796|         res->ai_protocol  = pInParams->ai_protocol;
#  797|   

Error: CPPCHECK_WARNING (CWE-476): [#def95]
zvbi-0.2.44/src/proxy-msg.c:796: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  794|         res->ai_socktype  = pInParams->ai_socktype;
#  795|         res->ai_family    = pInParams->ai_family;
#  796|->       res->ai_protocol  = pInParams->ai_protocol;
#  797|   
#  798|         saddr = malloc(sizeof(struct sockaddr_un));

Error: CPPCHECK_WARNING (CWE-476): [#def96]
zvbi-0.2.44/src/proxy-msg.c:799: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  797|   
#  798|         saddr = malloc(sizeof(struct sockaddr_un));
#  799|->       res->ai_addr      = (struct sockaddr *) saddr;
#  800|         res->ai_addrlen   = sizeof(struct sockaddr_un);
#  801|   

Error: CPPCHECK_WARNING (CWE-476): [#def97]
zvbi-0.2.44/src/proxy-msg.c:800: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  798|         saddr = malloc(sizeof(struct sockaddr_un));
#  799|         res->ai_addr      = (struct sockaddr *) saddr;
#  800|->       res->ai_addrlen   = sizeof(struct sockaddr_un);
#  801|   
#  802|         strlcpy(saddr->sun_path, pPathName, sizeof(saddr->sun_path) - 1);

Error: CPPCHECK_WARNING (CWE-476): [#def98]
zvbi-0.2.44/src/proxy-msg.c:802: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: saddr
#  800|         res->ai_addrlen   = sizeof(struct sockaddr_un);
#  801|   
#  802|->       strlcpy(saddr->sun_path, pPathName, sizeof(saddr->sun_path) - 1);
#  803|         saddr->sun_path[sizeof(saddr->sun_path) - 1] = 0;
#  804|         saddr->sun_family = AF_UNIX;

Error: CPPCHECK_WARNING (CWE-476): [#def99]
zvbi-0.2.44/src/proxy-msg.c:803: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: saddr
#  801|   
#  802|         strlcpy(saddr->sun_path, pPathName, sizeof(saddr->sun_path) - 1);
#  803|->       saddr->sun_path[sizeof(saddr->sun_path) - 1] = 0;
#  804|         saddr->sun_family = AF_UNIX;
#  805|   

Error: CPPCHECK_WARNING (CWE-476): [#def100]
zvbi-0.2.44/src/proxy-msg.c:804: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: saddr
#  802|         strlcpy(saddr->sun_path, pPathName, sizeof(saddr->sun_path) - 1);
#  803|         saddr->sun_path[sizeof(saddr->sun_path) - 1] = 0;
#  804|->       saddr->sun_family = AF_UNIX;
#  805|   
#  806|         return 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def101]
zvbi-0.2.44/src/proxy-msg.c:804:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'saddr'
zvbi-0.2.44/src/proxy-msg.c:815:5: enter_function: entry to 'vbi_proxy_msg_listen_socket'
zvbi-0.2.44/src/proxy-msg.c:829:7: branch_false: following 'false' branch (when 'is_tcp_ip == 0')...
zvbi-0.2.44/src/proxy-msg.c:850:10: branch_false: ...to here
zvbi-0.2.44/src/proxy-msg.c:850:10: branch_false: following 'false' branch (when 'is_tcp_ip == 0')...
zvbi-0.2.44/src/proxy-msg.c:857:10: branch_false: ...to here
zvbi-0.2.44/src/proxy-msg.c:858:15: call_function: calling 'vbi_proxy_msg_get_local_socket_addr' from 'vbi_proxy_msg_listen_socket'
#  802|         strlcpy(saddr->sun_path, pPathName, sizeof(saddr->sun_path) - 1);
#  803|         saddr->sun_path[sizeof(saddr->sun_path) - 1] = 0;
#  804|->       saddr->sun_family = AF_UNIX;
#  805|   
#  806|         return 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def102]
zvbi-0.2.44/src/proxy-msg.c:1060:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'p_path' where non-null expected
zvbi-0.2.44/src/proxy-msg.c:1056:13: acquire_memory: this call could return NULL
zvbi-0.2.44/src/proxy-msg.c:1058:24: branch_true: following 'true' branch (when 'slink_idx != 100')...
zvbi-0.2.44/src/proxy-msg.c:1060:13: branch_true: ...to here
zvbi-0.2.44/src/proxy-msg.c:1060:13: danger: argument 1 ('p_path') from [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
# 1058|      for (slink_idx = 0; slink_idx < 100; slink_idx++)
# 1059|      {
# 1060|->       res = lstat(p_path, &stbuf);
# 1061|         if ((res == 0) && S_ISLNK(stbuf.st_mode))
# 1062|         {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def103]
zvbi-0.2.44/src/proxy-msg.c:1076:19: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'p_tmp' where non-null expected
zvbi-0.2.44/src/proxy-msg.c:1058:24: branch_true: following 'true' branch (when 'slink_idx != 100')...
zvbi-0.2.44/src/proxy-msg.c:1060:13: branch_true: ...to here
zvbi-0.2.44/src/proxy-msg.c:1061:10: branch_true: following 'true' branch...
zvbi-0.2.44/src/proxy-msg.c:1065:13: branch_true: following 'true' branch...
zvbi-0.2.44/src/proxy-msg.c:1069:16: branch_true: following 'true' branch...
zvbi-0.2.44/src/proxy-msg.c:1071:31: branch_true: ...to here
zvbi-0.2.44/src/proxy-msg.c:1071:24: acquire_memory: this call could return NULL
zvbi-0.2.44/src/proxy-msg.c:1073:19: branch_true: following 'true' branch (when 'p_tmp2' is non-NULL)...
zvbi-0.2.44/src/proxy-msg.c:1075:19: branch_true: ...to here
zvbi-0.2.44/src/proxy-msg.c:1076:19: danger: argument 1 ('p_tmp') from [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8) could be NULL where non-null expected
# 1074|                  {  /* copy former path up to and including the separator character */
# 1075|                     p_tmp2 += 1;
# 1076|->                   strlcpy(p_tmp, p_path, p_tmp2 - p_path);
# 1077|                  }
# 1078|                  else

Error: COMPILER_WARNING (CWE-563): [#def104]
zvbi-0.2.44/src/raw_decoder.c: scope_hint: In function 'vbi3_raw_decoder_debug'
zvbi-0.2.44/src/raw_decoder.c:1108:36: warning[-Wunused-but-set-variable]: variable 'sp_lines' set but not used
# 1108 |         _vbi3_raw_decoder_sp_line *sp_lines;
#      |                                    ^~~~~~~~
# 1106|   				 vbi_bool		enable)
# 1107|   {
# 1108|-> 	_vbi3_raw_decoder_sp_line *sp_lines;
# 1109|   	unsigned int n_lines;
# 1110|   	vbi_bool r;

Error: COMPILER_WARNING (CWE-563): [#def105]
zvbi-0.2.44/src/sampling_par.c: scope_hint: In function '_vbi_sampling_par_from_services_log'
zvbi-0.2.44/src/sampling_par.c:484:24: warning[-Wunused-but-set-variable]: variable 'margin' set but not used
#  484 |                 double margin;
#      |                        ^~~~~~
#  482|   
#  483|   	for (par = _vbi_service_table; par->id; ++par) {
#  484|-> 		double margin;
#  485|   		double signal;
#  486|   		int offset;

Error: COMPILER_WARNING: [#def106]
zvbi-0.2.44/src/search.c:567:1: warning[-Wenum-int-mismatch]: conflicting types for 'vbi_search_next' due to enum/integer mismatch; have 'int(vbi_search *, vbi_page **, int)'
#  567 | vbi_search_next(vbi_search *search, vbi_page **pg, int dir)
#      | ^~~~~~~~~~~~~~~
zvbi-0.2.44/src/search.c:37: included_from: Included from here.
zvbi-0.2.44/src/search.h:85:26: note: previous declaration of 'vbi_search_next' with type 'vbi_search_status(vbi_search *, vbi_page **, int)'
#   85 | extern vbi_search_status vbi_search_next(vbi_search *search, vbi_page **pg, int dir);
#      |                          ^~~~~~~~~~~~~~~
#  565|   /* XXX fix return type */
#  566|   int
#  567|-> vbi_search_next(vbi_search *search, vbi_page **pg, int dir)
#  568|   {
#  569|   	*pg = NULL;

Error: COMPILER_WARNING (CWE-697): [#def107]
zvbi-0.2.44/src/trigger.c: scope_hint: In function 'parse_eacem'
zvbi-0.2.44/src/trigger.c:339:13: warning[-Waddress]: the comparison will always evaluate as 'true' for the address of 'url' will never be NULL
#  339 |         if (!t->link.url)
#      |             ^
zvbi-0.2.44/src/tables.h:29: included_from: Included from here.
zvbi-0.2.44/src/trigger.c:39: included_from: Included from here.
zvbi-0.2.44/src/event.h:225:41: note: 'url' declared here
#  225 |         signed char                     url[256];
#      |                                         ^~~
#  337|   		/* EACEM eqv PAL/SECAM land, 25 fps */
#  338|   
#  339|-> 	if (!t->link.url)
#  340|   		return NULL;
#  341|   

Error: COMPILER_WARNING (CWE-697): [#def108]
zvbi-0.2.44/src/trigger.c:350:21: warning[-Waddress]: the comparison will always evaluate as 'true' for the address of 'name' will never be NULL
#  350 |                 if (!t->link.name || t->link.pgno < 0 || t->link.url[7])
#      |                     ^
zvbi-0.2.44/src/event.h:224:41: note: 'name' declared here
#  224 |         signed char                     name[80];
#      |                                         ^~~~
#  348|   	else if (strncmp((char *) t->link.url, "dummy", 5) == 0) {
#  349|   		t->link.pgno = parse_dec((char *) t->link.url + 5, 2);
#  350|-> 		if (!t->link.name || t->link.pgno < 0 || t->link.url[7])
#  351|   			return NULL;
#  352|   		t->link.type = VBI_LINK_MESSAGE;

Error: COMPILER_WARNING (CWE-697): [#def109]
zvbi-0.2.44/src/trigger.c: scope_hint: In function 'parse_atvef'
zvbi-0.2.44/src/trigger.c:550:13: warning[-Waddress]: the comparison will always evaluate as 'true' for the address of 'url' will never be NULL
#  550 |         if (!t->link.url)
#      |             ^
zvbi-0.2.44/src/event.h:225:41: note: 'url' declared here
#  225 |         signed char                     url[256];
#      |                                         ^~~
#  548|   	}
#  549|   
#  550|-> 	if (!t->link.url)
#  551|   		return NULL;
#  552|   

Error: COMPILER_WARNING: [#def110]
zvbi-0.2.44/src/ure.c: scope_hint: In function '_ure_make_symbol'
zvbi-0.2.44/src/ure.c:1196:6: warning[-Wold-style-definition]: old-style function definition
# 1196 |      _ure_make_symbol(sym, limit, consumed, b)
#      |      ^~~~~~~~~~~~~~~~
# 1194|                    _ure_buffer_t *b)
# 1195|   #else
# 1196|->      _ure_make_symbol(sym, limit, consumed, b)
# 1197|        ucs2_t *sym;
# 1198|        unsigned long limit, *consumed;

Error: COMPILER_WARNING: [#def111]
zvbi-0.2.44/src/ure.c:1196:6: warning[-Wold-style-definition]: old-style function definition
# 1194|                    _ure_buffer_t *b)
# 1195|   #else
# 1196|->      _ure_make_symbol(sym, limit, consumed, b)
# 1197|        ucs2_t *sym;
# 1198|        unsigned long limit, *consumed;

Error: CPPCHECK_WARNING (CWE-682): [#def112]
zvbi-0.2.44/src/ure.c:1239: error[nullPointerArithmeticOutOfMemory]: If memory allocation fail: pointer addition with NULL pointer.
# 1237|   	realloc((char *) b->symtab,
# 1238|   		sizeof(_ure_symtab_t) * (b->symtab_size + 8));
# 1239|->     sp = b->symtab + b->symtab_size;
# 1240|       (void) memset((char *) sp, 0, sizeof(_ure_symtab_t) << 3);
# 1241|       b->symtab_size += 8;

Error: COMPILER_WARNING: [#def113]
zvbi-0.2.44/src/ure.c: scope_hint: In function '_ure_make_expr'
zvbi-0.2.44/src/ure.c:1261:6: warning[-Wold-style-definition]: old-style function definition
# 1261 |      _ure_make_expr(type, lhs, rhs, b)
#      |      ^~~~~~~~~~~~~~
# 1259|   _ure_make_expr(ucs2_t type, ucs2_t lhs, ucs2_t rhs, _ure_buffer_t *b)
# 1260|   #else
# 1261|->      _ure_make_expr(type, lhs, rhs, b)
# 1262|        ucs2_t type, lhs, rhs;
# 1263|        _ure_buffer_t *b;

Error: COMPILER_WARNING: [#def114]
zvbi-0.2.44/src/ure.c:1261:6: warning[-Wold-style-definition]: old-style function definition
# 1259|   _ure_make_expr(ucs2_t type, ucs2_t lhs, ucs2_t rhs, _ure_buffer_t *b)
# 1260|   #else
# 1261|->      _ure_make_expr(type, lhs, rhs, b)
# 1262|        ucs2_t type, lhs, rhs;
# 1263|        _ure_buffer_t *b;

Error: CPPCHECK_WARNING (CWE-682): [#def115]
zvbi-0.2.44/src/ure.c:1504: error[nullPointerArithmeticOutOfMemory]: If memory allocation fail: pointer addition with NULL pointer.
# 1502|   	  realloc((char *) b->states.states,
# 1503|   		  sizeof(_ure_state_t) * (b->states.states_size + 8));
# 1504|->       sp = b->states.states + b->states.states_size;
# 1505|         (void) memset((char *) sp, 0, sizeof(_ure_state_t) << 3);
# 1506|         b->states.states_size += 8;

Error: CPPCHECK_WARNING (CWE-476): [#def116]
zvbi-0.2.44/src/ure.c:1946: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dfa
# 1944|     (void) memset((char *) dfa, 0, sizeof(_ure_dfa_t));
# 1945|   
# 1946|->   dfa->flags = buf->flags & (_URE_DFA_CASEFOLD|_URE_DFA_BLANKLINE);
# 1947|   
# 1948|     /*

Error: CPPCHECK_WARNING (CWE-476): [#def117]
zvbi-0.2.44/src/ure.c:1956: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dfa
# 1954|         free((char *) buf->symtab[i].states.slist);
# 1955|     }
# 1956|->   dfa->syms = buf->symtab;
# 1957|     dfa->nsyms = buf->symtab_used;
# 1958|   

Error: CPPCHECK_WARNING (CWE-476): [#def118]
zvbi-0.2.44/src/ure.c:1957: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dfa
# 1955|     }
# 1956|     dfa->syms = buf->symtab;
# 1957|->   dfa->nsyms = buf->symtab_used;
# 1958|   
# 1959|     buf->symtab_used = buf->symtab_size = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def119]
zvbi-0.2.44/src/ure.c:1976: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dfa
# 1974|      * Allocate enough space for the states and transitions.
# 1975|      */
# 1976|->   dfa->states = (_ure_dstate_t *) malloc(sizeof(_ure_dstate_t) *
# 1977|   					 dfa->nstates);
# 1978|     dfa->trans = (_ure_trans_t *) malloc(sizeof(_ure_trans_t) * dfa->ntrans);

Error: CPPCHECK_WARNING (CWE-476): [#def120]
zvbi-0.2.44/src/ure.c:1977: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dfa
# 1975|      */
# 1976|     dfa->states = (_ure_dstate_t *) malloc(sizeof(_ure_dstate_t) *
# 1977|-> 					 dfa->nstates);
# 1978|     dfa->trans = (_ure_trans_t *) malloc(sizeof(_ure_trans_t) * dfa->ntrans);
# 1979|   

Error: CPPCHECK_WARNING (CWE-476): [#def121]
zvbi-0.2.44/src/ure.c:1978: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dfa
# 1976|     dfa->states = (_ure_dstate_t *) malloc(sizeof(_ure_dstate_t) *
# 1977|   					 dfa->nstates);
# 1978|->   dfa->trans = (_ure_trans_t *) malloc(sizeof(_ure_trans_t) * dfa->ntrans);
# 1979|   
# 1980|     /*

Error: CPPCHECK_WARNING (CWE-476): [#def122]
zvbi-0.2.44/src/ure.c:1983: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dfa
# 1981|      * Actually transfer the DFA states from the buffer.
# 1982|      */
# 1983|->   dsp = dfa->states;
# 1984|     tp = dfa->trans;
# 1985|     for (i = state = 0, sp = buf->states.states; i < buf->states.states_used;

Error: CPPCHECK_WARNING (CWE-476): [#def123]
zvbi-0.2.44/src/ure.c:1984: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dfa
# 1982|      */
# 1983|     dsp = dfa->states;
# 1984|->   tp = dfa->trans;
# 1985|     for (i = state = 0, sp = buf->states.states; i < buf->states.states_used;
# 1986|          i++, sp++) {

Error: CPPCHECK_WARNING (CWE-758): [#def124]
zvbi-0.2.44/src/ure.c:2071: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 2069|   	  fprintf(out, "\\p");
# 2070|   	for (k = h = 0; k < 32; k++) {
# 2071|-> 	  if (sym->props & (1 << k)) {
# 2072|   	    if (h != 0)
# 2073|   	      putc(',', out);

Error: COMPILER_WARNING (CWE-563): [#def125]
zvbi-0.2.44/src/xds_demux.c: scope_hint: In function 'vbi_xds_demux_reset'
zvbi-0.2.44/src/xds_demux.c:821:22: warning[-Wunused-but-set-variable]: variable 'n' set but not used
#  821 |         unsigned int n;
#      |                      ^
#  819|   vbi_xds_demux_reset		(vbi_xds_demux *	xd)
#  820|   {
#  821|-> 	unsigned int n;
#  822|   	unsigned int i, j;
#  823|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def126]
zvbi-0.2.44/test/capture.c:533:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(name, "r")’
zvbi-0.2.44/test/capture.c:517:14: acquire_resource: opened here
zvbi-0.2.44/test/capture.c:518:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
zvbi-0.2.44/test/capture.c:529:20: branch_false: following ‘false’ branch (when ‘buffer_size == 0’)...
zvbi-0.2.44/test/capture.c:532:30: branch_false: ...to here
zvbi-0.2.44/test/capture.c:533:20: danger: ‘fopen(name, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  531|   
#  532|   		new_buffer = realloc (buffer, new_size);
#  533|-> 		if (NULL == new_buffer) {
#  534|   			free (buffer);
#  535|   			exit (EXIT_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def127]
zvbi-0.2.44/test/capture.c:533:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(name, "r")’
zvbi-0.2.44/test/capture.c:517:14: acquire_memory: allocated here
zvbi-0.2.44/test/capture.c:518:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
zvbi-0.2.44/test/capture.c:529:20: branch_false: following ‘false’ branch (when ‘buffer_size == 0’)...
zvbi-0.2.44/test/capture.c:532:30: branch_false: ...to here
zvbi-0.2.44/test/capture.c:533:20: danger: ‘fopen(name, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  531|   
#  532|   		new_buffer = realloc (buffer, new_size);
#  533|-> 		if (NULL == new_buffer) {
#  534|   			free (buffer);
#  535|   			exit (EXIT_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def128]
zvbi-0.2.44/test/capture.c:541:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(name, "r")’
zvbi-0.2.44/test/capture.c:517:14: acquire_resource: opened here
zvbi-0.2.44/test/capture.c:518:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
zvbi-0.2.44/test/capture.c:529:20: branch_false: following ‘false’ branch (when ‘buffer_size == 0’)...
zvbi-0.2.44/test/capture.c:532:30: branch_false: ...to here
zvbi-0.2.44/test/capture.c:533:20: branch_false: following ‘false’ branch (when ‘new_buffer’ is non-NULL)...
zvbi-0.2.44/test/capture.c:541:25: branch_false: ...to here
zvbi-0.2.44/test/capture.c:541:25: danger: ‘fopen(name, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  539|   		buffer_size = new_size;
#  540|   
#  541|-> 		space = buffer_size - done - 1;
#  542|   		actual = fread (buffer + done, 1, space, fp);
#  543|   		if ((size_t) -1 == actual) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def129]
zvbi-0.2.44/test/capture.c:541:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(name, "r")’
zvbi-0.2.44/test/capture.c:517:14: acquire_memory: allocated here
zvbi-0.2.44/test/capture.c:518:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
zvbi-0.2.44/test/capture.c:529:20: branch_false: following ‘false’ branch (when ‘buffer_size == 0’)...
zvbi-0.2.44/test/capture.c:532:30: branch_false: ...to here
zvbi-0.2.44/test/capture.c:533:20: branch_false: following ‘false’ branch (when ‘new_buffer’ is non-NULL)...
zvbi-0.2.44/test/capture.c:541:25: branch_false: ...to here
zvbi-0.2.44/test/capture.c:541:25: danger: ‘fopen(name, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  539|   		buffer_size = new_size;
#  540|   
#  541|-> 		space = buffer_size - done - 1;
#  542|   		actual = fread (buffer + done, 1, space, fp);
#  543|   		if ((size_t) -1 == actual) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def130]
zvbi-0.2.44/test/date.c:80:23: warning[-Wanalyzer-null-argument]: use of NULL ‘buffer’ where non-null expected
zvbi-0.2.44/test/date.c:71:18: acquire_memory: allocated here
zvbi-0.2.44/test/date.c:72:12: release_memory: assuming ‘buffer’ is NULL
zvbi-0.2.44/test/date.c:72:12: branch_true: following ‘true’ branch (when ‘buffer’ is NULL)...
zvbi-0.2.44/test/date.c:73:17: branch_true: ...to here
zvbi-0.2.44/test/date.c:78:12: branch_true: following ‘true’ branch...
zvbi-0.2.44/test/date.c:79:32: branch_true: ...to here
zvbi-0.2.44/test/date.c:80:23: danger: argument 1 (‘buffer’) NULL where non-null expected
#   78|   	if (lt->seconds_east_valid) {
#   79|   		tm.tm_gmtoff = lt->seconds_east_valid;
#   80|-> 		len = strftime (buffer, buffer_size, "%F %T %Z", &tm);
#   81|   	} else
#   82|   #endif

Error: GCC_ANALYZER_WARNING (CWE-688): [#def131]
zvbi-0.2.44/test/date.c:84:23: warning[-Wanalyzer-null-argument]: use of NULL ‘buffer’ where non-null expected
zvbi-0.2.44/test/date.c:71:18: acquire_memory: allocated here
zvbi-0.2.44/test/date.c:72:12: release_memory: assuming ‘buffer’ is NULL
zvbi-0.2.44/test/date.c:72:12: branch_true: following ‘true’ branch (when ‘buffer’ is NULL)...
zvbi-0.2.44/test/date.c:73:17: branch_true: ...to here
zvbi-0.2.44/test/date.c:78:12: branch_false: following ‘false’ branch...
zvbi-0.2.44/test/date.c:84:23: branch_false: ...to here
zvbi-0.2.44/test/date.c:84:23: danger: argument 1 (‘buffer’) NULL where non-null expected
#   82|   #endif
#   83|   	{
#   84|-> 		len = strftime (buffer, buffer_size, "%F %T UTC", &tm);
#   85|   	}
#   86|   

Error: CPPCHECK_WARNING (CWE-476): [#def132]
zvbi-0.2.44/test/date.c:90: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#   88|   		no_mem_exit ();
#   89|   
#   90|-> 	puts (buffer);
#   91|   
#   92|   	free (buffer);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def133]
zvbi-0.2.44/test/export.c:145:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘open_output_file(pgno,  subno)’
zvbi-0.2.44/test/export.c:193:1: enter_function: entry to ‘do_export’
zvbi-0.2.44/test/export.c:254:17: branch_true: following ‘true’ branch...
zvbi-0.2.44/test/export.c:256:20: branch_true: ...to here
zvbi-0.2.44/test/export.c:256:20: branch_true: following ‘true’ branch...
zvbi-0.2.44/test/export.c:257:30: branch_true: ...to here
zvbi-0.2.44/test/export.c:257:30: call_function: calling ‘open_output_file’ from ‘do_export’
zvbi-0.2.44/test/export.c:257:30: return_function: returning to ‘do_export’ from ‘open_output_file’
zvbi-0.2.44/test/export.c:260:25: call_function: calling ‘close_output_file’ from ‘do_export’
#  143|   	FILE *fp;
#  144|   
#  145|-> 	if (NULL == out_file_name_prefix)
#  146|   		return stdout;
#  147|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def134]
zvbi-0.2.44/test/export.c:145:13: warning[-Wanalyzer-malloc-leak]: leak of ‘open_output_file(pgno,  subno)’
zvbi-0.2.44/test/export.c:193:1: enter_function: entry to ‘do_export’
zvbi-0.2.44/test/export.c:254:17: branch_true: following ‘true’ branch...
zvbi-0.2.44/test/export.c:256:20: branch_true: ...to here
zvbi-0.2.44/test/export.c:256:20: branch_true: following ‘true’ branch...
zvbi-0.2.44/test/export.c:257:30: branch_true: ...to here
zvbi-0.2.44/test/export.c:257:30: call_function: calling ‘open_output_file’ from ‘do_export’
zvbi-0.2.44/test/export.c:257:30: return_function: returning to ‘do_export’ from ‘open_output_file’
zvbi-0.2.44/test/export.c:260:25: call_function: calling ‘close_output_file’ from ‘do_export’
#  143|   	FILE *fp;
#  144|   
#  145|-> 	if (NULL == out_file_name_prefix)
#  146|   		return stdout;
#  147|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def135]
zvbi-0.2.44/test/export.c:236:34: warning[-Wanalyzer-null-argument]: use of NULL ‘open_output_file(pgno,  subno)’ where non-null expected
zvbi-0.2.44/test/export.c:193:1: enter_function: entry to ‘do_export’
zvbi-0.2.44/test/export.c:232:20: branch_true: following ‘true’ branch...
zvbi-0.2.44/test/export.c:235:30: branch_true: ...to here
zvbi-0.2.44/test/export.c:235:30: call_function: calling ‘open_output_file’ from ‘do_export’
zvbi-0.2.44/test/export.c:235:30: return_function: returning to ‘do_export’ from ‘open_output_file’
zvbi-0.2.44/test/export.c:236:34: danger: argument 4 (‘open_output_file(pgno,  subno)’) NULL where non-null expected
#  234|   
#  235|   			fp = open_output_file (pgno, subno);
#  236|-> 			if (1 != fwrite (buffer, ssize, 1, fp))
#  237|   				write_error_exit (/* msg: errno */ NULL);
#  238|   			close_output_file (fp);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def136]
zvbi-0.2.44/test/export.c:258:34: warning[-Wanalyzer-null-argument]: use of NULL ‘open_output_file(pgno,  subno)’ where non-null expected
zvbi-0.2.44/test/export.c:193:1: enter_function: entry to ‘do_export’
zvbi-0.2.44/test/export.c:254:17: branch_true: following ‘true’ branch...
zvbi-0.2.44/test/export.c:256:20: branch_true: ...to here
zvbi-0.2.44/test/export.c:256:20: branch_true: following ‘true’ branch...
zvbi-0.2.44/test/export.c:257:30: branch_true: ...to here
zvbi-0.2.44/test/export.c:257:30: call_function: calling ‘open_output_file’ from ‘do_export’
zvbi-0.2.44/test/export.c:257:30: return_function: returning to ‘do_export’ from ‘open_output_file’
zvbi-0.2.44/test/export.c:258:34: danger: argument 4 (‘open_output_file(pgno,  subno)’) NULL where non-null expected
#  256|   		if (success) {
#  257|   			fp = open_output_file (pgno, subno);
#  258|-> 			if (1 != fwrite (buffer, size, 1, fp))
#  259|   				write_error_exit (/* msg: errno */ NULL);
#  260|   			close_output_file (fp);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def137]
zvbi-0.2.44/test/export.c:811:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vbi_export_info_export(ex)’
zvbi-0.2.44/test/export.c:1131:1: enter_function: entry to ‘main’
zvbi-0.2.44/test/export.c:1289:12: branch_false: following ‘false’ branch...
zvbi-0.2.44/test/export.c:1294:28: branch_false: ...to here
zvbi-0.2.44/test/export.c:1333:9: call_function: calling ‘init_export_module’ from ‘main’
#  809|   		char *end = NULL;
#  810|   
#  811|-> 		out_file_name_suffix = strdup (xi->extension);
#  812|   		if (NULL == out_file_name_suffix)
#  813|   			no_mem_exit ();

Error: COMPILER_WARNING: [#def138]
zvbi-0.2.44/test/proxy-test.c:89:1: warning[-Wunused-const-variable=]: ‘rcsid’ defined but not used
#   89 | rcsid [] = "$Id: proxy-test.c,v 1.21 2008-07-26 06:22:19 mschimek Exp $";
#      | ^~~~~
#   87|   
#   88|   static const char
#   89|-> rcsid [] = "$Id: proxy-test.c,v 1.21 2008-07-26 06:22:19 mschimek Exp $";
#   90|   
#   91|   #ifdef HAVE_CONFIG_H

Error: CPPCHECK_WARNING (CWE-476): [#def139]
zvbi-0.2.44/test/proxy-test.c:984: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pVbiData
#  982|                     for (line=0; line < lineCount; line++)
#  983|                     {
#  984|->                      if ((pVbiData[line].id & (VBI_SLICED_TELETEXT_B|VBI_SLICED_TELETEXT_BD_525)) != 0)
#  985|                        {
#  986|                           PrintTeletextData(pVbiData[line].data, pVbiData[line].line, pVbiData[line].id);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def140]
zvbi-0.2.44/test/sliced.c:1181:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘s’
zvbi-0.2.44/test/sliced.c:1251:1: enter_function: entry to ‘read_stream_new’
zvbi-0.2.44/test/sliced.c:1259:12: branch_false: following ‘false’ branch (when ‘st’ is non-NULL)...
zvbi-0.2.44/test/sliced.c:1262:12: branch_false: ...to here
zvbi-0.2.44/test/sliced.c:1266:20: branch_false: following ‘false’ branch...
zvbi-0.2.44/test/sliced.c:1278:12: branch_false: ...to here
zvbi-0.2.44/test/sliced.c:1278:12: branch_true: following ‘true’ branch (when ‘file_format == 0’)...
zvbi-0.2.44/test/sliced.c:1279:31: branch_true: ...to here
zvbi-0.2.44/test/sliced.c:1279:31: call_function: calling ‘detect_file_format’ from ‘read_stream_new’
# 1179|   	unsigned int i;
# 1180|   
# 1181|-> 	if ('0' != s[0] || '.' != s[1])
# 1182|   		return FALSE;
# 1183|   

Error: COMPILER_WARNING (CWE-563): [#def141]
zvbi-0.2.44/test/test-vps.cc: scope_hint: In function ‘void assert_decode_vps_cni(unsigned int*, const uint8_t*)’
zvbi-0.2.44/test/test-vps.cc:59:22: warning[-Wunused-but-set-variable]: variable ‘cni2’ set but not used
#   59 |         unsigned int cni2;
#      |                      ^~~~
#   57|   {
#   58|   	uint8_t buffer2[13];
#   59|-> 	unsigned int cni2;
#   60|   
#   61|   	memcpy (buffer2, buffer, sizeof (buffer2));

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-75.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namezvbi-0.2.44-1.fc43
store-results-to/tmp/tmpozrrjxwi/zvbi-0.2.44-1.fc43.tar.xz
time-created2025-04-25 16:15:21
time-finished2025-04-25 16:17:52
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpozrrjxwi/zvbi-0.2.44-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpozrrjxwi/zvbi-0.2.44-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9