mirror of
https://github.com/curl/curl.git
synced 2026-04-18 03:41:41 +03:00
Prevent a very long password to buffer overflow the global variable we
use when built with a very old OpenSSL version.
This commit is contained in:
parent
6c3759d78d
commit
85bd4621db
1 changed files with 3 additions and 1 deletions
|
|
@ -261,7 +261,9 @@ int cert_stuff(struct connectdata *conn,
|
|||
* If password has been given, we store that in the global
|
||||
* area (*shudder*) for a while:
|
||||
*/
|
||||
strcpy(global_passwd, data->set.key_passwd);
|
||||
size_t len = strlen(data->set.key_passwd);
|
||||
if(len < sizeof(global_passwd))
|
||||
memcpy(global_passwd, data->set.key_passwd, len+1);
|
||||
#else
|
||||
/*
|
||||
* We set the password in the callback userdata
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue