Cetching segfault, if no password for pem key given.
FossilOrigin-Name: a996a773e8001040020a438ab2a71ba646f1dff16b886989d1f9a189e00514e9
This commit is contained in:
parent
ce01c6327e
commit
04fa8f58f9
@ -50,6 +50,11 @@ static void dtls_debug_cb(int write_p,int version,int type, const void * buf,siz
|
|||||||
|
|
||||||
int pem_passwd_cb(char *buf, int size, int rwflag, void *password)
|
int pem_passwd_cb(char *buf, int size, int rwflag, void *password)
|
||||||
{
|
{
|
||||||
|
if (!password){
|
||||||
|
cw_dbg(DBG_DTLS, "DTLS - No password given to decrypt privat key");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
strncpy(buf, (char *)(password), size);
|
strncpy(buf, (char *)(password), size);
|
||||||
buf[size - 1] = '\0';
|
buf[size - 1] = '\0';
|
||||||
return(strlen(buf));
|
return(strlen(buf));
|
||||||
|
Loading…
Reference in New Issue
Block a user