Task #1300 - v4l-utils-1.26.1-4.fc41/scan-results.err
back to task #1300download
Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/decode_tm6000/decode_tm6000.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/arib-std-b24.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/en300-468-tab00.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-457): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/en300-468-tab00.c:411:20: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘bytebuf[1]’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/loop.c:486:7: note: in expansion of macro ‘BODY’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/en300-468-tab00.c:564: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c: scope_hint: In function ‘gconv’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c:390:1: note: in expansion of macro ‘FUNCTION_NAME’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/en300-468-tab00.c:453: included_from: Included from here. /usr/include/features.h:511: included_from: Included from here. /usr/include/dlfcn.h:22: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/en300-468-tab00.c:20: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c:135: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c:567:47: note: in expansion of macro ‘FROM_DIRECTION’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c:380:22: note: in definition of macro ‘SINGLE2’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c:568:22: note: in expansion of macro ‘SINGLE’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c:568:29: note: in expansion of macro ‘FROM_LOOP’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/loop.c:50: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c:380:22: note: in definition of macro ‘SINGLE2’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c:568:22: note: in expansion of macro ‘SINGLE’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c:568:29: note: in expansion of macro ‘FROM_LOOP’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/loop.c:486:7: note: in expansion of macro ‘BODY’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/loop.c:486:7: note: in expansion of macro ‘BODY’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/loop.c:486:7: note: in expansion of macro ‘BODY’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/loop.c:486:7: note: in expansion of macro ‘BODY’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/loop.c:486:7: note: in expansion of macro ‘BODY’ # 409| } \ # 410| \ # 411|-> ch2 = inptr[1]; \ # 412| \ # 413| if (__builtin_expect (ch2 < 0x20, 0) \ Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c: scope_hint: In function ‘gconv’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c:672:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘irreversible’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c:390:1: note: in expansion of macro ‘FUNCTION_NAME’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c:618:26: note: in expansion of macro ‘FROM_LOOP’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c: scope_hint: In function ‘gconv’ # 670| /* Remember how many non-identical characters we # 671| converted in an irreversible way. */ # 672|-> *irreversible += lirreversible; # 673| # 674| break; Error: CPPCHECK_WARNING (CWE-457): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/gconv/iconv/skeleton.c:746: warning[uninitvar]: Uninitialized variable: nstatus # 744| rerun. */ # 745| assert (outbuf == outerr); # 746|-> assert (nstatus == __GCONV_FULL_OUTPUT); # 747| # 748| /* If we haven't consumed a single byte decrement Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/rds-saa6588/rds-saa6588.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/driver-test.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/ioctl-test.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:335:8: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:835:17: note: in expansion of macro ‘logperror’ /usr/include/argp.h:27: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:835:17: note: in expansion of macro ‘logperror’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:835:17: note: in expansion of macro ‘logperror’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘mc_open’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:835:17: note: in expansion of macro ‘logperror’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:835:17: note: in expansion of macro ‘logperror’ # 333| #define logperror(msg) do {\ # 334| show(RED, 0, "%s: %s", msg, strerror(errno)); \ # 335|-> printf("\n"); \ # 336| } while (0) # 337| Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘media_get_topology’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:819:28: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:723:17: note: in expansion of macro ‘logperror’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘media_get_topology’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:723:17: note: in expansion of macro ‘logperror’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘media_get_topology’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘media_get_topology’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘media_get_topology’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘media_get_topology’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘media_get_topology’ # 817| free(media_get_uptr(topo->ptr_links)); # 818| # 819|-> topo->ptr_entities = 0; # 820| topo->ptr_interfaces = 0; # 821| topo->ptr_pads = 0; Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:820:30: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:723:17: note: in expansion of macro ‘logperror’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘media_get_topology’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:723:17: note: in expansion of macro ‘logperror’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘media_get_topology’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘media_get_topology’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘media_get_topology’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘media_get_topology’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘media_get_topology’ # 818| # 819| topo->ptr_entities = 0; # 820|-> topo->ptr_interfaces = 0; # 821| topo->ptr_pads = 0; # 822| topo->ptr_links = 0; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c: scope_hint: In function ‘mc_open’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:833:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘mc’ # 831| mc = calloc(1, sizeof(*mc)); # 832| # 833|-> mc->fd = open(devname, O_RDWR); # 834| if (mc->fd < 0) { # 835| logperror("Can't open media device"); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/mc_nextgen_test.c:835:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'mc' # 833| mc->fd = open(devname, O_RDWR); # 834| if (mc->fd < 0) { # 835|-> logperror("Can't open media device"); # 836| return NULL; # 837| } Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/pixfmt-test.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/pixfmt-test.c:945:20: warning[core.NullDereference]: Access to field 'byte_order' results in a dereference of a null pointer (loaded from variable 'xi') # 943| if (PACKED_RGB != pixel_formats[i].pixfmt_class) # 944| continue; # 945|-> if ((LSBFirst == xi->byte_order) # 946| != (LE == pixel_formats[i].byte_order)) # 947| continue; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/sliced-vbi-detect.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/sliced-vbi-detect.c: scope_hint: In function ‘detect’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/sliced-vbi-detect.c:56:38: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘buf’ # 54| int field, line; # 55| # 56|-> line = buf[i].line; # 57| field = buf[i].field; # 58| if (buf[i].id == 0) Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/sliced-vbi-test.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/sliced-vbi-test.c:116:2: warning[deadcode.DeadStores]: Value stored to 'c' is never read # 114| //printf("XDS: %02x %02x: ", s->data[0], s->data[1]); # 115| c = odd_parity(s->data[0]) ? s->data[0] & 0x7F : '?'; # 116|-> c = printable(c); # 117| //putchar(c); # 118| c = odd_parity(s->data[1]) ? s->data[1] & 0x7F : '?'; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/sliced-vbi-test.c:119:2: warning[deadcode.DeadStores]: Value stored to 'c' is never read # 117| //putchar(c); # 118| c = odd_parity(s->data[1]) ? s->data[1] & 0x7F : '?'; # 119|-> c = printable(c); # 120| //putchar(c); # 121| //putchar('\n'); Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/sliced-vbi-test.c: scope_hint: In function ‘process’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/sliced-vbi-test.c:389:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘s’ # 387| static void process(struct v4l2_sliced_vbi_data *s) # 388| { # 389|-> if (s->id == 0) # 390| return; # 391| Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/stress-buffer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/stress-buffer.c: scope_hint: In function ‘main’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/stress-buffer.c:90:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&fname, "a+")’ # 88| } # 89| # 90|-> fd = open(argv[1], O_RDONLY); # 91| if (fd < 0) { # 92| perror("error opening device"); Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/stress-buffer.c:90:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&fname, "a+")’ # 88| } # 89| # 90|-> fd = open(argv[1], O_RDONLY); # 91| if (fd < 0) { # 92| perror("error opening device"); Error: GCC_ANALYZER_WARNING (CWE-775): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/stress-buffer.c:98:37: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(argv[1], 0)’ # 96| # 97| /* Random number 0 - 1000 */ # 98|-> magic_buffer_size = rand() % sizeof(buffer); # 99| # 100| memset(buffer, 0, sizeof(buffer)); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:340:11: warning[core.NullDereference]: Array access (from variable 'plane0') results in a null pointer dereference # 338| case V4L2_PIX_FMT_RGB565: /* rrrrrggg gggbbbbb */ # 339| for (i = 0; i < 2; i++) { # 340|-> pix = (plane0[0] << 8) + plane0[1]; # 341| # 342| *(*dst)++ = (unsigned char)(((pix & 0xf800) >> 11) << 3) | 0x07; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:351:11: warning[core.NullDereference]: Array access (from variable 'plane0') results in a null pointer dereference # 349| case V4L2_PIX_FMT_RGB565X: /* gggbbbbb rrrrrggg */ # 350| for (i = 0; i < 2; i++) { # 351|-> pix = (plane0[1] << 8) + plane0[0]; # 352| # 353| *(*dst)++ = (unsigned char)(((pix & 0xf800) >> 11) << 3) | 0x07; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:367:7: warning[core.NullDereference]: Array access (from variable 'plane0') results in a null pointer dereference # 365| u_off = (fourcc == V4L2_PIX_FMT_YUYV || fourcc == V4L2_PIX_FMT_UYVY) ? 0 : 2; # 366| # 367|-> u = plane0[(1 - y_off) + u_off]; # 368| v = plane0[(1 - y_off) + (2 - u_off)]; # 369| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:376:7: warning[core.NullDereference]: Array access (from variable 'plane1') results in a null pointer dereference # 374| case V4L2_PIX_FMT_NV12: # 375| case V4L2_PIX_FMT_NV16: # 376|-> u = plane1[0]; # 377| v = plane1[1]; # 378| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:385:7: warning[core.NullDereference]: Array access (from variable 'plane1') results in a null pointer dereference # 383| case V4L2_PIX_FMT_NV21: # 384| case V4L2_PIX_FMT_NV61: # 385|-> v = plane1[0]; # 386| u = plane1[1]; # 387| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:394:7: warning[core.NullDereference]: Array access (from variable 'plane1') results in a null pointer dereference # 392| case V4L2_PIX_FMT_YUV420: # 393| case V4L2_PIX_FMT_YUV422P: # 394|-> u = plane1[0]; # 395| v = plane2[0]; # 396| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:402:7: warning[core.NullDereference]: Array access (from variable 'plane1') results in a null pointer dereference # 400| break; # 401| case V4L2_PIX_FMT_YVU420: # 402|-> v = plane1[0]; # 403| u = plane2[0]; # 404| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:413:16: warning[core.NullDereference]: Array access (from variable 'plane0') results in a null pointer dereference # 411| case V4L2_PIX_FMT_XRGB32: # 412| for (i = 0; i < 2; i++) { # 413|-> *(*dst)++ = plane0[1]; # 414| *(*dst)++ = plane0[2]; # 415| *(*dst)++ = plane0[3]; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:424:16: warning[core.NullDereference]: Array access (from variable 'plane0') results in a null pointer dereference # 422| case V4L2_PIX_FMT_XBGR32: # 423| for (i = 0; i < 2; i++) { # 424|-> *(*dst)++ = plane0[2]; # 425| *(*dst)++ = plane0[1]; # 426| *(*dst)++ = plane0[0]; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:434:16: warning[core.NullDereference]: Array access (from variable 'plane0') results in a null pointer dereference # 432| case V4L2_PIX_FMT_BGR24: # 433| for (i = 0; i < 2; i++) { # 434|-> *(*dst)++ = plane0[2]; # 435| *(*dst)++ = plane0[1]; # 436| *(*dst)++ = plane0[0]; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c: scope_hint: In function ‘read_capture_loop’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:567:32: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘buffers’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c: scope_hint: In function ‘read_capture_loop’ /usr/include/sys/select.h:30: included_from: Included from here. /usr/include/sys/time.h:32: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/include/linux/videodev2.h:60: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:17: included_from: Included from here. # 565| } # 566| # 567|-> size = read(fd, buffers[0].start, buffers[0].length); # 568| # 569| if (size == -1 && errno != EAGAIN) { Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:612:2: warning[unix.Malloc]: Potential leak of memory pointed to by 'buffers' # 610| gettimeofday(start, &tz); # 611| # 612|-> return read_capture_loop(fd, buffers, fmt, n_frames, out_buf, out_dir); # 613| } # 614| Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c: scope_hint: In function ‘read_capture’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:612:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffers’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c: scope_hint: In function ‘read_capture’ /usr/include/argp.h:27: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:14: included_from: Included from here. # 610| gettimeofday(start, &tz); # 611| # 612|-> return read_capture_loop(fd, buffers, fmt, n_frames, out_buf, out_dir); # 613| } # 614| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:735:6: warning[unix.Malloc]: Potential leak of memory pointed to by 'buffers' # 733| gettimeofday(start, &tz); # 734| # 735|-> ret = userptr_capture_loop(fd, buffers, req.count, fmt, # 736| n_frames, out_buf, out_dir); # 737| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:883:3: warning[unix.StdCLibraryFunctions]: The 1st argument to 'fwrite' is NULL but should not be NULL # 881| } # 882| # 883|-> fwrite(out_buf, size, 1, fout); # 884| fclose(fout); # 885| Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c: scope_hint: In function ‘mmap_capture’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:993:43: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘buffers’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c: scope_hint: In function ‘mmap_capture’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:30:18: note: in expansion of macro ‘CLEAR_P’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:985:17: note: in expansion of macro ‘CLEAR’ # 991| xioctl(fd, VIDIOC_QUERYBUF, &buf); # 992| # 993|-> buffers[n_buffers].length = buf.length; # 994| if (!buffers) { # 995| fprintf(stderr, "Out of memory\n"); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:1042:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'buffers' # 1040| } # 1041| # 1042|-> return 0; # 1043| } # 1044| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/test/v4l2grab.c:1242:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'out_buf' # 1240| switch (method) { # 1241| case IO_METHOD_READ: # 1242|-> ret = read_capture(fd, n_frames, out_buf, out_dir, # 1243| &fmt, &start); # 1244| break; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c: scope_hint: In function ‘alloc_firmware’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:81:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f’ # 79| static struct firmware* alloc_firmware(void) { # 80| struct firmware *f = malloc(sizeof(*f)); # 81|-> f->name = NULL; # 82| f->desc = NULL; # 83| f->nr_desc = 0; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:92:4: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value # 90| unsigned int i = 0; # 91| for(i = 0; i < f->nr_desc; ++ i) { # 92|-> free(f->desc[i].data); # 93| } # 94| } Error: GCC_ANALYZER_WARNING (CWE-457): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c: scope_hint: In function ‘free_firmware’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:92:40: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>.data’ # 90| unsigned int i = 0; # 91| for(i = 0; i < f->nr_desc; ++ i) { # 92|-> free(f->desc[i].data); # 93| } # 94| } Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:95:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 93| } # 94| } # 95|-> free(f->desc); # 96| free(f); # 97| } Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c: scope_hint: In function ‘read_firmware’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:97:1: warning[-Wanalyzer-malloc-leak]: leak of ‘name’ # 95| free(f->desc); # 96| free(f); # 97|-> } # 98| # 99| static void add_firmware_description(struct firmware *f, Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:104:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*f.desc’ where non-null expected <built-in>: note: argument 2 of ‘__builtin_memcpy’ must be non-null # 102| # 103| new_desc = malloc((f->nr_desc + 1) * sizeof(*new_desc)); # 104|-> memcpy(new_desc, f->desc, f->nr_desc * sizeof(*new_desc)); # 105| memcpy(new_desc + f->nr_desc, d, sizeof(*d)); # 106| free(f->desc); Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:104:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘new_desc’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 102| # 103| new_desc = malloc((f->nr_desc + 1) * sizeof(*new_desc)); # 104|-> memcpy(new_desc, f->desc, f->nr_desc * sizeof(*new_desc)); # 105| memcpy(new_desc + f->nr_desc, d, sizeof(*d)); # 106| free(f->desc); Error: GCC_ANALYZER_WARNING (CWE-457): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c: scope_hint: In function ‘add_firmware_description’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:104:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*f.desc’ # 102| # 103| new_desc = malloc((f->nr_desc + 1) * sizeof(*new_desc)); # 104|-> memcpy(new_desc, f->desc, f->nr_desc * sizeof(*new_desc)); # 105| memcpy(new_desc + f->nr_desc, d, sizeof(*d)); # 106| free(f->desc); Error: CPPCHECK_WARNING (CWE-457): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:105: warning[uninitvar]: Uninitialized variable: d.int_freq # 103| new_desc = malloc((f->nr_desc + 1) * sizeof(*new_desc)); # 104| memcpy(new_desc, f->desc, f->nr_desc * sizeof(*new_desc)); # 105|-> memcpy(new_desc + f->nr_desc, d, sizeof(*d)); # 106| free(f->desc); # 107| f->desc = new_desc; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:138:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'name' # 136| # 137| if(size < HEADER_LENGTH) { # 138|-> printf("Invalid firmware header length.\n"); # 139| free_firmware(f); # 140| return -1; Error: CPPCHECK_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:140: error[memleak]: Memory leak: name # 138| printf("Invalid firmware header length.\n"); # 139| free_firmware(f); # 140|-> return -1; # 141| } # 142| name[32] = 0; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c: scope_hint: In function ‘read_firmware’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:142:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘name’ # 140| return -1; # 141| } # 142|-> name[32] = 0; # 143| memcpy(name, data, 32); # 144| f->name = name; Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:143:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected <built-in>: note: argument 2 of ‘__builtin_memcpy’ must be non-null # 141| } # 142| name[32] = 0; # 143|-> memcpy(name, data, 32); # 144| f->name = name; # 145| p += 32; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:158:33: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*<unknown>.desc + (long unsigned int)i * 32’ # 156| return -1; # 157| } # 158|-> f->desc[i].type = __le32_to_cpu(*(__u32*) p); # 159| p += sizeof(f->desc[i].type); # 160| f->desc[i].id = __le64_to_cpu(*(__u64*) p); Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:179:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc((sizetype)*(__u32 *)p)’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 177| # 178| f->desc[i].data = malloc(f->desc[i].size); # 179|-> memcpy(f->desc[i].data, p, f->desc[i].size); # 180| # 181| p += f->desc[i].size; Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c: scope_hint: In function ‘main’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:247:25: warning[-Wanalyzer-malloc-leak]: leak of ‘read_firmware_file(firmware_file)’ # 245| # 246| /* allocate firmware buffer*/ # 247|-> ptr = malloc(buf.st_size); # 248| # 249| if(read(fd, ptr, buf.st_size) < 0) { Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:288:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'data' # 286| # 287| if(write(fd, data, size) < 0) { # 288|-> perror("Error while writing the firmware file"); # 289| close(fd); # 290| return; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:495:4: warning[deadcode.DeadStores]: Value stored to 'curr_id' is never read # 493| curr_id = V4L2_STD_EIAJ; # 494| } else { # 495|-> curr_id = 0; # 496| break; # 497| } Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c: scope_hint: In function ‘list_firmware’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:523:22: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 521| f->version); # 522| printf("standards:\t%u\n", f->nr_desc); # 523|-> for(i = 0; i < f->nr_desc; ++i) { # 524| printf("Firmware %2u, ", i); # 525| list_firmware_desc(stdout, &f->desc[i]); Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c: scope_hint: In function ‘add_standard’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:574:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 572| if(!standard_data) { # 573| fprintf(stderr, "Couldn't create the firmware standard data.\n"); # 574|-> return; # 575| } # 576| desc.id = 0; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c: scope_hint: In function ‘seek_chunks’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:632:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fpos’ # 630| fpos = p; # 631| for (p2 = fdata; p2 < endf; p2++, fpos++) { # 632|-> if (*fpos != *p2) # 633| break; # 634| } Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:648:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘temp_data’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 646| fsize = endf - fdata; # 647| temp_data = malloc(fsize); # 648|-> memcpy(temp_data, fdata, fsize); # 649| # 650| /* Try again, changing endian */ Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:666:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fpos’ # 664| fpos = p; # 665| for (p2 = temp_data; p2 < temp_data + fsize; p2++, fpos++) { # 666|-> if (*fpos != *p2) # 667| break; # 668| } Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:675:43: warning[-Wanalyzer-malloc-leak]: leak of ‘p2’ # 673| hunk->next = NULL; # 674| hunk->need_fix_endian = 1; # 675|-> hunk->hint_method = 0; # 676| return 1; # 677| } Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:693:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fpos’ # 691| p2 < fdata + ini_sig + sig_len; p2++, # 692| fpos++) { # 693|-> if (*fpos != *p2) # 694| break; # 695| } Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:898:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 896| # 897| if (!write_file) # 898|-> return; # 899| # 900| fp = fopen(write_file, "w"); Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c: scope_hint: In function ‘seek_firmware’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:898:17: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ # 896| # 897| if (!write_file) # 898|-> return; # 899| # 900| fp = fopen(write_file, "w"); Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:898:17: warning[-Wanalyzer-malloc-leak]: leak of ‘seek’ # 896| # 897| if (!write_file) # 898|-> return; # 899| # 900| fp = fopen(write_file, "w"); Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c: scope_hint: In function ‘main’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:1083:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 1081| } # 1082| # 1083|-> switch(action) { # 1084| case LIST_ACTION: # 1085| list_firmware(f, dump, write_file); Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:1093:59: warning[-Wanalyzer-null-argument]: use of NULL ‘nr_str’ where non-null expected /usr/include/features.h:511: included_from: Included from here. /usr/include/sys/stat.h:25: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:23: included_from: Included from here. /usr/include/stdlib.h:219:26: note: argument 1 of ‘strtoul’ must be non-null # 1091| # 1092| case DELETE_ACTION: # 1093|-> delete_standard(f, firmware_file, strtoul(nr_str, NULL, 10)); # 1094| break; # 1095| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:1097:40: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 1095| # 1096| case SET_TYPE_ACTION: # 1097|-> set_standard_type(f, firmware_file, strtoul(index_str, NULL, 10), strtoul(nr_str, NULL, 10)); # 1098| break; # 1099| Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:1097:91: warning[-Wanalyzer-null-argument]: use of NULL ‘nr_str’ where non-null expected /usr/include/stdlib.h:219:26: note: argument 1 of ‘strtoul’ must be non-null # 1095| # 1096| case SET_TYPE_ACTION: # 1097|-> set_standard_type(f, firmware_file, strtoul(index_str, NULL, 10), strtoul(nr_str, NULL, 10)); # 1098| break; # 1099| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:1101:38: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 1099| # 1100| case SET_ID_ACTION: # 1101|-> set_standard_id(f, firmware_file, strtoul(index_str, NULL, 10), strtoul(nr_str, NULL, 10)); # 1102| # 1103| case SEEK_FIRM_ACTION: Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:1101:89: warning[-Wanalyzer-null-argument]: use of NULL ‘nr_str’ where non-null expected /usr/include/stdlib.h:219:26: note: argument 1 of ‘strtoul’ must be non-null # 1099| # 1100| case SET_ID_ACTION: # 1101|-> set_standard_id(f, firmware_file, strtoul(index_str, NULL, 10), strtoul(nr_str, NULL, 10)); # 1102| # 1103| case SEEK_FIRM_ACTION: Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/firmware-tool.c:1107:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'f' # 1105| break; # 1106| } # 1107|-> return 0; # 1108| } Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/standards.c: scope_hint: In function ‘alloc_vector’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/standards.c:40:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘v’ # 38| static struct vector* alloc_vector(unsigned int size) { # 39| struct vector *v = malloc(sizeof(*v)); # 40|-> v->data = malloc(size); # 41| v->size = size; # 42| return v; Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/standards.c:56:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*v.data’ where non-null expected v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/standards.c: scope_hint: In function ‘enlarge_vector’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/standards.c:31:20: note: in definition of macro ‘MAX’ <built-in>: note: argument 2 of ‘__builtin_memcpy’ must be non-null # 54| v->size = MAX(v->size, new_size); # 55| n_data = malloc(v->size); # 56|-> memcpy(n_data, v->data, old_size); # 57| free(v->data); # 58| v->data = n_data; Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/standards.c:56:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘n_data’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 54| v->size = MAX(v->size, new_size); # 55| n_data = malloc(v->size); # 56|-> memcpy(n_data, v->data, old_size); # 57| free(v->data); # 58| v->data = n_data; Error: GCC_ANALYZER_WARNING (CWE-457): v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/standards.c: scope_hint: In function ‘enlarge_vector’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/standards.c:56:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*v.data’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/standards.c: scope_hint: In function ‘enlarge_vector’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/standards.c:31:20: note: in definition of macro ‘MAX’ # 54| v->size = MAX(v->size, new_size); # 55| n_data = malloc(v->size); # 56|-> memcpy(n_data, v->data, old_size); # 57| free(v->data); # 58| v->data = n_data; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/standards.c:100:10: warning[deadcode.DeadStores]: Although the value stored to 'r' is used in the enclosing expression, the value is never actually read from 'r' # 98| } # 99| # 100|-> while ((r = getline(&line, &len, file)) != -1) { # 101| unsigned int i = 0; # 102| unsigned int val, count = 0; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/contrib/xc3028-firmware/standards.c:100:14: warning[core.NonNullParamChecker]: Null pointer passed to 3rd parameter expecting 'nonnull' # 98| } # 99| # 100|-> while ((r = getline(&line, &len, file)) != -1) { # 101| unsigned int i = 0; # 102| unsigned int val, count = 0; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-test.cpp:14: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-compliance.h:11: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/include/linux/cec-funcs.h:1304:6: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value # 1302| msg->msg[1] = CEC_MSG_USER_CONTROL_PRESSED; # 1303| msg->msg[2] = ui_cmd->ui_cmd; # 1304|-> if (!ui_cmd->has_opt_arg) # 1305| return; # 1306| switch (ui_cmd->ui_cmd) { Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/include/libdvbv5/desc_frequency_list.h:24: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_frequency_list.c:21: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_frequency_list.c: scope_hint: In function ‘dvb_desc_frequency_list_init’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/include/libdvbv5/descriptors.h:95:11: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc((long unsigned int)*(struct dvb_desc_frequency_list *)desc.length + 18446744073709551615 >> 2 & 255, 4)’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_frequency_list.c:45:17: note: in expansion of macro ‘bswap32’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_frequency_list.c:45:17: note: in expansion of macro ‘bswap32’ # 93| # 94| #define bswap32(b) do {\ # 95|-> b = ntohl(b); \ # 96| } while (0) # 97| Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/countries.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/countries.c: scope_hint: In function ‘dvb_guess_user_country’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/countries.c:406:28: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buf’ where non-null expected v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/countries.c:20: included_from: Included from here. <built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null # 404| # 405| // country after '_', if given # 406|-> if ((pch = strchr(buf, '_'))) # 407| pbuf = pch + 1; # 408| Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors.c:1376:20: warning[unix.cstring.BadSizeArg]: Potential buffer overflow. Replace with 'sizeof(hex) - strlen(hex) - 1' or use a safer 'strlcat' API # 1374| # 1375| snprintf (t, sizeof(t), "%02x ", (unsigned int) data[i]); # 1376|-> strncat (hex, t, sizeof(hex) - 1); # 1377| if (data[i] > 31 && data[i] < 128 ) # 1378| ascii[j] = data[i]; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors.c:1383:22: warning[unix.cstring.BadSizeArg]: Potential buffer overflow. Replace with 'sizeof(hex) - strlen(hex) - 1' or use a safer 'strlcat' API # 1381| j++; # 1382| if (j == 8) # 1383|-> strncat(hex, " ", sizeof(hex) - 1); # 1384| if (j == 16) { # 1385| ascii[j] = '\0'; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_atsc_service_location.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-131): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_ca_identifier.c: scope_hint: In function ‘dvb_desc_ca_identifier_init’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_ca_identifier.c:34:18: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size # 32| # 33| d->caid_count = d->length >> 1; /* FIXME: warn if odd */ # 34|-> d->caids = malloc(d->length); # 35| if (!d->caids) { # 36| dvb_logerr("dvb_desc_ca_identifier_init: out of memory"); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_event_extended.c:96:3: warning[deadcode.DeadStores]: Value stored to 'buf' is never read # 94| event->text_emph = NULL; # 95| dvb_parse_string(parms, &event->text, &event->text_emph, buf, len); # 96|-> buf += len; # 97| } # 98| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_event_short.c:57:2: warning[deadcode.DeadStores]: Value stored to 'buf' is never read # 55| buf++; # 56| dvb_parse_string(parms, &event->text, &event->text_emph, buf, len2); # 57|-> buf += len; # 58| return 0; # 59| } Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_extension.c: scope_hint: In function ‘dvb_extension_descriptor_init’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_extension.c:163:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘calloc(1, size)’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 161| } # 162| else # 163|-> memcpy(ext->descriptor, p, size); # 164| return 0; # 165| } Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_network_name.c:38:2: warning[deadcode.DeadStores]: Value stored to 'buf' is never read # 36| net->network_name_emph = NULL; # 37| dvb_parse_string(parms, &net->network_name, &net->network_name_emph, buf, len); # 38|-> buf += len; # 39| return 0; # 40| } Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_sat.c:68:2: warning[core.CallAndMessage]: 4th function call argument is an uninitialized value # 66| } # 67| dvb_loginfo("| modulation_system %s", sat->modulation_system ? "DVB-S2" : "DVB-S"); # 68|-> dvb_loginfo("| frequency %d %c", sat->frequency, pol); # 69| dvb_loginfo("| symbol_rate %d", sat->symbol_rate); # 70| dvb_loginfo("| fec %d", sat->fec); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_sat.c:68:2: warning[core.CallAndMessage]: 5th function call argument is an uninitialized value # 66| } # 67| dvb_loginfo("| modulation_system %s", sat->modulation_system ? "DVB-S2" : "DVB-S"); # 68|-> dvb_loginfo("| frequency %d %c", sat->frequency, pol); # 69| dvb_loginfo("| symbol_rate %d", sat->symbol_rate); # 70| dvb_loginfo("| fec %d", sat->fec); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_service.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_service.c:83:3: warning[deadcode.DeadStores]: Value stored to 'buf' is never read # 81| if (len) { # 82| dvb_parse_string(parms, &service->name, &service->name_emph, buf, len2); # 83|-> buf += len; # 84| } # 85| return 0; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_t2_delivery.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_t2_delivery.c: scope_hint: In function ‘dvb_desc_t2_delivery_init’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_t2_delivery.c:68:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 66| } # 67| # 68|-> d->cell = realloc(d->cell, (d->num_cell + 1) * sizeof(*d->cell)); # 69| if (!d->cell) { # 70| dvb_logerr("%s: out of memory", __func__); Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_t2_delivery.c:124:74: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 122| return -2; # 123| } # 124|-> d->cell[d->num_cell].subcel[i].cell_id_extension = *p; # 125| p++; # 126| Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_t2_delivery.c:131:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 129| d->centre_frequency = realloc(d->centre_frequency, # 130| d->frequency_loop_length * sizeof(*d->centre_frequency)); # 131|-> memcpy(&d->centre_frequency[pos], p, sizeof(*d->centre_frequency)); # 132| bswap32(d->centre_frequency[pos]); # 133| d->cell[d->num_cell].subcel[i].transposer_frequency = d->centre_frequency[pos]; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/descriptors/desc_ts_info.c:66:2: warning[deadcode.DeadStores]: Value stored to 'p' is never read # 64| bswap16(d->service_id[i]); # 65| # 66|-> p += sizeof(*d->service_id) * t->num_of_service; # 67| return 0; # 68| } Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-demux.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-local.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-local.c:228:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read # 226| pci_vend = p + 2; # 227| # 228|-> ret = asprintf(&dvb_dev->bus_id, "%s:%s", pci_dev, pci_vend); # 229| } else if (!strcmp(bus_type, "usb") || !strcmp(bus_type, "usbdevice")) { # 230| const char *vend, *prod; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-local.c:236:4: warning[deadcode.DeadStores]: Value stored to 'ret' is never read # 234| # 235| if (vend && prod) # 236|-> ret = asprintf(&dvb_dev->bus_id, "%s:%s", vend, prod); # 237| # 238| p = udev_device_get_sysattr_value(parent,"manufacturer"); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-685): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c: scope_hint: In function ‘__prepare_data’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c:163:27: warning[-Wanalyzer-va-list-exhausted]: ‘ap’ has no more arguments (0 consumed) v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c: scope_hint: In function ‘__prepare_data’ /usr/include/sys/types.h:176: included_from: Included from here. /usr/include/libudev.h:8: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c:29: included_from: Included from here. # 161| switch (*fmt++) { # 162| case 's': /* string */ # 163|-> s = va_arg(ap, char *); # 164| len = strlen(s); # 165| if (p + len + 4 > endp) { Error: GCC_ANALYZER_WARNING (CWE-685): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c:182:50: warning[-Wanalyzer-va-list-exhausted]: ‘ap’ has no more arguments (0 consumed) v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c: scope_hint: In function ‘__prepare_data’ # 180| } # 181| # 182|-> i32 = htobe32(va_arg(ap, int32_t)); # 183| memcpy(p, &i32, 4); # 184| p += 4; Error: CPPCHECK_WARNING (CWE-664): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c:466: error[va_end_missing]: va_list 'ap' was opened but not closed by va_end(). # 464| p - buf, 4, buf_size); # 465| stack_dump(parms); # 466|-> return -1; # 467| } # 468| len = be32toh(*(int32_t *)p); Error: GCC_ANALYZER_WARNING (CWE-404): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c: scope_hint: In function ‘scan_data’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c:466:40: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c: scope_hint: In function ‘scan_data’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/include/libdvbv5/dvb-fe.h:33: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-fe-priv.h:23: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c:40: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/include/libdvbv5/dvb-log.h:92:33: note: in expansion of macro ‘dvb_loglevel’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c:483:33: note: in expansion of macro ‘dvb_logdbg’ # 464| p - buf, 4, buf_size); # 465| stack_dump(parms); # 466|-> return -1; # 467| } # 468| len = be32toh(*(int32_t *)p); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev-remote.c:1585:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read # 1583| # 1584| if (msg->retval) { # 1585|-> ret = msg->retval; # 1586| goto error; # 1587| } Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev.c:76: error[memleak]: Memory leak: dvb # 74| if (!dvb->d.fe_parms) { # 75| dvb_dev_free(&dvb->d); # 76|-> return NULL; # 77| } # 78| parms = (void *)dvb->d.fe_parms; Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev.c: scope_hint: In function ‘dvb_dev_alloc’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-dev.c:122:1: warning[-Wanalyzer-malloc-leak]: leak of ‘dvb’ # 120| # 121| free(dvb); # 122|-> } # 123| # 124| void dvb_dev_dump_device(char *msg, Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-fe.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-fe.c:1130:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 1128| *scale = FE_SCALE_RELATIVE; # 1129| # 1130|-> return ber32; # 1131| } # 1132| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-fe.c:1295:18: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value # 1293| case SYS_DVBC_ANNEX_C: # 1294| dvb_fe_retrieve_parm(&parms->p, DTV_MODULATION, &modulation); # 1295|-> if (modulation == QAM_AUTO) # 1296| modulation = QAM_64; /* Assume worse case */ # 1297| qual = cnr_arr_to_qual(modulation, FEC_NONE, cnr->svalue, Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-fe.c:1303:10: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 1301| case SYS_DVBS: # 1302| dvb_fe_retrieve_parm(&parms->p, DTV_INNER_FEC, &fec); # 1303|-> qual = cnr_arr_to_qual(QPSK, fec, cnr->svalue, # 1304| dvb_s_cnr_2_qual, # 1305| ARRAY_SIZE(dvb_s_cnr_2_qual)); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-fe.c:1310:10: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value # 1308| dvb_fe_retrieve_parm(&parms->p, DTV_MODULATION, &modulation); # 1309| dvb_fe_retrieve_parm(&parms->p, DTV_INNER_FEC, &fec); # 1310|-> qual = cnr_arr_to_qual(modulation, fec, cnr->svalue, # 1311| dvb_s2_cnr_2_qual, # 1312| ARRAY_SIZE(dvb_s2_cnr_2_qual)); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-fe.c:1310:10: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 1308| dvb_fe_retrieve_parm(&parms->p, DTV_MODULATION, &modulation); # 1309| dvb_fe_retrieve_parm(&parms->p, DTV_INNER_FEC, &fec); # 1310|-> qual = cnr_arr_to_qual(modulation, fec, cnr->svalue, # 1311| dvb_s2_cnr_2_qual, # 1312| ARRAY_SIZE(dvb_s2_cnr_2_qual)); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-fe.c:1317:18: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value # 1315| dvb_fe_retrieve_parm(&parms->p, DTV_ISDBT_LAYERA_MODULATION, &modulation); # 1316| dvb_fe_retrieve_parm(&parms->p, DTV_ISDBT_LAYERA_FEC, &fec); # 1317|-> if (modulation == QAM_AUTO) # 1318| modulation = QAM_64; /* Assume worse case */ # 1319| qual = cnr_arr_to_qual(modulation, fec, cnr->svalue, Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-fe.c:1319:10: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 1317| if (modulation == QAM_AUTO) # 1318| modulation = QAM_64; /* Assume worse case */ # 1319|-> qual = cnr_arr_to_qual(modulation, fec, cnr->svalue, # 1320| isdb_t_cnr_2_qual, # 1321| ARRAY_SIZE(isdb_t_cnr_2_qual)); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-fe.c:1326:10: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value # 1324| dvb_fe_retrieve_parm(&parms->p, DTV_MODULATION, &modulation); # 1325| dvb_fe_retrieve_parm(&parms->p, DTV_CODE_RATE_LP, &fec); # 1326|-> qual = cnr_arr_to_qual(modulation, fec, cnr->svalue, # 1327| dvb_t_cnr_2_qual, # 1328| ARRAY_SIZE(dvb_t_cnr_2_qual)); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-fe.c:1326:10: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 1324| dvb_fe_retrieve_parm(&parms->p, DTV_MODULATION, &modulation); # 1325| dvb_fe_retrieve_parm(&parms->p, DTV_CODE_RATE_LP, &fec); # 1326|-> qual = cnr_arr_to_qual(modulation, fec, cnr->svalue, # 1327| dvb_t_cnr_2_qual, # 1328| ARRAY_SIZE(dvb_t_cnr_2_qual)); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-file.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-file.c: scope_hint: In function ‘dvb_parse_format_oneline’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-file.c:306:35: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘entry’ # 304| entry = entry->next; # 305| } # 306|-> entry->sat_number = -1; # 307| entry->props[entry->n_props].cmd = DTV_DELIVERY_SYSTEM; # 308| entry->props[entry->n_props++].u.data = fmt->delsys; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-file.c:351:61: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(2, 1)’ # 349| entry->video_pid = calloc(sizeof(*entry->video_pid), 1); # 350| entry->video_pid_len = 1; # 351|-> entry->video_pid[0] = v; # 352| break; # 353| case DTV_AUDIO_PID: Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-file.c:356:61: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(2, 1)’ # 354| entry->audio_pid = calloc(sizeof(*entry->audio_pid), 1); # 355| entry->audio_pid_len = 1; # 356|-> entry->audio_pid[0] = v; # 357| break; # 358| case DTV_SERVICE_ID: Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-file.c:362:30: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 360| break; # 361| case DTV_CH_NAME: # 362|-> entry->channel = calloc(strlen(p) + 1, 1); # 363| strcpy(entry->channel, p); # 364| break; Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-file.c:362:65: warning[-Wanalyzer-null-argument]: use of NULL ‘p’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 360| break; # 361| case DTV_CH_NAME: # 362|-> entry->channel = calloc(strlen(p) + 1, 1); # 363| strcpy(entry->channel, p); # 364| break; Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-file.c:363:41: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘calloc(strlen(p) + 1, 1)’ where non-null expected v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-file.c: scope_hint: In function ‘dvb_parse_format_oneline’ <built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null # 361| case DTV_CH_NAME: # 362| entry->channel = calloc(strlen(p) + 1, 1); # 363|-> strcpy(entry->channel, p); # 364| break; # 365| default: Error: CPPCHECK_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-file.c:725: error[memleakOnRealloc]: Common realloc mistake: 'pid' nulled but not freed upon failure # 723| return 0; # 724| while (p) { # 725|-> pid = realloc(pid, (len + 1) * sizeof (*pid)); # 726| pid[len] = atol(p); # 727| p = strtok(NULL, " \t\n"); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-file.c:854:20: warning[deadcode.DeadStores]: Value stored to 'entry' during its initialization is never read # 852| FILE *fp; # 853| int i; # 854|-> struct dvb_entry *entry = dvb_file->first_entry; # 855| static const char *off = "OFF"; # 856| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-file.c:1186:2: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 1184| entry->other_el_pid_len = other_len; # 1185| # 1186|-> qsort(entry->other_el_pid, entry->other_el_pid_len, # 1187| sizeof(*entry->other_el_pid), sort_other_el_pid); # 1188| } Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-legacy-channel-format.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-sat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-scan.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-scan.c: scope_hint: In function ‘dvb_scan_add_entry_ex’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-scan.c:889:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 887| /* This should never happen */ # 888| dvb_logerr(_("BUG: Couldn't add %d to the scan frequency list."), freq); # 889|-> free(new_entry); # 890| # 891| return NULL; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-vdr-format.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/dvb-zap-format.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c: scope_hint: In function ‘dvb_iconv_to_charset’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c:315:12: warning[-Wanalyzer-malloc-leak]: leak of ‘iconv_open(__builtin_alloca_with_align(strlen(output_charset) + 12, 8), input_charset)’ # 313| # 314| iconv_t cd = iconv_open(out_cs, input_charset); # 315|-> if (cd == (iconv_t)(-1)) { # 316| memcpy(p, src, len); # 317| p[len] = '\0'; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c:343:14: warning[core.uninitialized.ArraySubscript]: Array subscript is undefined # 341| /* Convert charset to UTF-8 using Code table 00 - Latin */ # 342| for (p1 = (unsigned char *)s; p1 < s + len; p1++) # 343|-> for (p2 = en300468_latin_00_to_utf8[*p1].data; # 344| p2 < en300468_latin_00_to_utf8[*p1].data + en300468_latin_00_to_utf8[*p1].len; # 345| p2++) Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c: scope_hint: In function ‘dvb_parse_string’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c:464:38: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’ # 462| emphasis = 0; # 463| else if (*s >= 0x20 && (*s < 0x80 || *s > 0x9f)) { # 464|-> *p++ = *s; # 465| if (emphasis) # 466| *p2++ = *s; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c:466:47: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p2’ # 464| *p++ = *s; # 465| if (emphasis) # 466|-> *p2++ = *s; # 467| } # 468| else if (*s == 0x8a) Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c:469:38: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’ # 467| } # 468| else if (*s == 0x8a) # 469|-> *p++ = '\n'; # 470| } # 471| *p = '\0'; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c:471:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’ # 469| *p++ = '\n'; # 470| } # 471|-> *p = '\0'; # 472| *p2 = '\0'; # 473| len = p - (char *)tmp1; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c:472:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p2’ # 470| } # 471| *p = '\0'; # 472|-> *p2 = '\0'; # 473| len = p - (char *)tmp1; # 474| len2 = p2 - (char *)tmp2; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c:504:37: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘out_code’ # 502| continue; # 503| # 504|-> *out_code++ = code; # 505| if (emphasis) # 506| *out_emph++ = code; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c:506:45: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘out_emph’ # 504| *out_code++ = code; # 505| if (emphasis) # 506|-> *out_emph++ = code; # 507| } # 508| *out_code = 0; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c:508:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘out_code’ # 506| *out_emph++ = code; # 507| } # 508|-> *out_code = 0; # 509| *out_emph = 0; # 510| len = (char *)out_code - (char *)tmp1; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/parse_string.c:509:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘out_emph’ # 507| } # 508| *out_code = 0; # 509|-> *out_emph = 0; # 510| len = (char *)out_code - (char *)tmp1; # 511| len2 = (char *)out_emph - (char *)tmp2; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/tables/atsc_eit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/tables/cat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/tables/eit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/tables/mgt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/tables/mpeg_pes.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/tables/mpeg_pes.c:85:4: warning[deadcode.DeadStores]: Value stored to 'p' is never read # 83| struct ts_t dts; # 84| memcpy(&dts, p, sizeof(dts)); # 85|-> p += sizeof(dts); # 86| bswap16(dts.bitfield); # 87| bswap16(dts.bitfield2); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/tables/nit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/tables/pat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/tables/pmt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/tables/sdt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libdvbv5/tables/vct.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l1/libv4l1.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l1/libv4l1.c:1038:4: warning[deadcode.DeadStores]: Value stored to 'result' is never read # 1036| break; # 1037| } # 1038|-> result = v4l2_ioctl(fd, VIDIOC_S_TUNER, &tun2); # 1039| } # 1040| /* Ignore errors modifying the tuner settings. */ Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l1/log.c:55:14: warning[deadcode.DeadStores]: Value stored to 'ioctl_str' during its initialization is never read # 53| void v4l1_log_ioctl(unsigned long int request, void *arg, int result) # 54| { # 55|-> const char *ioctl_str = "unknown"; # 56| char buf[40]; # 57| Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2/libv4l2.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2/libv4l2.c:1590:4: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 1588| # 1589| if (result >= 0) # 1590|-> v4l2_queue_read_buffer(index, buf.index); # 1591| } # 1592| Error: GCC_ANALYZER_WARNING (CWE-775): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2/v4l2convert.c: scope_hint: In function ‘open’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2/v4l2convert.c:60:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(file, oflag)’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2/v4l2convert.c:28: included_from: Included from here. # 58| /* Some apps open the device read-only, but we need rw rights as the # 59| buffers *MUST* be mapped rw */ # 60|-> oflag = (oflag & ~O_ACCMODE) | O_RDWR; # 61| v4l_device = 1; # 62| } Error: GCC_ANALYZER_WARNING (CWE-775): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2/v4l2convert.c:65:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(file, oflag)’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2/v4l2convert.c:38: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2/v4l2convert.c:76:22: note: in expansion of macro ‘SYS_OPEN’ # 63| # 64| /* original open code */ # 65|-> if (oflag & O_CREAT) { # 66| va_list ap; # 67| mode_t mode; Error: GCC_ANALYZER_WARNING (CWE-685): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2/v4l2convert.c:70:24: warning[-Wanalyzer-va-list-exhausted]: ‘ap’ has no more arguments (0 consumed) # 68| # 69| va_start(ap, oflag); # 70|-> mode = va_arg(ap, PROMOTED_MODE_T); # 71| # 72| fd = SYS_OPEN(file, oflag, mode); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2rds/libv4l2rds.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-909): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2rds/libv4l2rds.c:461: error[uninitStructMember]: Uninitialized struct member: msg.additional # 459| # 460| /* decoding done, store the new message */ # 461|-> priv_state->handle.tmc.tmc_msg = msg; # 462| priv_state->handle.valid_fields |= V4L2_RDS_TMC_SG; # 463| priv_state->handle.valid_fields &= ~V4L2_RDS_TMC_MG; Error: CPPCHECK_WARNING (CWE-909): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2rds/libv4l2rds.c:461: error[uninitStructMember]: Uninitialized struct member: msg.length # 459| # 460| /* decoding done, store the new message */ # 461|-> priv_state->handle.tmc.tmc_msg = msg; # 462| priv_state->handle.valid_fields |= V4L2_RDS_TMC_SG; # 463| priv_state->handle.valid_fields &= ~V4L2_RDS_TMC_MG; Error: CPPCHECK_WARNING (CWE-457): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2rds/libv4l2rds.c:461: error[uninitvar]: Uninitialized variables: msg.length, msg.additional # 459| # 460| /* decoding done, store the new message */ # 461|-> priv_state->handle.tmc.tmc_msg = msg; # 462| priv_state->handle.valid_fields |= V4L2_RDS_TMC_SG; # 463| priv_state->handle.valid_fields &= ~V4L2_RDS_TMC_MG; Error: GCC_ANALYZER_WARNING (CWE-457): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2rds/libv4l2rds.c: scope_hint: In function ‘rds_decode_tmc_single_group’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4l2rds/libv4l2rds.c:461:40: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘msg.length’ # 459| # 460| /* decoding done, store the new message */ # 461|-> priv_state->handle.tmc.tmc_msg = msg; # 462| priv_state->handle.valid_fields |= V4L2_RDS_TMC_SG; # 463| priv_state->handle.valid_fields &= ~V4L2_RDS_TMC_MG; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/bayer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/control/libv4lcontrol.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/cpia1.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-457): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/cpia1.c: scope_hint: In function ‘v4lconvert_cpia1_to_yuv420’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/cpia1.c:139:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*data.previous_frame’ # 137| /* Pre-fill dest with previous frame, as the cpia1 "compression" consists # 138| of simply ommitting certain pixels */ # 139|-> memcpy(dest, data->previous_frame, width * height * 3 / 2); # 140| # 141| for (y = 0; y < height && src_size > 2; y++) { Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/crop.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/helper.c: scope_hint: In function ‘v4lconvert_helper_start’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/helper.c:78:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(*data.decompress_out_pipe[0], 0)’ # 76| # 77| /* Connect stdin / out to the pipes */ # 78|-> if (dup2(data->decompress_out_pipe[READ_END], STDIN_FILENO) == -1) { # 79| perror("libv4lconvert: error with helper dup2"); # 80| exit(1); Error: GCC_ANALYZER_WARNING (CWE-775): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/helper.c:82:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(*data.decompress_in_pipe[1], 1)’ # 80| exit(1); # 81| } # 82|-> if (dup2(data->decompress_in_pipe[WRITE_END], STDOUT_FILENO) == -1) { # 83| perror("libv4lconvert: error with helper dup2"); # 84| exit(1); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/jl2005bcd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/jpeg.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/jpgl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/libv4lconvert.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-758): v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/libv4lconvert.c:475: error[shiftTooManyBits]: Shifting 64-bit value by 64 bits is undefined behaviour # 473| /* is this format supported? */ # 474| if (!(data->framesize_supported_src_formats[best_framesize] & # 475|-> (1ULL << i))) # 476| continue; # 477| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/libv4lconvert.c:1444:3: warning[deadcode.DeadStores]: Value stored to 'src_pix_fmt' is never read # 1442| # 1443| v4lconvert_nv16_to_yuyv(src, tmpbuf, width, height, bytesperline); # 1444|-> src_pix_fmt = V4L2_PIX_FMT_YUYV; # 1445| src = tmpbuf; # 1446| bytesperline = width * 2; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/libv4lconvert.c:1481:3: warning[deadcode.DeadStores]: Value stored to 'src_pix_fmt' is never read # 1479| /* Note NV61 is NV16 with U and V swapped so this becomes yvyu. */ # 1480| v4lconvert_nv16_to_yuyv(src, tmpbuf, width, height, bytesperline); # 1481|-> src_pix_fmt = V4L2_PIX_FMT_YVYU; # 1482| src = tmpbuf; # 1483| bytesperline = width * 2; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/libv4lconvert.c:1747:3: warning[deadcode.DeadStores]: Value stored to 'src_size' is never read # 1745| return res; # 1746| # 1747|-> src_size = my_src_fmt.fmt.pix.sizeimage; # 1748| # 1749| /* We call processing here again in case the source format was not Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/mr97310a.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/nv12_16l16.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/ov511-decomp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/ov511-decomp.c:92:4: warning[deadcode.DeadStores]: Value stored to 'idx' is never read # 90| } # 91| } else { /* 12 bits and has no Zero Table */ # 92|-> idx = 1; # 93| half_byte = 0; # 94| for (i = 1; i < ZigZag_length; i++) { Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/ov511-decomp.c:580:8: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value # 578| int all_zero = 1; # 579| for (j = 0; j < 4; j++) # 580|-> if (in[j]) { # 581| all_zero = 0; # 582| break; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/ov511-decomp.c:606:13: warning[core.UndefinedBinaryOperatorResult]: The left operand of '&' is a garbage value # 604| # 605| /* Compressed ? */ # 606|-> if (src[8] & 0x40) # 607| rc = Decompress420HiNoMMX(src + 9, dest, w, h, src_size); # 608| else Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/ov518-decomp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/pac207.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/processing/autogain.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/processing/whitebalance.c:154:12: warning[core.DivideZero]: Division by zero # 152| # 153| /* Norm avg to ~ 0 - 4095 */ # 154|-> green_avg /= fmt->fmt.pix.width * fmt->fmt.pix.height / 64; # 155| comp1_avg /= fmt->fmt.pix.width * fmt->fmt.pix.height / 64; # 156| comp2_avg /= fmt->fmt.pix.width * fmt->fmt.pix.height / 64; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/processing/whitebalance.c:178:12: warning[core.DivideZero]: Division by zero # 176| # 177| /* Norm avg to ~ 0 - 4095 */ # 178|-> green_avg /= fmt->fmt.pix.width * fmt->fmt.pix.height / 16; # 179| comp1_avg /= fmt->fmt.pix.width * fmt->fmt.pix.height / 16; # 180| comp2_avg /= fmt->fmt.pix.width * fmt->fmt.pix.height / 16; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/rgbyuv.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/sn9c10x.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/sn9c2028-decomp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/sn9c20x.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/spca501.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/spca561-decompress.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/spca561-decompress.c:869:30: warning[core.UndefinedBinaryOperatorResult]: The left operand of '*' is a garbage value due to array index out of bounds # 867| (pixel_U + pixel_L) * 3 - pixel_UL * 2; # 868| tmp1 += (tmp1 < 0) ? 3 : 0; # 869|-> tmp2 = a_curve[19 + gkw] * multiplier; # 870| tmp2 += (tmp2 < 0) ? 1 : 0; # 871| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/spca561-decompress.c:885:17: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 883| } # 884| # 885|-> accum[index] += abs_clamp15[19 + gkw]; # 886| # 887| if (i_hits[index]++ == 15) { Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/sq905c.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/sq905c.c:148:31: warning[core.UndefinedBinaryOperatorResult]: The left operand of '+' is a garbage value # 146| diff = delta_table[delta_left]; # 147| if (!i) # 148|-> tempval = templine_red[0] + diff; # 149| else # 150| tempval = (templine_red[i] + Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/lib/libv4lconvert/tinyjpeg.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/redhat-linux-build/utils/v4l2-tracer/retrace-gen.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/redhat-linux-build/utils/v4l2-tracer/trace-gen.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-compliance.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-compliance.cpp:961:22: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 959| break; # 960| case OptReplyThreshold: # 961|-> reply_threshold = strtoul(optarg, nullptr, 0); # 962| break; # 963| case OptTimeout: Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-compliance.cpp:964:19: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 962| break; # 963| case OptTimeout: # 964|-> long_timeout = strtoul(optarg, nullptr, 0); # 965| break; # 966| case OptColor: Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-compliance.cpp:967:9: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 965| break; # 966| case OptColor: # 967|-> if (!strcmp(optarg, "always")) # 968| show_colors = true; # 969| else if (!strcmp(optarg, "never")) Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-test-adapter.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-test-audio.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-test-fuzzing.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-test-power.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-test-power.cpp:430:20: warning[core.UndefinedBinaryOperatorResult]: The left operand of '!=' is a garbage value # 428| wait_changing_power_status(node, me, la, new_status, unresponsive_cnt)); # 429| fail_on_test_v2_warn(node->remote[la].cec_version, # 430|-> new_status != CEC_OP_POWER_STATUS_STANDBY); # 431| if (new_status != CEC_OP_POWER_STATUS_STANDBY) # 432| return standby_resume_standby(node, me, la, interactive); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-test-tuner-record-timer.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-test.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-685): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-test.cpp:1015: error[wrongPrintfScanfArgNum]: printf format string requires 4 parameters but only 1 is given. # 1013| from = cec_msg_initiator(&msg); # 1014| info("Received CDC HEC State report from device %d (%s):\n", from, cec_la2s(from)); # 1015|-> info("Physical address : %x.%x.%x.%x\n", # 1016| cec_phys_addr_exp(phys_addr)); # 1017| info("Target physical address : %x.%x.%x.%x\n", Error: CPPCHECK_WARNING (CWE-685): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-compliance/cec-test.cpp:1017: error[wrongPrintfScanfArgNum]: printf format string requires 4 parameters but only 1 is given. # 1015| info("Physical address : %x.%x.%x.%x\n", # 1016| cec_phys_addr_exp(phys_addr)); # 1017|-> info("Target physical address : %x.%x.%x.%x\n", # 1018| cec_phys_addr_exp(target_phys_addr)); # 1019| info("HEC Functionality State : %s\n", hec_func_state2s(hec_func_state)); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-ctl/cec-ctl.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-ctl/cec-ctl.cpp:1160:22: warning[deadcode.DeadStores]: Although the value stored to 'event' is used in the enclosing expression, the value is never actually read from 'event' # 1158| continue; # 1159| } # 1160|-> tv_sec = tv_nsec = event = 0; # 1161| while (isdigit(*p)) # 1162| tv_sec = tv_sec * 10 + *p++ - '0'; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-ctl/cec-pin.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-follower/cec-follower.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-follower/cec-follower.cpp:471:26: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 469| break; # 470| case OptTogglePowerStatus: # 471|-> toggle_power_status = strtoul(optarg, nullptr, 0); # 472| break; # 473| case OptIgnoreStandby: Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-follower/cec-follower.cpp:474:26: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 472| break; # 473| case OptIgnoreStandby: # 474|-> node.ignore_standby = strtoul(optarg, nullptr, 0); # 475| break; # 476| case OptIgnoreViewOn: Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-follower/cec-follower.cpp:477:26: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 475| break; # 476| case OptIgnoreViewOn: # 477|-> node.ignore_view_on = strtoul(optarg, nullptr, 0); # 478| break; # 479| case OptIgnore: { Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-follower/cec-follower.cpp:480:19: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 478| break; # 479| case OptIgnore: { # 480|-> bool all_la = !strncmp(optarg, "all", 3); # 481| bool all_opcodes = true; # 482| const char *sep = std::strchr(optarg, ','); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-follower/cec-processing.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-685): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-follower/cec-processing.cpp:347: error[wrongPrintfScanfArgNum]: printf format string requires 4 parameters but only 1 is given. # 345| cec_ops_active_source(&msg, &phys_addr); # 346| node->state.active_source_pa = phys_addr; # 347|-> dev_info("New active source: %x.%x.%x.%x\n", cec_phys_addr_exp(phys_addr)); # 348| return; # 349| } Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cec-follower/cec-tuner.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/codec-fwht.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/codec-fwht.c:638:2: warning[deadcode.DeadStores]: Value stored to 'deltablock' is never read # 636| } # 637| } # 638|-> deltablock -= 64; # 639| vard = var_inter(old, tmp); # 640| return vari <= vard ? IBLOCK : PBLOCK; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/codec-v4l2-fwht.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl.cpp:32: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl.h:21: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/cv4l-helpers.h:507:4: warning[core.uninitialized.Assign]: The expression is an uninitialized value. The computed value will also be garbage # 505| frm.index = index; # 506| } else { # 507|-> frm.index++; # 508| } # 509| return cv4l_ioctl(VIDIOC_ENUM_FRAMESIZES, &frm); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/cv4l-helpers.h:521:4: warning[core.uninitialized.Assign]: The expression is an uninitialized value. The computed value will also be garbage # 519| frm.index = index; # 520| } else { # 521|-> frm.index++; # 522| } # 523| return cv4l_ioctl(VIDIOC_ENUM_FRAMEINTERVALS, &frm); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/ir-encode.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-758): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/ir-encode.c:302: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour # 300| { # 301| while (count--) { # 302|-> if (bits & (1 << count)) { # 303| rc6_advance_pulse(buf, n, length); # 304| rc6_advance_space(buf, n, length); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/keymap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/keymap.c:94:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'map' # 92| fin = fopen(fname, "r"); # 93| if (!fin) { # 94|-> fprintf(stderr, _("%s: error: cannot open: %m\n"), fname); # 95| return EINVAL; # 96| } Error: CPPCHECK_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/keymap.c:95: error[memleak]: Memory leak: map # 93| if (!fin) { # 94| fprintf(stderr, _("%s: error: cannot open: %m\n"), fname); # 95|-> return EINVAL; # 96| } # 97| Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/keymap.c: scope_hint: In function ‘parse_rawir_string’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/keymap.c:214:9: warning[-Wanalyzer-null-argument]: use of NULL ‘copy’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null # 212| # 213| // Second scan to extract values and validate # 214|-> strcpy(copy, str); # 215| p = strtok(copy, sep); # 216| i = 0; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/keymap.c: scope_hint: In function ‘parse_toml_protocol’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/keymap.c:402:37: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘param’ # 400| # 401| param = malloc(sizeof(*param)); # 402|-> param->name = strdup(key); # 403| param->value = value; # 404| param->next = map->param; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/keymap.c:522:2: warning[unix.Malloc]: Potential leak of memory pointed to by 'map' # 520| return 0; # 521| out: # 522|-> toml_free(root); # 523| return EINVAL; # 524| } Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/media-info.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/toml.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-input-output.cpp:27: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-compliance.h:37: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/cv4l-helpers.h:13: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/v4l-helpers.h:1875:29: warning[cplusplus.NewDeleteLeaks]: Potential memory leak # 1873| if (ec->count == 0) # 1874| return 0; # 1875|-> for (i = 0; i < ec->count; i++) { # 1876| struct v4l2_control c = { ec->controls[i].id, 0 }; # 1877| int ret = v4l_ioctl(f, VIDIOC_G_CTRL, &c); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/v4l-stream.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/v4l-stream.c:99:11: warning[core.NullDereference]: Dereference of null pointer # 97| # 98| while (n--) # 99|-> *dst++ = v; # 100| # 101| if (dst == next_line) { Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/v4l-stream.c:103:5: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 101| if (dst == next_line) { # 102| while (l--) { # 103|-> memcpy(dst, dst - bpl / 4, bpl); # 104| dst += bpl / 4; # 105| } Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/v4l2-tpg-core.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/common/v4l2-tpg-core.c:593:6: warning[core.DivideZero]: Division by zero # 591| aux *= third_size / 2; # 592| aux += diff_rgb / 2; # 593|-> aux /= diff_rgb; # 594| aux += third; # 595| Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cx18-ctl/cx18-ctl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/cx18-ctl/cx18-ctl.c:399:3: warning[deadcode.DeadStores]: Value stored to 'gdebug_level' is never read # 397| char *buf; # 398| # 399|-> gdebug_level = 0; # 400| buf = doread("/sys/module/cx18/parameters/debug"); # 401| if (buf) { Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvb-fe-tool.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-479): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvb-fe-tool.c: scope_hint: In function ‘do_timeout.part.0’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvb-fe-tool.c:99:17: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvb-fe-tool.c:99:17: note: ‘_exit’ is a possible signal-safe alternative for ‘exit’ # 97| } else { # 98| /* something has gone wrong ... exit */ # 99|-> exit(1); # 100| } # 101| } Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvb-format-convert.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-daemon.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-664): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-daemon.c:499: error[va_end_missing]: va_list 'ap' was opened but not closed by va_end(). # 497| dbg("buffer to short for string length"); # 498| stack_dump(); # 499|-> return -1; # 500| } # 501| len = be32toh(*(int32_t *)p); Error: GCC_ANALYZER_WARNING (CWE-404): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-daemon.c: scope_hint: In function ‘scan_data’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-daemon.c:499:40: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-daemon.c:515:33: note: in expansion of macro ‘dbg’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-daemon.c:515:33: note: in expansion of macro ‘dbg’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-daemon.c:515:33: note: in expansion of macro ‘dbg’ # 497| dbg("buffer to short for string length"); # 498| stack_dump(); # 499|-> return -1; # 500| } # 501| len = be32toh(*(int32_t *)p); Error: CPPCHECK_WARNING (CWE-664): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-daemon.c:567: error[va_end_missing]: va_list 'ap' was opened but not closed by va_end(). # 565| if (ret <= 0) { # 566| local_perror("vasprintf"); # 567|-> return; # 568| } # 569| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-daemon.c:753:5: warning[deadcode.DeadStores]: Value stored to 'read_ret' is never read # 751| if (read_ret > size) { # 752| dbg("buffer to short to store read data!"); # 753|-> read_ret = -EOVERFLOW; # 754| } else { # 755| memcpy(p, databuf, read_ret); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-scan.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-scan.c:211: warning[uninitvar]: Uninitialized variable: status # 209| } # 210| # 211|-> return (status & FE_HAS_LOCK) ? 0 : -1; # 212| } # 213| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-scan.c:211:17: warning[core.UndefinedBinaryOperatorResult]: The left operand of '&' is a garbage value # 209| } # 210| # 211|-> return (status & FE_HAS_LOCK) ? 0 : -1; # 212| } # 213| Error: GCC_ANALYZER_WARNING (CWE-479): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-scan.c: scope_hint: In function ‘do_timeout.part.0’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-scan.c:444:17: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-scan.c:444:17: note: ‘_exit’ is a possible signal-safe alternative for ‘exit’ # 442| } else { # 443| /* something has gone wrong ... exit */ # 444|-> exit(1); # 445| } # 446| } Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-zap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-zap.c:1139:3: warning[deadcode.DeadStores]: Value stored to 'r' is never read # 1137| if (!homedir) # 1138| ERROR("$HOME not set"); # 1139|-> r = asprintf(&args.confname, "%s/.tzap/%i/%s", # 1140| homedir, args.adapter, CHANNEL_FILE); # 1141| if (access(args.confname, R_OK)) { Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/dvb/dvbv5-zap.c:1143:4: warning[deadcode.DeadStores]: Value stored to 'r' is never read # 1141| if (access(args.confname, R_OK)) { # 1142| free(args.confname); # 1143|-> r = asprintf(&args.confname, "%s/.tzap/%s", # 1144| homedir, CHANNEL_FILE); # 1145| } Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/ir-ctl/ir-ctl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/ir-ctl/ir-ctl.c:256:5: warning[deadcode.DeadStores]: Value stored to 'expect_pulse' is never read # 254| if (!expect_pulse) { # 255| f->buf[len++] = args->gap; # 256|-> expect_pulse = true; # 257| } # 258| Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/ir-ctl/ir-ctl.c: scope_hint: In function ‘add_to_send_list’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/ir-ctl/ir-ctl.c:537:32: warning[-Wanalyzer-malloc-leak]: leak of ‘read_scancode(arg)’ # 535| } # 536| # 537|-> pstr = strndup(name, p - name); # 538| # 539| if (!protocol_match(pstr, &proto)) { Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/ir-ctl/ir-ctl.c:575:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘gap’ # 573| // introduce gap # 574| struct send *gap = malloc(sizeof(*gap)); # 575|-> gap->ty = SEND_GAP; # 576| gap->fname= NULL; # 577| gap->gap = arguments->gap; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/ir-ctl/ir-ctl.c:651:10: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 649| if (end == NULL || end[0] != '-') # 650| argp_error(state, _("cannot parse carrier range `%s'"), arg); # 651|-> high = strtol(end + 1, &end, 10); # 652| if (end[0] != 0 || low <= 0 || low >= high || high > 1000000) # 653| argp_error(state, _("cannot parse carrier range `%s'"), arg); Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/ir-ctl/ir-ctl.c: scope_hint: In function ‘convert_keycode’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/ir-ctl/ir-ctl.c:764:39: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘s’ # 762| s->len = re->raw_length; # 763| memcpy(s->buf, re->raw, s->len * sizeof(int)); # 764|-> s->ty = SEND_RAW; # 765| s->carrier = keymap_param(map, "carrier", 0); # 766| s->next = NULL; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/ir-ctl/ir-ctl.c:789:39: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘s’ # 787| s->protocol = proto; # 788| s->scancode = se->scancode; # 789|-> s->ty = SEND_SCANCODE; # 790| s->next = NULL; # 791| } else if (encode_bpf_protocol(map, se->scancode, Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/ir-ctl/ir-ctl.c:796:39: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘s’ # 794| s->len = length; # 795| memcpy(s->buf, buf, length * sizeof(int)); # 796|-> s->ty = SEND_RAW; # 797| s->carrier = keymap_param(map, "carrier", 0); # 798| s->next = NULL; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/ivtv-ctl/ivtv-ctl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/ivtv-ctl/ivtv-ctl.c:471:3: warning[deadcode.DeadStores]: Value stored to 'gdebug_level' is never read # 469| char *buf = doread("/sys/module/ivtv/parameters/debug"); # 470| # 471|-> gdebug_level = 0; # 472| if (buf) { # 473| gdebug_level = atol(buf); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:398:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'b' # 396| } # 397| # 398|-> for (se = map->scancode; se; se = se->next) { # 399| int value; # 400| char *p; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:777:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'cur_name' # 775| dir = opendir(dname); # 776| if (!dir) { # 777|-> perror(dname); # 778| return NULL; # 779| } Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c: scope_hint: In function ‘seek_sysfs_dir’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:777:17: warning[-Wanalyzer-malloc-leak]: leak of ‘names’ # 775| dir = opendir(dname); # 776| if (!dir) { # 777|-> perror(dname); # 778| return NULL; # 779| } Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:783:40: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cur_name’ # 781| while (entry) { # 782| if (!node_name || !strncmp(entry->d_name, node_name, strlen(node_name))) { # 783|-> cur_name->name = malloc(strlen(dname) + strlen(entry->d_name) + 2); # 784| if (!cur_name->name) # 785| goto err; Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c: scope_hint: In function ‘free_uevent’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:825:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/include/gettext.h:24: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:45: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:869:41: note: in expansion of macro ‘_’ # 823| if (old->value) # 824| free(old->value); # 825|-> free(old); # 826| } while (uevent); # 827| } Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c: scope_hint: In function ‘read_sysfs_uevents’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:839:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘file’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null # 837| # 838| file = malloc(strlen(dname) + strlen(event) + 1); # 839|-> strcpy(file, dname); # 840| strcat(file, event); # 841| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:848:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'next' # 846| fp = fopen(file, "r"); # 847| if (!fp) { # 848|-> perror(file); # 849| free(file); # 850| return NULL; Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:856:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘next’ # 854| if (!p) # 855| continue; # 856|-> next->key = malloc(strlen(p) + 1); # 857| if (!next->key) { # 858| perror("next->key"); Error: GCC_ANALYZER_WARNING (CWE-688): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c: scope_hint: In function ‘find_device’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:936:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘n’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null # 934| # 935| n = malloc(strlen(name) + 2); # 936|-> strcpy(n, name); # 937| strcat(n,"/"); # 938| for (cur = names; cur->next; cur = cur->next) { Error: GCC_ANALYZER_WARNING (CWE-476): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:954:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tmp’ # 952| } # 953| tmp = calloc(sizeof(*names), 1); # 954|-> tmp->name = cur->name; # 955| cur->name = NULL; # 956| free_names(names); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:990:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'b' # 988| } # 989| # 990|-> return protocols; # 991| } # 992| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:1234:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'uevent' # 1232| free_names(lirc_names); # 1233| if (uevent) { # 1234|-> while (uevent->next) { # 1235| if (!strcmp(uevent->key, "DEVNAME")) { # 1236| rc_dev->lirc_name = malloc(strlen(uevent->value) + strlen(DEV) + 1); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:1278:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'uevent' # 1276| return EINVAL; # 1277| # 1278|-> while (uevent->next) { # 1279| if (!strcmp(uevent->key, "DEVNAME")) { # 1280| rc_dev->input_name = malloc(strlen(uevent->value) + strlen(DEV) + 1); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:1297:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'uevent' # 1295| if (!uevent) # 1296| return EINVAL; # 1297|-> while (uevent->next) { # 1298| if (!strcmp(uevent->key, "DRV_NAME")) { # 1299| rc_dev->drv_name = malloc(strlen(uevent->value) + 1); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:2152:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'rc_dev.dev_name' # 2150| fd = open(rc_dev.input_name, O_RDONLY | O_NONBLOCK); # 2151| if (fd < 0) { # 2152|-> perror(rc_dev.input_name); # 2153| return -1; # 2154| } Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:2152:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'rc_dev.keytable_name' # 2150| fd = open(rc_dev.input_name, O_RDONLY | O_NONBLOCK); # 2151| if (fd < 0) { # 2152|-> perror(rc_dev.input_name); # 2153| return -1; # 2154| } Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:2153:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'rc_dev.input_name' # 2151| if (fd < 0) { # 2152| perror(rc_dev.input_name); # 2153|-> return -1; # 2154| } # 2155| if (dev_from_class) Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:2225:3: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 2223| if (period >= 0) # 2224| new_period = period; # 2225|-> set_rate(fd, new_delay, new_period); # 2226| } # 2227| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/keytable/keytable.c:2225:3: warning[core.CallAndMessage]: 3rd function call argument is an uninitialized value # 2223| if (period >= 0) # 2224| new_period = period; # 2225|-> set_rate(fd, new_delay, new_period); # 2226| } # 2227| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/libcecutil/cec-log.cpp:12: included_from: Included from here. v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/libcecutil/cec-htng-funcs.h:863:3: warning[deadcode.DeadStores]: Value stored to 'offset' is never read # 861| *htng_symbol_rate == CEC_OP_HTNG_SYMBOL_RATE_MANUAL) { # 862| *symbol_rate = (msg->msg[offset] << 8) | msg->msg[offset + 1]; # 863|-> offset += 2; # 864| } else { # 865| *symbol_rate = 0; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/libcecutil/cec-info.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/libcecutil/cec-parse.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/libmedia_dev/get_media_devices.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/libmedia_dev/get_media_devices.c: scope_hint: In function ‘get_bus’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/libmedia_dev/get_media_devices.c:108:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&file, "r")’ # 106| if (!f) # 107| return MEDIA_BUS_UNKNOWN; # 108|-> if (!fgets(s, sizeof(s), f)) # 109| return MEDIA_BUS_UNKNOWN; # 110| fclose(f); Error: GCC_ANALYZER_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/libmedia_dev/get_media_devices.c:108:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&file, "r")’ # 106| if (!f) # 107| return MEDIA_BUS_UNKNOWN; # 108|-> if (!fgets(s, sizeof(s), f)) # 109| return MEDIA_BUS_UNKNOWN; # 110| fclose(f); Error: CPPCHECK_WARNING (CWE-404): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/libmedia_dev/get_media_devices.c:109: error[resourceLeak]: Resource leak: f # 107| return MEDIA_BUS_UNKNOWN; # 108| if (!fgets(s, sizeof(s), f)) # 109|-> return MEDIA_BUS_UNKNOWN; # 110| fclose(f); # 111| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/libmedia_dev/get_media_devices.c:328:8: warning[core.NullDereference]: Access to field 'node' results in a dereference of a null pointer (loaded from variable 'md_ptr') # 326| int i; # 327| for (i = 0; i < md->md_size; i++) { # 328|-> free(md_ptr->node); # 329| free(md_ptr->device); # 330| md_ptr++; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/libv4l2util/v4l2_driver.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/libv4l2util/v4l2_driver.c:175:24: warning[deadcode.DeadStores]: Value stored to 'tc' during its initialization is never read # 173| static void prt_buf_info(char *name,struct v4l2_buffer *p) # 174| { # 175|-> struct v4l2_timecode *tc=&p->timecode; # 176| # 177| printf ("%s: %02ld:%02d:%02d.%08ld index=%d, type=%s, " Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/libv4l2util/v4l2_driver.c:419:4: warning[deadcode.DeadStores]: Value stored to 'ret' is never read # 417| ret=xioctl(drv->fd,VIDIOC_S_INPUT,input); # 418| if (ret<0) { # 419|-> ret=errno; # 420| sprintf (s,"while trying to set INPUT to %d\n", inp); # 421| perror(s); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/media-ctl/libmediactl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-457): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/media-ctl/libmediactl.c: scope_hint: In function ‘media_setup_link’ v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/media-ctl/libmediactl.c:248:36: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘link’ # 246| ulink.sink.flags = MEDIA_PAD_FL_SINK; # 247| # 248|-> ulink.flags = flags | (link->flags & MEDIA_LNK_FL_IMMUTABLE); # 249| # 250| ret = ioctl(media->fd, MEDIA_IOC_SETUP_LINK, &ulink); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/media-ctl/libmediactl.c:377:19: warning[unix.Malloc]: Use of memory after it is freed # 375| backlink->flags = link->flags; # 376| # 377|-> fwdlink->twin = backlink; # 378| backlink->twin = fwdlink; # 379| } Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/media-ctl/libmediactl.c:514:15: warning[deadcode.DeadStores]: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret' # 512| media_dbg(media, "Can't get udev context\n"); # 513| # 514|-> for (id = 0, ret = 0; ; id = entity->info.id) { # 515| size = (media->entities_count + 1) * sizeof(*media->entities); # 516| media->entities = realloc(media->entities, size); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/media-ctl/libmediactl.c:850:9: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 848| entity = media_parse_entity(media, p, &end); # 849| if (!entity) { # 850|-> *endp = end; # 851| return NULL; # 852| } Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/media-ctl/libv4l2subdev.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/media-ctl/media-ctl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/qv4l2/alsa_stream.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/qv4l2/alsa_stream.c:553:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'buffer' # 551| } # 552| # 553|-> snd_pcm_drop(chandle); # 554| snd_pcm_drop(phandle); # 555| Error: CPPCHECK_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/qv4l2/alsa_stream.c:635: error[memleak]: Memory leak: inputs.cdevice # 633| alsa_is_running = 1; # 634| # 635|-> return ret; # 636| } # 637| Error: CPPCHECK_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/qv4l2/alsa_stream.c:635: error[memleak]: Memory leak: inputs.pdevice # 633| alsa_is_running = 1; # 634| # 635|-> return ret; # 636| } # 637| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/qv4l2/ctrl-tab.cpp:569:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'c..string' # 567| ctrls.controls = &c; # 568| if (s_ext_ctrls(ctrls)) { # 569|-> errorCtrl(id, errno, c.value); # 570| } # 571| else if (m_ctrlMap[id].flags & V4L2_CTRL_FLAG_UPDATE) Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/qv4l2/raw2sliced.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/qv4l2/tpg-tab.cpp:222:3: warning[deadcode.DeadStores]: Value stored to 'm_winWidth' is never read # 220| } # 221| if (totalw > m_winWidth) # 222|-> m_winWidth = totalw; # 223| else { # 224| diff = m_winWidth - totalw; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/qvidcap/paint.cpp:310:3: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value # 308| glEndQuery(GL_TIME_ELAPSED); # 309| GLuint t; # 310|-> glGetQueryObjectuiv(query, GL_QUERY_RESULT, &t); # 311| glDeleteQueries(1, &query); # 312| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/qvidcap/qvidcap.cpp:484:12: warning[cplusplus.NewDeleteLeaks]: Potential leak of memory pointed to by 'sa' # 482| if (isOptArg(args[i], "--device", "-d")) { # 483| if (!processOption(args, i, video_device)) # 484|-> return 0; # 485| mode = AppModeV4L2; # 486| } else if (isOptArg(args[i], "--file", "-f")) { Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/rds-ctl/rds-ctl.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-compliance.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-compliance.cpp:896:6: warning[core.NullDereference]: Array access (from variable 'device') results in a null pointer dereference # 894| const std::string &media_bus_info, bool is_media = false) # 895| { # 896|-> if (device[0] >= '0' && device[0] <= '9' && strlen(device) <= 3) { # 897| char newdev[32]; # 898| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-compliance.cpp:1702:43: warning[cplusplus.StringChecker]: The parameter must not be null # 1700| case OptSetMediaDevice: # 1701| case OptSetMediaDeviceOnly: # 1702|-> device = make_devname(optarg, "media", optarg, true); # 1703| type = MEDIA_TYPE_MEDIA; # 1704| break; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-compliance.cpp:1717:18: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 1715| case OptStreamFrom: # 1716| case OptStreamFromHdr: { # 1717|-> char *equal = std::strchr(optarg, '='); # 1718| bool has_hdr = ch == OptStreamFromHdr; # 1719| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-compliance.cpp:1738:11: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'subs') # 1736| case OptStreamAllColorTest: # 1737| subs = optarg; # 1738|-> while (*subs != '\0') { # 1739| static constexpr const char *subopts[] = { # 1740| "color", Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-compliance.cpp:1776:9: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 1774| break; # 1775| case OptColor: # 1776|-> if (!strcmp(optarg, "always")) # 1777| show_colors = true; # 1778| else if (!strcmp(optarg, "never")) Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-buffers.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-codecs.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-colors.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-colors.cpp:494:3: warning[unix.Malloc]: Potential memory leak # 492| buf.init(q); # 493| fail_on_test(q.reqbufs(node, 3)); # 494|-> fail_on_test(q.obtain_bufs(node)); # 495| fail_on_test(q.queue_all(node)); # 496| fail_on_test(node->streamon()); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-colors.cpp:572:3: warning[unix.Malloc]: Potential memory leak # 570| } # 571| if (node->g_caps() & V4L2_CAP_STREAMING) # 572|-> q.free(node); # 573| else # 574| free(planes[0]); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-colors.cpp:578:23: warning[core.DivideZero]: Division by zero # 576| if (color_cnt[component] < total * perc / 100) { # 577| return fail("red: %u%% green: %u%% blue: %u%% expected: %s >= %u%%\n", # 578|-> color_cnt[0] * 100 / total, # 579| color_cnt[1] * 100 / total, # 580| color_cnt[2] * 100 / total, Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-colors.cpp:578:23: warning[core.UndefinedBinaryOperatorResult]: The result of the '/' expression is undefined # 576| if (color_cnt[component] < total * perc / 100) { # 577| return fail("red: %u%% green: %u%% blue: %u%% expected: %s >= %u%%\n", # 578|-> color_cnt[0] * 100 / total, # 579| color_cnt[1] * 100 / total, # 580| color_cnt[2] * 100 / total, Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-controls.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-controls.cpp:928: error[memleak]: Memory leak: ctrl.string # 926| } # 927| if (ret) # 928|-> return fail("g_ext_ctrls returned an error (%d)\n", ret); # 929| if (checkExtendedCtrl(ctrl, qctrl)) # 930| return fail("invalid control %08x\n", qctrl.id); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-controls.cpp:928:12: warning[cplusplus.NewDeleteLeaks]: Potential leak of memory pointed to by 'ctrl..string' # 926| } # 927| if (ret) # 928|-> return fail("g_ext_ctrls returned an error (%d)\n", ret); # 929| if (checkExtendedCtrl(ctrl, qctrl)) # 930| return fail("invalid control %08x\n", qctrl.id); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-controls.cpp:972:11: warning[cplusplus.NewDeleteLeaks]: Potential leak of memory pointed to by 'ctrl..string' # 970| ctrl.id == VIVID_CID_AREA) && # 971| checkVividControls(node, ctrl, ctrls, qctrl)) # 972|-> return fail("vivid control tests failed\n"); # 973| if (is_vivid && ctrl.id == VIVID_CID_U32_DYN_ARRAY && # 974| checkVividDynArray(node, ctrl, qctrl)) Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-debug.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-formats.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-input-output.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-401): v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-input-output.cpp:482: error[memleak]: Memory leak: ctrl.p_u8 # 480| ctrls.count = 1; # 481| ctrls.controls = &ctrl; # 482|-> fail_on_test(node->g_ext_ctrls(ctrls)); # 483| for (unsigned i = 0; i < qextctrl.elems; i++) { # 484| fail_on_test(ctrl.p_u8[i] != qextctrl.default_value); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-input-output.cpp:482:2: warning[cplusplus.NewDeleteLeaks]: Potential leak of memory pointed to by 'ctrl..p_u8' # 480| ctrls.count = 1; # 481| ctrls.controls = &ctrl; # 482|-> fail_on_test(node->g_ext_ctrls(ctrls)); # 483| for (unsigned i = 0; i < qextctrl.elems; i++) { # 484| fail_on_test(ctrl.p_u8[i] != qextctrl.default_value); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-io-config.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-media.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-subdevs.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-compliance/v4l2-test-time32-64.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-common.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-edid.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-io.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-meta.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-misc.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-modes.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-modes.cpp:229:3: warning[deadcode.DeadStores]: Value stored to 'v_blank' is never read # 227| h_blank -= h_blank % (2 * CVT_CELL_GRAN); # 228| # 229|-> v_blank = v_sync_bp + CVT_MIN_V_PORCH_RND; # 230| # 231| total_h_pixel = active_h_pixel + h_blank; Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-overlay.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-overlay.cpp:112:3: warning[deadcode.DeadStores]: Value stored to 'fb_fd' is never read # 110| } # 111| close(fb_fd); # 112|-> fb_fd = -1; # 113| } # 114| printf("No matching framebuffer found for base address %p\n", fbuf.base); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-overlay.cpp:468:6: warning[unix.Malloc]: Potential leak of memory pointed to by 'fmt.fmt.win.bitmap' # 466| } # 467| # 468|-> if (options[OptSetFBuf]) { # 469| struct v4l2_framebuffer fb; # 470| Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-sdr.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-selection.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-selection.cpp:176:12: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 174| case 1: # 175| vsel.flags = parse_selection_flags(value); # 176|-> set_sel |= SelectionFlags; # 177| break; # 178| case 2: Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-selection.cpp:180:12: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 178| case 2: # 179| vsel.r.left = strtol(value, nullptr, 0); # 180|-> set_sel |= SelectionLeft; # 181| break; # 182| case 3: Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-selection.cpp:184:12: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 182| case 3: # 183| vsel.r.top = strtol(value, nullptr, 0); # 184|-> set_sel |= SelectionTop; # 185| break; # 186| case 4: Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-selection.cpp:188:12: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 186| case 4: # 187| vsel.r.width = strtoul(value, nullptr, 0); # 188|-> set_sel |= SelectionWidth; # 189| break; # 190| case 5: Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-selection.cpp:192:12: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 190| case 5: # 191| vsel.r.height = strtoul(value, nullptr, 0); # 192|-> set_sel |= SelectionHeight; # 193| break; # 194| default: Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-selection.cpp:251:19: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 249| std::exit(EXIT_FAILURE); # 250| } # 251|-> get_sel_target = gsel.target; # 252| break; # 253| } Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-stds.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-streaming.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-streaming.cpp:1127:5: warning[cplusplus.NewDeleteLeaks]: Potential leak of memory pointed to by 'read_buf' # 1125| # 1126| if (size > q.g_length(j)) { # 1127|-> fprintf(stderr, "plane size is too large (%u > %u)\n", # 1128| size, q.g_length(j)); # 1129| return false; Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-streaming.cpp:1548:54: warning[core.DivideZero]: Division by zero # 1546| stderr_info(", dropped buffers: %u", dropped); # 1547| if (host_fd_to >= 0) # 1548|-> stderr_info(" %d%% compression", 100 - comp_perc / comp_perc_count); # 1549| comp_perc_count = comp_perc = 0; # 1550| stderr_info("\n"); Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-subdev.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-tuner.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-vbi.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl-vidout.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl.cpp:943:14: warning[core.NullDereference]: Array access (from variable 'e') results in a null pointer dereference # 941| # 942| *name = "0"; # 943|-> if (isdigit(e[0])) { # 944| event = strtoul(e, nullptr, 0); # 945| if (event == V4L2_EVENT_CTRL) { Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl.cpp:1046:6: warning[core.NullDereference]: Array access (from variable 'device') results in a null pointer dereference # 1044| const std::string &media_bus_info) # 1045| { # 1046|-> if (device[0] >= '0' && device[0] <= '9' && strlen(device) <= 3) { # 1047| static char newdev[32]; # 1048| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-ctl/v4l2-ctl.cpp:1261:11: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 1259| break; # 1260| case OptSleep: # 1261|-> secs = strtoul(optarg, nullptr, 0); # 1262| break; # 1263| case OptVersion: Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-dbg/v4l2-dbg.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-dbg/v4l2-dbg.cpp:394:8: warning[core.NullDereference]: Array access (from variable 'device') results in a null pointer dereference # 392| case OptSetDevice: # 393| device = optarg; # 394|-> if (device[0] >= '0' && device[0] <= '9' && strlen(device) <= 3) { # 395| static char newdev[20]; # 396| Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-dbg/v4l2-dbg.cpp:403:9: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 401| # 402| case OptChip: # 403|-> if (!memcmp(optarg, "subdev", 6) && isdigit(optarg[6])) { # 404| match.type = V4L2_CHIP_MATCH_SUBDEV; # 405| match.addr = strtoul(optarg + 6, nullptr, 0); Error: CLANG_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-dbg/v4l2-dbg.cpp:426:19: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 424| # 425| case OptSetStride: # 426|-> forcedstride = strtoull(optarg, nullptr, 0); # 427| break; # 428| Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-tracer/libv4l2tracer.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-tracer/retrace-helper.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-tracer/retrace.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-tracer/trace.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-tracer/v4l2-tracer-common.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: v4l-utils-1.26.1-build/v4l-utils-1.26.1/utils/v4l2-tracer/v4l2-tracer.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.