mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 15:48:49 -05:00
checkpasswd() prevents segfault by checking that input argument is non-NULL
This commit is contained in:
parent
e18d27b78a
commit
00557a5475
@ -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…
Reference in New Issue
Block a user