Task #132349 - libtomcrypt-1.18.2-23.fc44/scan-results.err

back to task #132349
download
Error: COMPILER_WARNING:
libtomcrypt-1.18.2/src/encauth/ccm/ccm_add_nonce.c:64:7: warning[-Wstringop-overflow=]: writing 1 byte into a region of size 0
#   62|      }
#   63|      for (; y < ccm->L; y++) {
#   64|->       ccm->PAD[x++] = (unsigned char)((len >> 24) & 255);
#   65|         len <<= 8;
#   66|      }

Error: COMPILER_WARNING:
libtomcrypt-1.18.2/src/encauth/ccm/ccm_add_nonce.c: scope_hint: In function 'ccm_add_nonce'
libtomcrypt-1.18.2/src/encauth/ccm/ccm_add_nonce.c:64:21: warning[-Wstringop-overflow=]: writing 1 byte into a region of size 0
#   64 |       ccm->PAD[x++] = (unsigned char)((len >> 24) & 255);
#      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libtomcrypt-1.18.2/src/headers/tomcrypt.h:88: included_from: Included from here.
libtomcrypt-1.18.2/src/encauth/ccm/ccm_add_nonce.c:9: included_from: Included from here.
libtomcrypt-1.18.2/src/headers/tomcrypt_mac.h:327:24: note: at offset 16 into destination object 'PAD' of size 16
#  327 |    unsigned char       PAD[16],
#      |                        ^~~
#   62|      }
#   63|      for (; y < ccm->L; y++) {
#   64|->       ccm->PAD[x++] = (unsigned char)((len >> 24) & 255);
#   65|         len <<= 8;
#   66|      }

Error: COMPILER_WARNING:
libtomcrypt-1.18.2/src/encauth/ccm/ccm_memory.c:49:19: note[note]: at offset 16 into destination object 'PAD' of size 16
#   47|                       int  direction)
#   48|   {
#   49|->    unsigned char  PAD[16], ctr[16], CTRPAD[16], ptTag[16], b, *pt_real;
#   50|      unsigned char *pt_work = NULL;
#   51|      symmetric_key *skey;

Error: COMPILER_WARNING:
libtomcrypt-1.18.2/src/encauth/ccm/ccm_memory.c:177:8: warning[-Wstringop-overflow=]: writing 1 byte into a region of size 0
#  175|      }
#  176|      for (; y < L; y++) {
#  177|->        PAD[x++] = (unsigned char)((len >> 24) & 255);
#  178|          len <<= 8;
#  179|      }

Error: COMPILER_WARNING:
libtomcrypt-1.18.2/src/encauth/ccm/ccm_memory.c: scope_hint: In function 'ccm_memory'
libtomcrypt-1.18.2/src/encauth/ccm/ccm_memory.c:177:17: warning[-Wstringop-overflow=]: writing 1 byte into a region of size 0
#  177 |        PAD[x++] = (unsigned char)((len >> 24) & 255);
#      |        ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libtomcrypt-1.18.2/src/encauth/ccm/ccm_memory.c:49:19: note: at offset 16 into destination object 'PAD' of size 16
#   49 |    unsigned char  PAD[16], ctr[16], CTRPAD[16], ptTag[16], b, *pt_real;
#      |                   ^~~
#  175|      }
#  176|      for (; y < L; y++) {
#  177|->        PAD[x++] = (unsigned char)((len >> 24) & 255);
#  178|          len <<= 8;
#  179|      }

Error: COMPILER_WARNING:
libtomcrypt-1.18.2/src/headers/tomcrypt_mac.h:327:24: note[note]: at offset 16 into destination object 'PAD' of size 16
#  325|                          noncelen;             /* length of the nonce */
#  326|   
#  327|->    unsigned char       PAD[16],
#  328|                          ctr[16],
#  329|                          CTRPAD[16],

Error: COMPILER_WARNING:
libtomcrypt-1.18.2/src/headers/tomcrypt_mac.h:327:24: note[note]: at offset [17, 46] into destination object 'PAD' of size 16
#  325|                          noncelen;             /* length of the nonce */
#  326|   
#  327|->    unsigned char       PAD[16],
#  328|                          ctr[16],
#  329|                          CTRPAD[16],

