mirror of
https://github.com/curl/curl.git
synced 2026-05-14 21:06:21 +03:00
checkpasswd() prevents segfault by checking that input argument is non-NULL
This commit is contained in:
parent
e18d27b78a
commit
00557a5475
1 changed files with 5 additions and 1 deletions
|
|
@ -1049,7 +1049,11 @@ static int str2offset(curl_off_t *val, char *str)
|
|||
static void checkpasswd(const char *kind, /* for what purpose */
|
||||
char **userpwd) /* pointer to allocated string */
|
||||
{
|
||||
char *ptr = strchr(*userpwd, ':');
|
||||
char *ptr;
|
||||
if(!*userpwd)
|
||||
return;
|
||||
|
||||
ptr = strchr(*userpwd, ':');
|
||||
if(!ptr) {
|
||||
/* no password present, prompt for one */
|
||||
char passwd[256]="";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue