diff options
| author | Prashant Chaudhari <prashantsc@gmail.com> | 2018-03-04 22:53:32 +0100 |
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2018-03-04 22:54:29 +0100 |
| commit | c5a5e9a8fca8636546343f9877c01bae7584c62e (patch) | |
| tree | 94820b1bb761a7772f8e0204d747cb7b95850c12 | |
| parent | c74521628bf5c7172b2df06dcc7db6ac2fd6bcb3 (diff) | |
| download | curl-bagder/clear-free-strings.tar.gz | |
cleanup: zero set strings before freeing thembagder/clear-free-strings
... to avoid having sensitive data lingering around in the heap after
use.
URL: https://curl.haxx.se/mail/lib-2018-03/0012.html
| -rw-r--r-- | lib/url.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -278,6 +278,9 @@ void Curl_freeset(struct Curl_easy *data) /* Free all dynamic strings stored in the data->set substructure. */ enum dupstring i; for(i = (enum dupstring)0; i < STRING_LAST; i++) { + if(data->set.str[i]) + /* clear them before free to make sure no sensitive data linger around */ + memset(data->set.str[i], 0, strlen(data->set.str[i])); Curl_safefree(data->set.str[i]); } |