Error: COMPILER_WARNING (CWE-477):
libtomcrypt-1.18.2/src/math/ltm_desc.c: scope_hint: In function 'set_int'
libtomcrypt-1.18.2/src/math/ltm_desc.c:92:4: warning[-Wdeprecated-declarations]: 'mp_set_int' is deprecated: replaced by mp_set_ul
#   92 |    return mpi_to_ltc_error(mp_set_int(a, b));
#      |    ^~~~~~
libtomcrypt-1.18.2/src/math/ltm_desc.c:15: included_from: Included from here.
/usr/include/tommath.h:358:33: note: declared here
#  358 | MP_DEPRECATED(mp_set_ul) mp_err mp_set_int(mp_int *a, unsigned long b);
#      |                                 ^~~~~~~~~~
#   90|   {
#   91|      LTC_ARGCHK(a != NULL);
#   92|->    return mpi_to_ltc_error(mp_set_int(a, b));
#   93|   }
#   94|   

Error: COMPILER_WARNING (CWE-477):
libtomcrypt-1.18.2/src/math/ltm_desc.c:92:4: warning[-Wdeprecated-declarations]: 'mp_set_int' is deprecated: replaced by mp_set_ul
#   90|   {
#   91|      LTC_ARGCHK(a != NULL);
#   92|->    return mpi_to_ltc_error(mp_set_int(a, b));
#   93|   }
#   94|   

Error: COMPILER_WARNING (CWE-477):
libtomcrypt-1.18.2/src/math/ltm_desc.c: scope_hint: In function 'get_int'
libtomcrypt-1.18.2/src/math/ltm_desc.c:98:4: warning[-Wdeprecated-declarations]: 'mp_get_int' is deprecated: replaced by mp_get_mag_u32/mp_get_u32
#   98 |    return mp_get_int(a);
#      |    ^~~~~~
/usr/include/tommath.h:355:56: note: declared here
#  355 | MP_DEPRECATED(mp_get_mag_u32/mp_get_u32) unsigned long mp_get_int(const mp_int *a) MP_WUR;
#      |                                                        ^~~~~~~~~~
#   96|   {
#   97|      LTC_ARGCHK(a != NULL);
#   98|->    return mp_get_int(a);
#   99|   }
#  100|   

Error: COMPILER_WARNING (CWE-477):
libtomcrypt-1.18.2/src/math/ltm_desc.c:98:4: warning[-Wdeprecated-declarations]: 'mp_get_int' is deprecated: replaced by mp_get_mag_u32/mp_get_u32
#   96|   {
#   97|      LTC_ARGCHK(a != NULL);
#   98|->    return mp_get_int(a);
#   99|   }
#  100|   

Error: COMPILER_WARNING (CWE-477):
libtomcrypt-1.18.2/src/math/ltm_desc.c: scope_hint: In function 'write_radix'
libtomcrypt-1.18.2/src/math/ltm_desc.c:178:4: warning[-Wdeprecated-declarations]: 'mp_toradix' is deprecated: replaced by mp_to_radix
#  178 |    return mpi_to_ltc_error(mp_toradix(a, b, radix));
#      |    ^~~~~~
/usr/include/tommath.h:753:35: note: declared here
#  753 | MP_DEPRECATED(mp_to_radix) mp_err mp_toradix(const mp_int *a, char *str, int radix) MP_WUR;
#      |                                   ^~~~~~~~~~
#  176|      LTC_ARGCHK(a != NULL);
#  177|      LTC_ARGCHK(b != NULL);
#  178|->    return mpi_to_ltc_error(mp_toradix(a, b, radix));
#  179|   }
#  180|   

Error: COMPILER_WARNING (CWE-477):
libtomcrypt-1.18.2/src/math/ltm_desc.c:178:4: warning[-Wdeprecated-declarations]: 'mp_toradix' is deprecated: replaced by mp_to_radix
#  176|      LTC_ARGCHK(a != NULL);
#  177|      LTC_ARGCHK(b != NULL);
#  178|->    return mpi_to_ltc_error(mp_toradix(a, b, radix));
#  179|   }
#  180|   

Error: COMPILER_WARNING (CWE-477):
libtomcrypt-1.18.2/src/math/ltm_desc.c: scope_hint: In function 'unsigned_size'
libtomcrypt-1.18.2/src/math/ltm_desc.c:185:4: warning[-Wdeprecated-declarations]: 'mp_unsigned_bin_size' is deprecated: replaced by mp_ubin_size
#  185 |    return mp_unsigned_bin_size(a);
#      |    ^~~~~~
/usr/include/tommath.h:734:33: note: declared here
#  734 | MP_DEPRECATED(mp_ubin_size) int mp_unsigned_bin_size(const mp_int *a) MP_WUR;
#      |                                 ^~~~~~~~~~~~~~~~~~~~
#  183|   {
#  184|      LTC_ARGCHK(a != NULL);
#  185|->    return mp_unsigned_bin_size(a);
#  186|   }
#  187|   

