Project

General

Profile

Actions

Bug #13800

open

snoop: variable may be used uninitialized

Added by Toomas Soome about 1 year ago. Updated about 1 year ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with different gcc versions:

    snoop_tftp.c: In function 'interpret_tftp':
    snoop_tftp.c:168:17: error: 'tt' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      168 |     tt->blksize = opts.blksize;
          |     ~~~~~~~~~~~~^~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    snoop_socks.c: In function 'interpret_socks_call':
    snoop_socks.c:224:14: error: 'cmd' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      224 |       (void) sprintf(get_line(0, 0),
          |              ^~~~~~~~~~~~~~~~~~~~~~~
      225 |           "Operation = %s ", cmd);
          |           ~~~~~~~~~~~~~~~~~~~~~~~
    snoop_socks.c:121:13: error: 'cmd' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      121 |      (void) sprintf(cp, "SOCKS5 %s ", cmd);
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    snoop_slp.c: In function 'v2_finish':
    snoop_slp.c:923:3: error: 'op_class' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      923 |   sprintf(get_line(0, 0), "Option ID = 0x%04x, %s",
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      924 |    op_id, op_class);
          |    ~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    snoop_pf.c: In function 'pf_ipaddr_match':
    snoop_pf.c:779:6: error: 'addr6offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
          pf_compare_value_v6(addr6offset, 16,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              *addr6ptr);
              ~~~~~~~~~~
    snoop_pf.c:742:6: error: 'addr4offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
          pf_compare_value(addr4offset, 4,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              addr4);
              ~~~~~~
    cc1: all warnings being treated as errors

    snoop_mip.c: In function 'interpret_extensions':
    snoop_mip.c:244:41: error: 'gen_exthdr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      244 |   st = get_desc(genauth_desc, gen_exthdr->subtype,
          |                               ~~~~~~~~~~^~~~~~~~~
    snoop_mip.c: In function 'interpret_mip_cntrlmsg':
    snoop_mip.c:628:13: error: 'regext_data' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      628 |   fraglen = interpret_extensions(regext_data, regext_size, REG);
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    snoop_mip.c:628:13: error: 'regext_size' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    snoop_mip.c:507:11: error: 'pt' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      507 |    (void) sprintf(get_line((char *)&rreq -
          |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      508 |        dlc_header, 1), "Registration header type = %s",
          |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      509 |        pt);
          |        ~~~
    cc1: all warnings being treated as errors

    snoop_ipaddr.c: In function 'load_names':
    snoop_ipaddr.c:358:10: error: 'naddr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      358 |   (void) addhost(family, naddr, name, NULL);
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    snoop_ipaddr.c:358:10: error: 'family' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    cc1: all warnings being treated as errors

    snoop_filter.c: In function 'ipaddr_match':
    snoop_filter.c:1706:6: error: 'addr6offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
          compare_addr_v6(addr6offset, 16,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              *addr6ptr);
              ~~~~~~~~~~
    snoop_filter.c:1663:6: error: 'addr4offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
          compare_addr_v4(addr4offset, 4, addr4);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    snoop_filter.c: In function 'want_packet':
    snoop_filter.c:737:9: error: 'olen' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         len = olen;
         ~~~~^~~~~~
    snoop_filter.c: In function 'etheraddr_match':
    snoop_filter.c:1881:29: error: 'from_offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       compare_value(from_offset + 4, 2, ntohs(*addrp));
                     ~~~~~~~~~~~~^~~
    snoop_filter.c:1874:3: error: 'to_offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       compare_value(to_offset, 4, ntohl(addr));
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    snoop_dns.c: In function 'print_ip':
    snoop_dns.c:765:2: error: 'addr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      (void) inet_ntop(af, addr, line, INET6_ADDRSTRLEN);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    snoop_ether.c: In function 'interpret_ether':
    snoop_ether.c:237:49: error: 'ieeestart' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      237 |         "size=%d bytes", ieeestart[0], ieeestart[1],
          |                                        ~~~~~~~~~^~~
    cc1: all warnings being treated as errors

    snoop_sctp.c: In function 'interpret_chunks':
    snoop_sctp.c:1045:4: error: 'desc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        (void) snprintf(get_line(0, 0), get_line_remain(),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            "------- SCTP Chunk Type = %s (%u%s)", desc,
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            cp->sch_id, actstr);
            ~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    *** Error code 1
    dmake: Fatal error: Command failed for target `snoop_sctp.o'
    Current working directory /code/illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/snoop

Actions #1

Updated by Electric Monk about 1 year ago

  • Gerrit CR set to 1484
Actions

Also available in: Atom PDF