Static analysis finds null-check and memory leak bugs in GmSSL cryptographic library

A reader suggested examining GmSSL, an open-source C cryptographic library from Peking University that implements China's SM2/SM3/SM4/SM9 standards and TLCP and TLS protocols. A PVS-Studio analysis found no especially critical bugs, but it did flag common errors. In one case, a connection pointer is dereferenced before being checked for null, which should be validated at the start of the function. Several test functions also exit early on allocation failure without freeing previously allocated buffers, causing memory leaks. The report notes that these are familiar mistakes that remain problematic despite being routine.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in