Error: COMPILER_WARNING (CWE-477):
libtomcrypt-1.18.2/src/math/ltm_desc.c:185:4: warning[-Wdeprecated-declarations]: 'mp_unsigned_bin_size' is deprecated: replaced by mp_ubin_size
#  183|   {
#  184|      LTC_ARGCHK(a != NULL);
#  185|->    return mp_unsigned_bin_size(a);
#  186|   }
#  187|   

Error: COMPILER_WARNING (CWE-477):
libtomcrypt-1.18.2/src/math/ltm_desc.c: scope_hint: In function 'unsigned_write'
libtomcrypt-1.18.2/src/math/ltm_desc.c:193:4: warning[-Wdeprecated-declarations]: 'mp_to_unsigned_bin' is deprecated: replaced by mp_to_ubin
#  193 |    return mpi_to_ltc_error(mp_to_unsigned_bin(a, b));
#      |    ^~~~~~
/usr/include/tommath.h:736:34: note: declared here
#  736 | MP_DEPRECATED(mp_to_ubin) mp_err mp_to_unsigned_bin(const mp_int *a, unsigned char *b) MP_WUR;
#      |                                  ^~~~~~~~~~~~~~~~~~
#  191|      LTC_ARGCHK(a != NULL);
#  192|      LTC_ARGCHK(b != NULL);
#  193|->    return mpi_to_ltc_error(mp_to_unsigned_bin(a, b));
#  194|   }
#  195|   

Error: COMPILER_WARNING (CWE-477):
libtomcrypt-1.18.2/src/math/ltm_desc.c:193:4: warning[-Wdeprecated-declarations]: 'mp_to_unsigned_bin' is deprecated: replaced by mp_to_ubin
#  191|      LTC_ARGCHK(a != NULL);
#  192|      LTC_ARGCHK(b != NULL);
#  193|->    return mpi_to_ltc_error(mp_to_unsigned_bin(a, b));
#  194|   }
#  195|   

Error: COMPILER_WARNING (CWE-477):
libtomcrypt-1.18.2/src/math/ltm_desc.c: scope_hint: In function 'unsigned_read'
libtomcrypt-1.18.2/src/math/ltm_desc.c:201:4: warning[-Wdeprecated-declarations]: 'mp_read_unsigned_bin' is deprecated: replaced by mp_from_ubin
#  201 |    return mpi_to_ltc_error(mp_read_unsigned_bin(a, b, len));
#      |    ^~~~~~
/usr/include/tommath.h:735:36: note: declared here
#  735 | MP_DEPRECATED(mp_from_ubin) mp_err mp_read_unsigned_bin(mp_int *a, const unsigned char *b, int c) MP_WUR;
#      |                                    ^~~~~~~~~~~~~~~~~~~~
#  199|      LTC_ARGCHK(a != NULL);
#  200|      LTC_ARGCHK(b != NULL);
#  201|->    return mpi_to_ltc_error(mp_read_unsigned_bin(a, b, len));
#  202|   }
#  203|   

Error: COMPILER_WARNING (CWE-477):
libtomcrypt-1.18.2/src/math/ltm_desc.c:201:4: warning[-Wdeprecated-declarations]: 'mp_read_unsigned_bin' is deprecated: replaced by mp_from_ubin
#  199|      LTC_ARGCHK(a != NULL);
#  200|      LTC_ARGCHK(b != NULL);
#  201|->    return mpi_to_ltc_error(mp_read_unsigned_bin(a, b, len));
#  202|   }
#  203|   

Error: COMPILER_WARNING:
libtomcrypt-1.18.2/src/math/ltm_desc.c: scope_hint: At top level
libtomcrypt-1.18.2/src/math/ltm_desc.c:423:9: warning: DIGIT_BIT macro is deprecated, MP_DIGIT_BIT instead
#  423 |    (int)DIGIT_BIT,
#      |         ^~~~~~~~~
#  421|   
#  422|      "LibTomMath",
#  423|->    (int)DIGIT_BIT,
#  424|   
#  425|      &init,

