FlawAtlas
Search the atlas
CVE-2016-8618 Moderate

double free in curl_maprintf

The libcurl API function called `curl_maprintf()` can be tricked into doing a double free due to an unsafe `size_t` multiplication, on systems using 32-bit `size_t` variables. The function is also used internally in numerous situations. The function doubles an allocated memory area with realloc() and allows the size to wrap and become zero and when doing so realloc() returns NULL *and* frees the memory - in contrary to normal realloc() fails where it only returns NULL - causing libcurl to free the memory *again* in the error path. Systems with 64-bit versions of the `size_t` type are not affected by this issue. This behavior can be triggered using the publicly exposed function.

Exploit probability 4.8%
Published November 2, 2016
Required by Not available
Last source change May 27, 2026

02 / AFFECTED SOFTWARE

Affected packages

Unknown Unknown

139 explicit affected versions

Unknown Unknown

281 explicit affected versions

03 / CONNECTIONS

Connected vulnerabilities

04 / EVIDENCE

Source records

Open Source Vulnerabilities CVE-2016-8618

The libcurl API function called `curl_maprintf()` before version 7.51.0 can be tricked into doing a double-free due to an unsafe `size_t` multiplication, on systems using 32 bit `size_t` variables.

View original source
Open Source Vulnerabilities CURL-CVE-2016-8618

The libcurl API function called `curl_maprintf()` can be tricked into doing a double free due to an unsafe `size_t` multiplication, on systems using 32-bit `size_t` variables. The function is also used internally in numerous situations. The function doubles an allocated memory area with realloc() and allows the size to wrap and become zero and when doing so realloc() returns NULL *and* frees the memory - in contrary to normal realloc() fails where it only returns NULL - causing libcurl to free the memory *again* in the error path. Systems with 64-bit versions of the `size_t` type are not affected by this issue. This behavior can be triggered using the publicly exposed function.

View original source

05 / REFERENCES

Further evidence