Task #54201 - fixed.err

back to task #54201
download
Error: CPPCHECK_WARNING (CWE-562):
libnice-0.1.22/agent/agent.c:4587: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
# 4585|     if (message->from == NULL) {
# 4586|       nice_address_init (&from);
# 4587|->     message->from = &from;
# 4588|     }
# 4589|   

Error: CPPCHECK_WARNING (CWE-476):
libnice-0.1.22/stun/debug.c:100: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bytes
#   98|   
#   99|     bytes = malloc (prefix_len + 2 + (len * 2) + 1);
#  100|->   bytes[0] = 0;
#  101|     strcpy (bytes, prefix);
#  102|     strcpy (bytes + prefix_len, "0x");

Error: GCC_ANALYZER_WARNING (CWE-476):
libnice-0.1.22/stun/debug.c: scope_hint: In function ‘stun_debug_bytes’
libnice-0.1.22/stun/debug.c:100:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘bytes’
#   98|   
#   99|     bytes = malloc (prefix_len + 2 + (len * 2) + 1);
#  100|->   bytes[0] = 0;
#  101|     strcpy (bytes, prefix);
#  102|     strcpy (bytes + prefix_len, "0x");

Error: CPPCHECK_WARNING (CWE-476):
libnice-0.1.22/stun/debug.c:101: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bytes
#   99|     bytes = malloc (prefix_len + 2 + (len * 2) + 1);
#  100|     bytes[0] = 0;
#  101|->   strcpy (bytes, prefix);
#  102|     strcpy (bytes + prefix_len, "0x");
#  103|   

Error: CPPCHECK_WARNING (CWE-682):
libnice-0.1.22/stun/debug.c:102: error[nullPointerArithmeticOutOfMemory]: If memory allocation fail: pointer addition with NULL pointer.
#  100|     bytes[0] = 0;
#  101|     strcpy (bytes, prefix);
#  102|->   strcpy (bytes + prefix_len, "0x");
#  103|   
#  104|     j = bytes + prefix_len + 2;

Error: CPPCHECK_WARNING (CWE-682):
libnice-0.1.22/stun/debug.c:104: error[nullPointerArithmeticOutOfMemory]: If memory allocation fail: pointer addition with NULL pointer.
#  102|     strcpy (bytes + prefix_len, "0x");
#  103|   
#  104|->   j = bytes + prefix_len + 2;
#  105|     for (i = 0; i < len; i++) {
#  106|       k = ((const unsigned char *)data)[i];

Error: GCC_ANALYZER_WARNING (CWE-479):
libnice-0.1.22/stun/tools/stund.c: scope_hint: In function ‘exit_handler’
libnice-0.1.22/stun/tools/stund.c:282:3: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
libnice-0.1.22/stun/tools/stund.c:282:3: note: ‘_exit’ is a possible signal-safe alternative for ‘exit’
#  280|   {
#  281|     (void)signum;
#  282|->   exit (0);
#  283|   }
#  284|   

Error: CPPCHECK_WARNING (CWE-476):
libnice-0.1.22/stun/usages/bind.c:236: warning[nullPointer]: Possible null pointer dereference: srv
#  234|   
#  235|     tr->dstlen = srvlen;
#  236|->   memcpy (&tr->dst, srv, srvlen);
#  237|   
#  238|     return STUN_USAGE_TRANS_RETURN_SUCCESS;

Error: CPPCHECK_WARNING (CWE-476):
libnice-0.1.22/stun/usages/ice.c:116: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf
#  114|       assert (attribute_len >= identifier_len);
#  115|       buf = malloc(attribute_len);
#  116|->     memset(buf, 0, attribute_len);
#  117|       memcpy(buf, candidate_identifier, identifier_len);
#  118|   

Error: CPPCHECK_WARNING (CWE-476):
libnice-0.1.22/stun/usages/ice.c:117: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf
#  115|       buf = malloc(attribute_len);
#  116|       memset(buf, 0, attribute_len);
#  117|->     memcpy(buf, candidate_identifier, identifier_len);
#  118|   
#  119|       val = stun_message_append_bytes (msg, STUN_ATTRIBUTE_CANDIDATE_IDENTIFIER,