Error: COMPILER_WARNING:
libtomcrypt-1.18.2/src/misc/pkcs5/pkcs_5_test.c: scope_hint: In function 'pkcs_5_test'
libtomcrypt-1.18.2/src/misc/pkcs5/pkcs_5_test.c:160:9: warning[-Wunused-but-set-variable=]: variable 'tested' set but not used
#  160 |     int tested=0, failed=0;
#      |         ^~~~~~
#  158|       unsigned long dkLen;
#  159|       int i, err;
#  160|->     int tested=0, failed=0;
#  161|       int hash = find_hash("sha1");
#  162|       if (hash == -1)

Error: CPPCHECK_WARNING (CWE-786):
libtomcrypt-1.18.2/src/modes/lrw/lrw_process.c:65: error[negativeIndex]: Array 'lrw->IV[16]' accessed at index -1, which is out of bounds.
#   63|   #else
#   64|             for (y = 0; y < 16; y++) {
#   65|->               lrw->pad[y] ^= lrw->PC[x][lrw->IV[x]][y] ^ lrw->PC[x][(lrw->IV[x]-1)&255][y];
#   66|             }
#   67|   #endif

Error: CPPCHECK_WARNING (CWE-786):
libtomcrypt-1.18.2/src/modes/lrw/lrw_process.c:65: error[negativeIndex]: Array 'lrw->PC[16][256][16]' accessed at index lrw->PC[-1][*][*], which is out of bounds.
#   63|   #else
#   64|             for (y = 0; y < 16; y++) {
#   65|->               lrw->pad[y] ^= lrw->PC[x][lrw->IV[x]][y] ^ lrw->PC[x][(lrw->IV[x]-1)&255][y];
#   66|             }
#   67|   #endif

Error: COMPILER_WARNING:
libtomcrypt-1.18.2/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c: scope_hint: In function 'der_decode_sequence_flexi'
libtomcrypt-1.18.2/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c:253:43: warning[-Wcalloc-transposed-args]: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument
#  253 |             if ((l->data = XCALLOC(sizeof(wchar_t), l->size)) == NULL) {
#      |                                           ^~~~~~~
libtomcrypt-1.18.2/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c:253:43: note: earlier argument should specify number of elements, later size of each element
#  251|               l->size = len;
#  252|   
#  253|->             if ((l->data = XCALLOC(sizeof(wchar_t), l->size)) == NULL) {
#  254|                  err = CRYPT_MEM;
#  255|                  goto error;

Error: COMPILER_WARNING:
libtomcrypt-1.18.2/src/pk/asn1/der/sequence/der_decode_sequence_multi.c: scope_hint: In function 'der_decode_sequence_multi'
libtomcrypt-1.18.2/src/pk/asn1/der/sequence/der_decode_sequence_multi.c:88:25: warning[-Wcalloc-transposed-args]: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument
#   88 |    list = XCALLOC(sizeof(*list), x);
#      |                         ^
libtomcrypt-1.18.2/src/pk/asn1/der/sequence/der_decode_sequence_multi.c:88:25: note: earlier argument should specify number of elements, later size of each element
#   86|      }
#   87|   
#   88|->    list = XCALLOC(sizeof(*list), x);
#   89|      if (list == NULL) {
#   90|         return CRYPT_MEM;

Error: COMPILER_WARNING:
libtomcrypt-1.18.2/src/pk/asn1/der/sequence/der_encode_sequence_multi.c: scope_hint: In function 'der_encode_sequence_multi'
libtomcrypt-1.18.2/src/pk/asn1/der/sequence/der_encode_sequence_multi.c:89:25: warning[-Wcalloc-transposed-args]: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument
#   89 |    list = XCALLOC(sizeof(*list), x);
#      |                         ^
libtomcrypt-1.18.2/src/pk/asn1/der/sequence/der_encode_sequence_multi.c:89:25: note: earlier argument should specify number of elements, later size of each element
#   87|      }
#   88|   
#   89|->    list = XCALLOC(sizeof(*list), x);
#   90|      if (list == NULL) {
#   91|         return CRYPT_MEM;

Error: CPPCHECK_WARNING (CWE-476):
libtomcrypt-1.18.2/tests/no_prng.c:167: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: no_prng
#  165|      LTC_ARGCHK(no_prng != NULL);
#  166|      XMEMCPY(&no_prng->desc, &no_prng_desc, sizeof(no_prng_desc));
#  167|->    LTC_ARGCHK(snprintf(no_prng->name, sizeof(no_prng->name), "no_prng@%p", no_prng) < (int)sizeof(no_prng->name));
#  168|      no_prng->desc.name = no_prng->name;
#  169|      return &no_prng->desc;