Project

General

Profile

Bug #12456

ipsec: variable may be used uninitialized

Added by Toomas Soome about 2 months ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with gcc 9:

    ../../common/inet/ip/sadb.c: In function 'sadb_sa2msg':
    ../../common/inet/ip/sadb.c:1074:26: error: 'paddrsize' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1074 |  int alloclen, addrsize, paddrsize, authsize, encrsize;
          |                          ^~~~~~~~~
    In file included from ../../common/inet/ip/sadb.c:49:
    ../../common/net/pfkeyv2.h:855:28: error: 'dstidsize' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      855 | #define SADB_8TO64(x) ((x) >> 3)
          |                            ^~
    ../../common/inet/ip/sadb.c:1075:17: note: 'dstidsize' was declared here
     1075 |  int srcidsize, dstidsize, senslen, osenslen;
          |                 ^~~~~~~~~
    In file included from ../../common/inet/ip/sadb.c:49:
    ../../common/net/pfkeyv2.h:855:28: error: 'srcidsize' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      855 | #define SADB_8TO64(x) ((x) >> 3)
          |                            ^~
    ../../common/inet/ip/sadb.c:1075:6: note: 'srcidsize' was declared here
     1075 |  int srcidsize, dstidsize, senslen, osenslen;
          |      ^~~~~~~~~
    ../../common/inet/ip/sadb.c:1450:3: error: 'osenslen' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1450 |   sadb_sens_from_label(sens, SADB_X_EXT_OUTER_SENS,
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1451 |       ipsa->ipsa_otsl, osenslen);
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ip/sadb.c:1440:3: error: 'senslen' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1440 |   sadb_sens_from_label(sens, SADB_EXT_SENSITIVITY,
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1441 |       ipsa->ipsa_tsl, senslen);
          |       ~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from ../../common/inet/ip/sadb.c:49:
    ../../common/net/pfkeyv2.h:855:28: error: 'encrsize' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      855 | #define SADB_8TO64(x) ((x) >> 3)
          |                            ^~
    ../../common/inet/ip/sadb.c:1074:47: note: 'encrsize' was declared here
     1074 |  int alloclen, addrsize, paddrsize, authsize, encrsize;
          |                                               ^~~~~~~~
    In file included from ../../common/inet/ip/sadb.c:49:
    ../../common/net/pfkeyv2.h:855:28: error: 'authsize' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      855 | #define SADB_8TO64(x) ((x) >> 3)
          |                            ^~
    ../../common/inet/ip/sadb.c:1074:37: note: 'authsize' was declared here
     1074 |  int alloclen, addrsize, paddrsize, authsize, encrsize;
          |                                     ^~~~~~~~
    ../../common/inet/ip/sadb.c:1352:9: error: 'pfam' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1352 |   cur = sadb_make_addr_ext(cur, end, SADB_X_EXT_ADDRESS_INNER_SRC,
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1353 |       pfam, ipsa->ipsa_innersrc, SA_SRCPORT(ipsa),
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1354 |       SA_IPROTO(ipsa), ipsa->ipsa_innersrcpfx);
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ip/sadb.c:1464:29: error: 'otherspi' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1464 |   pair_ext->sadb_x_pair_spi = otherspi;
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
    ../../common/inet/ip/sadb.c: In function 'sadb_addrcheck':
    ../../common/inet/ip/sadb.c:1838:33: error: 'diagnostic' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1838 |    samsg->sadb_x_msg_diagnostic = diagnostic;
          |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~

    ../../common/inet/ip/ipsecesp.c: In function 'esp_submit_req_inbound':
    ../../common/inet/ip/ipsecesp.c:1995:8: error: 'mp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1995 |   mp = ipsec_free_crypto_data(mp);
          |        ^~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ip/ipsecesp.c: In function 'esp_submit_req_outbound':
    ../../common/inet/ip/ipsecesp.c:2345:8: error: 'mp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2345 |   mp = ipsec_free_crypto_data(mp);
          |        ^~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ip/ipsecesp.c: In function 'esp_outbound':
    ../../common/inet/ip/ipsecesp.c:2648:18: error: 'ip6h' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2648 |   ip6h->ip6_plen = htons(ntohs(ip6h->ip6_plen) + adj);
          |   ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

Also available in: Atom PDF