Project

General

Profile

Actions

Bug #13804

open

ipsecutils: 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:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with gcc compilers:

    ipseckey.c: In function 'doaddresses':
    ipseckey.c:1205: error: 'sin6' may be used uninitialized in this function [-Wuninitialized]
    ipseckey.c:1561: error: 'on_errno_msg' may be used uninitialized in this function [-Wuninitialized]
    ipseckey.c: In function 'doaddup':
    ipseckey.c:1663: error: 'sadb_msg_type' may be used uninitialized in this function [-Wuninitialized]
    ipseckey.c:1664: error: 'thiscmd' may be used uninitialized in this function [-Wuninitialized]
    ipseckey.c: In function 'dodelget':
    ipseckey.c:2980: error: 'thiscmd' may be used uninitialized in this function [-Wuninitialized]
    ipseckey.c:2982: error: 'sadb_msg_type' may be used uninitialized in this function [-Wuninitialized]
    ipseckey.c:2979: error: 'sa_len' may be used uninitialized in this function [-Wuninitialized]
    ipseckey.c:2981: error: 'spi' may be used uninitialized in this function [-Wuninitialized]
    ipseckey.c: In function 'main':
    ipseckey.c:3580: error: 'savefile' may be used uninitialized in this function [-Wuninitialized]
    *** Error code 1
    dmake: Warning: Command failed for target `ipseckey'

    ikeadm.c: In function 'do_getvar':
    ikeadm.c:2482:2: error: 'varname' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      (void) printf(gettext("Current %s level is 0x%x"),
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          varname, dreq->dbg_level);
          ~~~~~~~~~~~~~~~~~~~~~~~~~
    ikeadm.c: In function 'do_setvar':
    ikeadm.c:2610:2: error: 'varname' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      (void) printf(
      ^~~~~~~~~~~~~~
          gettext("Successfully changed %s level from 0x%x to 0x%x\n"),
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          varname, dreq->dbg_level, reqlevel);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ikeadm.c: In function 'do_dump':
    ikeadm.c:2754:2: error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      (void) printf(gettext("\nCompleted dump of %s\n"), name);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ikeadm.c: In function 'do_getdel':
    ikeadm.c:2943:3: error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       bail_msg(gettext("invalid %s identification\n"), name);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ikeadm.c: In function 'do_rw':
    ikeadm.c:3252:4: error: 'fd' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        (void) close(fd);
        ^~~~~~~~~~~~~~~~
    ikeadm.c:3263:2: error: 'op' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      message(gettext("Completed %s of %s configuration information."),
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          op, obj);
          ~~~~~~~~
    In file included from ikeadm.c:35:0:
    ikeadm.c: In function 'parse_ps':
    /code/illumos-gate/proto/root_i386/usr/include/sys/sysmacros.h:268:33: error: 'remidlen' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     #define P2ROUNDUP(x, align)  (-(-(x) & -(align)))
                                     ^
    ikeadm.c:1039:27: note: 'remidlen' was declared here
      uint_t  c = 0, locidlen, remidlen, keylen, keybits;
                               ^~~~~~~~
    ikeadm.c:1165:47: error: 'locidlen' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       psp->ps_localid_len = sizeof (sadb_ident_t) + locidlen;
                             ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
    ikeadm.c: In function 'do_new':
    ikeadm.c:3148:6: error: 'buflen' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      rtn = ikedoor_call((char *)newp, buflen, descp, ndesc);
      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ikeadm.c:3151:3: error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       ikeadm_err_msg(&rtn->svc_err,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           gettext("error creating new %s"), name);
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    ipsecalgs.c: In function 'synch_emit_proto':
    ipsecalgs.c:77:24: error: 'exec_mode_spdval' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       (ap)->spd_attr_value = (value);   \
                            ^
    ipsecalgs.c:215:11: note: 'exec_mode_spdval' was declared here
      uint32_t exec_mode_spdval;
               ^~~~~~~~~~~~~~~~
    ipsecalgs.c: In function 'list_kernel_algs':
    ipsecalgs.c:503:7: error: 'nparams' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        if (cur_block >= nparams) {
           ^
    ipsecalgs.c:486:21: error: 'cur_block' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        alg.a_block_sizes[cur_block++] = attr->spd_attr_value;
                         ^
    ipsecalgs.c:465:19: error: 'cur_key' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        alg.a_key_sizes[cur_key++] = attr->spd_attr_value;
                       ^
    cc1: all warnings being treated as errors

    ipsecconf.c: In function 'main':
    ipsecconf.c:66:20: error: 'smf_managed' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     #define USAGE() if (!smf_managed) usage()
                        ^
    ipsecconf.c:1339:12: note: 'smf_managed' was declared here
      boolean_t smf_managed;
                ^~~~~~~~~~~
    ipsecconf.c:1528:7: error: 'index' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       ret = ipsec_conf_del(index, B_FALSE);
       ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    ipsecconf.c: In function 'form_ipsec_conf':
    ipsecconf.c:4708:21: error: 'type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        if (type > 65536 || type < 0) {
            ~~~~~~~~~~~~~^~~~~~~~~~~
    cc1: all warnings being treated as errors
    *** Error code 1
    dmake: Fatal error: Command failed for target `ipsecconf'
    Current working directory /code/illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils

Testing done: build/install/boot

Actions #1

Updated by Toomas Soome about 1 year ago

  • Description updated (diff)
Actions #2

Updated by Electric Monk about 1 year ago

  • Gerrit CR set to 1489
Actions

Also available in: Atom PDF