1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

checkpasswd() prevents segfault by checking that input argument is non-NULL

This commit is contained in:
Daniel Stenberg 2004-05-10 09:16:21 +00:00
parent e18d27b78a
commit 00557a5475

View File

@ -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]="";