Error: GCC_ANALYZER_WARNING (CWE-401): [#def1] pycrypto-2.6.1/src/DES.c:83:10: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:498:1: enter_function: entry to ‘ALG_Decrypt’ pycrypto-2.6.1/src/block_template.c:507:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:510:14: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:510:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:512:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:512:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:516:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:532:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:533:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:540:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:564:26: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:566:52: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:566:25: call_function: calling ‘block_encrypt’ from ‘ALG_Decrypt’ # 81| int rc; # 82| #ifdef PCT_DES3_MODULE # 83|-> rc = des3_ecb_encrypt(in, out, &self->sk); # 84| #else # 85| rc = des_ecb_encrypt(in, out, &self->sk); Error: GCC_ANALYZER_WARNING (CWE-401): [#def2] pycrypto-2.6.1/src/DES.c:85:10: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:498:1: enter_function: entry to ‘ALG_Decrypt’ pycrypto-2.6.1/src/block_template.c:507:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:510:14: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:510:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:512:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:512:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:516:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:532:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:533:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:540:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:564:26: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:566:52: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:566:25: call_function: calling ‘block_encrypt’ from ‘ALG_Decrypt’ # 83| rc = des3_ecb_encrypt(in, out, &self->sk); # 84| #else # 85|-> rc = des_ecb_encrypt(in, out, &self->sk); # 86| #endif # 87| assert(rc == CRYPT_OK); Error: GCC_ANALYZER_WARNING (CWE-401): [#def3] pycrypto-2.6.1/src/DES.c:94:10: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:498:1: enter_function: entry to ‘ALG_Decrypt’ pycrypto-2.6.1/src/block_template.c:507:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:510:14: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:510:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:512:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:512:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:516:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:532:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:533:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:540:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:544:26: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:546:25: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:546:25: call_function: calling ‘block_decrypt’ from ‘ALG_Decrypt’ # 92| int rc; # 93| #ifdef PCT_DES3_MODULE # 94|-> rc = des3_ecb_decrypt(in, out, &self->sk); # 95| #else # 96| rc = des_ecb_decrypt(in, out, &self->sk); Error: GCC_ANALYZER_WARNING (CWE-401): [#def4] pycrypto-2.6.1/src/DES.c:96:10: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:498:1: enter_function: entry to ‘ALG_Decrypt’ pycrypto-2.6.1/src/block_template.c:507:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:510:14: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:510:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:512:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:512:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:516:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:532:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:533:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:540:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:544:26: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:546:25: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:546:25: call_function: calling ‘block_decrypt’ from ‘ALG_Decrypt’ # 94| rc = des3_ecb_decrypt(in, out, &self->sk); # 95| #else # 96|-> rc = des_ecb_decrypt(in, out, &self->sk); # 97| #endif # 98| assert(rc == CRYPT_OK); Error: COMPILER_WARNING: [#def5] pycrypto-2.6.1/src/MD2.c:45:19: warning[-Wunused-const-variable=]: ‘md2_oid’ defined but not used # 45 | static const char md2_oid[] = { 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x02 }; # | ^~~~~~~ # 43| * } # 44| */ # 45|-> static const char md2_oid[] = { 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x02 }; # 46| # 47| #define DER_OID ((void*)&md2_oid) Error: CPPCHECK_WARNING (CWE-457): [#def6] pycrypto-2.6.1/src/MD2.c:143: warning[uninitvar]: Uninitialized variable: padding # 141| padlen= 16-self->count; # 142| for(i=0; i<padlen; i++) padding[i]=padlen; # 143|-> hash_update(&temp, padding, padlen); # 144| hash_update(&temp, temp.C, 16); # 145| return PyBytes_FromStringAndSize((char *) temp.X, 16); Error: COMPILER_WARNING (CWE-483): [#def7] pycrypto-2.6.1/src/_counter.c: scope_hint: In function ‘PyInit__counter’ pycrypto-2.6.1/src/_counter.c:570:5: warning[-Wmisleading-indentation]: this ‘if’ clause does not guard... # 570 | if (m == NULL) # | ^~ pycrypto-2.6.1/src/_counter.c:573:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ # 573 | return m; # | ^~~~~~ # 568| /* Initialize the module */ # 569| m = PyModule_Create(&moduledef); # 570|-> if (m == NULL) # 571| return NULL; # 572| Error: GCC_ANALYZER_WARNING (CWE-401): [#def8] pycrypto-2.6.1/src/block_template.c:306:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:306:9: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4) # 304| return NULL; # 305| } # 306|-> Py_BEGIN_ALLOW_THREADS; # 307| switch(self->mode) # 308| { Error: GCC_ANALYZER_WARNING (CWE-401): [#def9] pycrypto-2.6.1/src/block_template.c:411:41: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:382:28: branch_false: following ‘false’ branch... branch_false: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:409:52: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:410:36: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:411:41: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4) # 409| PCT_CounterObject *ctr = (PCT_CounterObject *)(self->counter); # 410| if (ctr->carry && !ctr->allow_wraparound) { # 411|-> Py_BLOCK_THREADS; # 412| PyErr_SetString(PyExc_OverflowError, # 413| "counter wrapped without allow_wraparound"); Error: GCC_ANALYZER_WARNING (CWE-401): [#def10] pycrypto-2.6.1/src/block_template.c:412:41: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:409:52: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:410:36: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:412:41: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4) # 410| if (ctr->carry && !ctr->allow_wraparound) { # 411| Py_BLOCK_THREADS; # 412|-> PyErr_SetString(PyExc_OverflowError, # 413| "counter wrapped without allow_wraparound"); # 414| free(buffer); Error: GCC_ANALYZER_WARNING (CWE-401): [#def11] pycrypto-2.6.1/src/block_template.c:418:41: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:382:28: branch_false: following ‘false’ branch... branch_false: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:409:52: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:417:36: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:418:41: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:418:41: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4) # 416| } # 417| if (ctr->buf_size != BLOCK_SIZE) { # 418|-> Py_BLOCK_THREADS; # 419| PyErr_Format(PyExc_TypeError, # 420| "CTR counter function returned " Error: GCC_ANALYZER_WARNING (CWE-401): [#def12] pycrypto-2.6.1/src/block_template.c:419:41: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:409:52: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:417:36: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:418:41: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:419:41: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4) # 417| if (ctr->buf_size != BLOCK_SIZE) { # 418| Py_BLOCK_THREADS; # 419|-> PyErr_Format(PyExc_TypeError, # 420| "CTR counter function returned " # 421| "string not of length %i", Error: GCC_ANALYZER_WARNING (CWE-401): [#def13] pycrypto-2.6.1/src/block_template.c:429:33: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:382:28: branch_false: following ‘false’ branch... branch_false: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:409:52: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:417:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:428:47: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:429:33: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4) # 427| (unsigned char *)ctr->val, # 428| self->IV); # 429|-> ctr->inc_func(ctr); # 430| } else { # 431| PyObject *ctr; Error: GCC_ANALYZER_WARNING (CWE-401): [#def14] pycrypto-2.6.1/src/block_template.c:432:33: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:382:28: branch_false: following ‘false’ branch... branch_false: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:432:33: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:432:33: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4) # 430| } else { # 431| PyObject *ctr; # 432|-> Py_BLOCK_THREADS; # 433| ctr = PyObject_CallObject(self->counter, NULL); # 434| if (ctr == NULL) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def15] pycrypto-2.6.1/src/block_template.c:433:39: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:382:28: branch_false: following ‘false’ branch... branch_false: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:432:33: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:433:39: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4) # 431| PyObject *ctr; # 432| Py_BLOCK_THREADS; # 433|-> ctr = PyObject_CallObject(self->counter, NULL); # 434| if (ctr == NULL) { # 435| free(buffer); Error: GCC_ANALYZER_WARNING (CWE-401): [#def16] pycrypto-2.6.1/src/block_template.c:440:41: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:265:1: enter_function: entry to ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:432:33: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:434:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:438:38: call_function: inlined call to ‘_Py_TYPE’ from ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:438:36: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:440:41: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:440:41: danger: ‘buffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/5) # 438| if (!PyBytes_Check(ctr)) # 439| { # 440|-> PyErr_SetString(PyExc_TypeError, # 441| #ifdef IS_PY3K # 442| "CTR counter function didn't return bytes"); Error: GCC_ANALYZER_WARNING (CWE-401): [#def17] pycrypto-2.6.1/src/block_template.c:450:37: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:265:1: enter_function: entry to ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:382:28: branch_false: following ‘false’ branch... branch_false: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:432:33: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:434:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:438:38: call_function: inlined call to ‘_Py_TYPE’ from ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:438:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:450:37: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:450:37: danger: ‘buffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/5) # 448| return NULL; # 449| } # 450|-> if (PyBytes_Size(ctr) != BLOCK_SIZE) { # 451| PyErr_Format(PyExc_TypeError, # 452| "CTR counter function returned " Error: GCC_ANALYZER_WARNING (CWE-401): [#def18] pycrypto-2.6.1/src/block_template.c:451:41: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:265:1: enter_function: entry to ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:432:33: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:434:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:438:38: call_function: inlined call to ‘_Py_TYPE’ from ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:438:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:450:37: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:450:36: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:451:41: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:451:41: danger: ‘buffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/5) # 449| } # 450| if (PyBytes_Size(ctr) != BLOCK_SIZE) { # 451|-> PyErr_Format(PyExc_TypeError, # 452| "CTR counter function returned " # 453| #ifdef IS_PY3K Error: GCC_ANALYZER_WARNING (CWE-401): [#def19] pycrypto-2.6.1/src/block_template.c:463:33: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:265:1: enter_function: entry to ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:382:28: branch_false: following ‘false’ branch... branch_false: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:432:33: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:434:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:438:38: call_function: inlined call to ‘_Py_TYPE’ from ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:438:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:450:37: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:450:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:463:33: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:463:33: danger: ‘buffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/5) # 461| return NULL; # 462| } # 463|-> Py_UNBLOCK_THREADS; # 464| block_encrypt(&(self->st), (unsigned char *)PyBytes_AsString(ctr), # 465| self->IV); Error: GCC_ANALYZER_WARNING (CWE-401): [#def20] pycrypto-2.6.1/src/block_template.c:464:77: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:265:1: enter_function: entry to ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:382:28: branch_false: following ‘false’ branch... branch_false: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:432:33: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:434:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:438:38: call_function: inlined call to ‘_Py_TYPE’ from ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:438:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:450:37: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:450:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:463:33: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:464:77: danger: ‘buffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/5) # 462| } # 463| Py_UNBLOCK_THREADS; # 464|-> block_encrypt(&(self->st), (unsigned char *)PyBytes_AsString(ctr), # 465| self->IV); # 466| Py_BLOCK_THREADS; Error: GCC_ANALYZER_WARNING (CWE-401): [#def21] pycrypto-2.6.1/src/block_template.c:466:33: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:265:1: enter_function: entry to ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:382:28: branch_false: following ‘false’ branch... branch_false: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:432:33: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:434:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:438:38: call_function: inlined call to ‘_Py_TYPE’ from ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:438:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:450:37: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:450:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:463:33: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:466:33: danger: ‘buffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/5) # 464| block_encrypt(&(self->st), (unsigned char *)PyBytes_AsString(ctr), # 465| self->IV); # 466|-> Py_BLOCK_THREADS; # 467| Py_DECREF(ctr); # 468| Py_UNBLOCK_THREADS; Error: GCC_ANALYZER_WARNING (CWE-401): [#def22] pycrypto-2.6.1/src/block_template.c:468:33: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:265:1: enter_function: entry to ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:380:24: branch_true: following ‘true’ branch... pycrypto-2.6.1/src/block_template.c:382:29: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:382:28: branch_false: following ‘false’ branch... branch_false: ...to here pycrypto-2.6.1/src/block_template.c:404:28: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:432:33: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:434:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:438:38: call_function: inlined call to ‘_Py_TYPE’ from ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:438:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:450:37: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:450:36: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:463:33: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:467:33: call_function: inlined call to ‘Py_DECREF’ from ‘ALG_Encrypt’ pycrypto-2.6.1/src/block_template.c:468:33: branch_true: ...to here pycrypto-2.6.1/src/block_template.c:468:33: danger: ‘buffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/5) # 466| Py_BLOCK_THREADS; # 467| Py_DECREF(ctr); # 468|-> Py_UNBLOCK_THREADS; # 469| } # 470| Error: GCC_ANALYZER_WARNING (CWE-401): [#def23] pycrypto-2.6.1/src/block_template.c:477:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:477:17: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/4) # 475| # 476| default: # 477|-> Py_BLOCK_THREADS; # 478| PyErr_Format(PyExc_SystemError, # 479| "Unknown ciphertext feedback mode %i; " Error: GCC_ANALYZER_WARNING (CWE-401): [#def24] pycrypto-2.6.1/src/block_template.c:478:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:478:17: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/4) # 476| default: # 477| Py_BLOCK_THREADS; # 478|-> PyErr_Format(PyExc_SystemError, # 479| "Unknown ciphertext feedback mode %i; " # 480| "this shouldn't happen", Error: GCC_ANALYZER_WARNING (CWE-401): [#def25] pycrypto-2.6.1/src/block_template.c:485:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:485:9: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/4) # 483| return NULL; # 484| } # 485|-> Py_END_ALLOW_THREADS; # 486| result=PyBytes_FromStringAndSize((char *) buffer, len); # 487| free(buffer); Error: GCC_ANALYZER_WARNING (CWE-401): [#def26] pycrypto-2.6.1/src/block_template.c:486:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:273:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:275:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:275:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:279:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:298:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:299:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:306:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:486:16: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/4) # 484| } # 485| Py_END_ALLOW_THREADS; # 486|-> result=PyBytes_FromStringAndSize((char *) buffer, len); # 487| free(buffer); # 488| return(result); Error: GCC_ANALYZER_WARNING (CWE-401): [#def27] pycrypto-2.6.1/src/block_template.c:540:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:507:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:510:14: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:510:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:512:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:512:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:516:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:532:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:533:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:540:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:540:9: danger: ‘buffer’ leaks here; was allocated at [(7)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/6) # 538| return NULL; # 539| } # 540|-> Py_BEGIN_ALLOW_THREADS; # 541| switch(self->mode) # 542| { Error: GCC_ANALYZER_WARNING (CWE-401): [#def28] pycrypto-2.6.1/src/block_template.c:602:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:507:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:510:14: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:510:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:512:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:512:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:516:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:532:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:533:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:540:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:602:17: danger: ‘buffer’ leaks here; was allocated at [(7)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/6) # 600| # 601| default: # 602|-> Py_BLOCK_THREADS; # 603| PyErr_Format(PyExc_SystemError, # 604| "Unknown ciphertext feedback mode %i; " Error: GCC_ANALYZER_WARNING (CWE-401): [#def29] pycrypto-2.6.1/src/block_template.c:603:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:507:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:510:14: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:510:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:512:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:512:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:516:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:532:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:533:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:540:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:603:17: danger: ‘buffer’ leaks here; was allocated at [(7)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/6) # 601| default: # 602| Py_BLOCK_THREADS; # 603|-> PyErr_Format(PyExc_SystemError, # 604| "Unknown ciphertext feedback mode %i; " # 605| "this shouldn't happen", Error: GCC_ANALYZER_WARNING (CWE-401): [#def30] pycrypto-2.6.1/src/block_template.c:610:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:507:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:510:14: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:510:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:512:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:512:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:516:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:532:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:533:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:540:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:610:9: danger: ‘buffer’ leaks here; was allocated at [(7)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/6) # 608| return NULL; # 609| } # 610|-> Py_END_ALLOW_THREADS; # 611| result=PyBytes_FromStringAndSize((char *) buffer, len); # 612| free(buffer); Error: GCC_ANALYZER_WARNING (CWE-401): [#def31] pycrypto-2.6.1/src/block_template.c:611:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/block_template.c:507:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:510:14: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:510:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:512:13: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:512:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/block_template.c:516:12: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:532:16: acquire_memory: allocated here pycrypto-2.6.1/src/block_template.c:533:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/block_template.c:540:9: branch_false: ...to here pycrypto-2.6.1/src/block_template.c:611:16: danger: ‘buffer’ leaks here; was allocated at [(7)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/6) # 609| } # 610| Py_END_ALLOW_THREADS; # 611|-> result=PyBytes_FromStringAndSize((char *) buffer, len); # 612| free(buffer); # 613| return(result); Error: COMPILER_WARNING (CWE-569): [#def32] pycrypto-2.6.1/src/SHA256.c:72: included_from: Included from here. pycrypto-2.6.1/src/hash_SHA2_template.c: scope_hint: In function ‘add_length’ pycrypto-2.6.1/src/hash_SHA2_template.c:97:30: warning[-Wtautological-compare]: self-comparison always evaluates to false # 97 | if (hs->length_upper > hs->length_upper) # | ^ # 95| overflow_detector = hs->length_upper; # 96| hs->length_upper++; # 97|-> if (hs->length_upper > hs->length_upper) # 98| return 0; # 99| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def33] pycrypto-2.6.1/src/stream_template.c:160:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/stream_template.c:147:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/stream_template.c:149:13: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:149:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/stream_template.c:153:18: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:153:18: acquire_memory: allocated here pycrypto-2.6.1/src/stream_template.c:154:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/stream_template.c:160:9: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:160:9: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4) # 158| return NULL; # 159| } # 160|-> Py_BEGIN_ALLOW_THREADS; # 161| memcpy(buffer, str, (size_t)len); # 162| stream_encrypt(&(self->st), buffer, (int)len); Error: GCC_ANALYZER_WARNING (CWE-401): [#def34] pycrypto-2.6.1/src/stream_template.c:163:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/stream_template.c:141:1: enter_function: entry to ‘ALG_Encrypt’ pycrypto-2.6.1/src/stream_template.c:147:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/stream_template.c:149:13: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:149:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/stream_template.c:153:18: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:153:18: acquire_memory: allocated here pycrypto-2.6.1/src/stream_template.c:154:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/stream_template.c:160:9: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:162:9: call_function: calling ‘stream_encrypt’ from ‘ALG_Encrypt’ pycrypto-2.6.1/src/stream_template.c:162:9: return_function: returning to ‘ALG_Encrypt’ from ‘stream_encrypt’ pycrypto-2.6.1/src/stream_template.c:163:9: danger: ‘buffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/5) # 161| memcpy(buffer, str, (size_t)len); # 162| stream_encrypt(&(self->st), buffer, (int)len); # 163|-> Py_END_ALLOW_THREADS; # 164| result = PyBytes_FromStringAndSize((char *)buffer, len); # 165| free(buffer); Error: GCC_ANALYZER_WARNING (CWE-401): [#def35] pycrypto-2.6.1/src/stream_template.c:164:18: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/stream_template.c:141:1: enter_function: entry to ‘ALG_Encrypt’ pycrypto-2.6.1/src/stream_template.c:147:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/stream_template.c:149:13: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:149:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/stream_template.c:153:18: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:153:18: acquire_memory: allocated here pycrypto-2.6.1/src/stream_template.c:154:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/stream_template.c:160:9: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:162:9: call_function: calling ‘stream_encrypt’ from ‘ALG_Encrypt’ pycrypto-2.6.1/src/stream_template.c:162:9: return_function: returning to ‘ALG_Encrypt’ from ‘stream_encrypt’ pycrypto-2.6.1/src/stream_template.c:164:18: danger: ‘buffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/5) # 162| stream_encrypt(&(self->st), buffer, (int)len); # 163| Py_END_ALLOW_THREADS; # 164|-> result = PyBytes_FromStringAndSize((char *)buffer, len); # 165| free(buffer); # 166| return (result); Error: GCC_ANALYZER_WARNING (CWE-401): [#def36] pycrypto-2.6.1/src/stream_template.c:192:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/stream_template.c:179:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/stream_template.c:181:13: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:181:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/stream_template.c:185:18: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:185:18: acquire_memory: allocated here pycrypto-2.6.1/src/stream_template.c:186:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/stream_template.c:192:9: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:192:9: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4) # 190| return NULL; # 191| } # 192|-> Py_BEGIN_ALLOW_THREADS; # 193| memcpy(buffer, str, (size_t)len); # 194| stream_decrypt(&(self->st), buffer, (int)len); Error: GCC_ANALYZER_WARNING (CWE-401): [#def37] pycrypto-2.6.1/src/stream_template.c:195:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/stream_template.c:173:1: enter_function: entry to ‘ALG_Decrypt’ pycrypto-2.6.1/src/stream_template.c:179:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/stream_template.c:181:13: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:181:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/stream_template.c:185:18: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:185:18: acquire_memory: allocated here pycrypto-2.6.1/src/stream_template.c:186:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/stream_template.c:192:9: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:194:9: call_function: calling ‘stream_encrypt’ from ‘ALG_Decrypt’ pycrypto-2.6.1/src/stream_template.c:194:9: return_function: returning to ‘ALG_Decrypt’ from ‘stream_encrypt’ pycrypto-2.6.1/src/stream_template.c:195:9: danger: ‘buffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/5) # 193| memcpy(buffer, str, (size_t)len); # 194| stream_decrypt(&(self->st), buffer, (int)len); # 195|-> Py_END_ALLOW_THREADS; # 196| result = PyBytes_FromStringAndSize((char *)buffer, len); # 197| free(buffer); Error: GCC_ANALYZER_WARNING (CWE-401): [#def38] pycrypto-2.6.1/src/stream_template.c:196:18: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ pycrypto-2.6.1/src/stream_template.c:173:1: enter_function: entry to ‘ALG_Decrypt’ pycrypto-2.6.1/src/stream_template.c:179:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/stream_template.c:181:13: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:181:12: branch_false: following ‘false’ branch... pycrypto-2.6.1/src/stream_template.c:185:18: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:185:18: acquire_memory: allocated here pycrypto-2.6.1/src/stream_template.c:186:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... pycrypto-2.6.1/src/stream_template.c:192:9: branch_false: ...to here pycrypto-2.6.1/src/stream_template.c:194:9: call_function: calling ‘stream_encrypt’ from ‘ALG_Decrypt’ pycrypto-2.6.1/src/stream_template.c:194:9: return_function: returning to ‘ALG_Decrypt’ from ‘stream_encrypt’ pycrypto-2.6.1/src/stream_template.c:196:18: danger: ‘buffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/5) # 194| stream_decrypt(&(self->st), buffer, (int)len); # 195| Py_END_ALLOW_THREADS; # 196|-> result = PyBytes_FromStringAndSize((char *)buffer, len); # 197| free(buffer); # 198| return (result); Error: COMPILER_WARNING: [#def39] pycrypto-2.6.1/src/strxor.c:31:19: warning[-Wunused-const-variable=]: ‘rcsid’ defined but not used # 31 | static const char rcsid[] = "$Id$"; # | ^~~~~ # 29| #include "pycrypto_compat.h" # 30| # 31|-> static const char rcsid[] = "$Id$"; # 32| # 33| /*
| analyzer-version-clippy | 1.90.0 |
| analyzer-version-cppcheck | 2.18.3 |
| analyzer-version-gcc | 15.2.1 |
| analyzer-version-gcc-analyzer | 16.0.0 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-94.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch |
| mock-config | fedora-rawhide-gcc-latest-x86_64 |
| project-name | python-crypto-2.6.1-59.fc44 |
| store-results-to | /tmp/tmp0462z0xb/python-crypto-2.6.1-59.fc44.tar.xz |
| time-created | 2025-10-28 19:56:47 |
| time-finished | 2025-10-28 19:58:30 |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmp0462z0xb/python-crypto-2.6.1-59.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp0462z0xb/python-crypto-2.6.1-59.fc44.src.rpm' |
| tool-version | csmock-3.8.3.20251027.143044.ge6b947b-1.el9 |