Commit 00557a54 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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

parent e18d27b7
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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]="";