curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl leaks information in freed memory

From: Gabriel Zachmann via curl-library <curl-library_at_cool.haxx.se>
Date: Fri, 19 Oct 2018 10:55:32 +0200

On 19.10.18 08:58, Gabriel Zachmann via curl-library wrote:

> get the length. But yes, if all allocated memory should be freed, we
> have to keep track of the size. A simple way to do so is using an custom
> allocator that allocates more memory as requested and saves the size in
> the memory before the pointer it returns.
I attached some code that should be capable of doing so.

> And measuring if the cleared memory was really cleared is also not that
> trivial.

We can use the following commands to do so:
gcore -o /tmp/xxxx $PID
cat /tmp/xxxx.$PID | strings | grep yyy

and use a characteristic string for yyy, so we can see if that string
was really removed from memory.

But that would not be a simple unit test.

--
Gabriel

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html

Received on 2018-10-19