Loading src/tool_paramhlp.c +16 −4 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms Loading Loading @@ -322,13 +322,19 @@ ParameterError str2offset(curl_off_t *val, const char *str) ParameterError checkpasswd(const char *kind, /* for what purpose */ char **userpwd) /* pointer to allocated string */ { char *ptr; char *psep; char *osep; if(!*userpwd) return PARAM_OK; ptr = strchr(*userpwd, ':'); if(!ptr) { /* Attempt to find the password separator */ psep = strchr(*userpwd, ':'); /* Attempt to find the options separator */ osep = strchr(*userpwd, ';'); if(!psep && **userpwd != ';') { /* no password present, prompt for one */ char passwd[256] = ""; char prompt[256]; Loading @@ -336,6 +342,9 @@ ParameterError checkpasswd(const char *kind, /* for what purpose */ size_t userlen = strlen(*userpwd); char *passptr; if(osep) *osep = '\0'; /* build a nice-looking prompt */ curlx_msnprintf(prompt, sizeof(prompt), "Enter %s password for user '%s':", Loading @@ -345,6 +354,9 @@ ParameterError checkpasswd(const char *kind, /* for what purpose */ getpass_r(prompt, passwd, sizeof(passwd)); passwdlen = strlen(passwd); if(osep) *osep = ';'; /* extend the allocated memory area to fit the password too */ passptr = realloc(*userpwd, passwdlen + 1 + /* an extra for the colon */ Loading Loading
src/tool_paramhlp.c +16 −4 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms Loading Loading @@ -322,13 +322,19 @@ ParameterError str2offset(curl_off_t *val, const char *str) ParameterError checkpasswd(const char *kind, /* for what purpose */ char **userpwd) /* pointer to allocated string */ { char *ptr; char *psep; char *osep; if(!*userpwd) return PARAM_OK; ptr = strchr(*userpwd, ':'); if(!ptr) { /* Attempt to find the password separator */ psep = strchr(*userpwd, ':'); /* Attempt to find the options separator */ osep = strchr(*userpwd, ';'); if(!psep && **userpwd != ';') { /* no password present, prompt for one */ char passwd[256] = ""; char prompt[256]; Loading @@ -336,6 +342,9 @@ ParameterError checkpasswd(const char *kind, /* for what purpose */ size_t userlen = strlen(*userpwd); char *passptr; if(osep) *osep = '\0'; /* build a nice-looking prompt */ curlx_msnprintf(prompt, sizeof(prompt), "Enter %s password for user '%s':", Loading @@ -345,6 +354,9 @@ ParameterError checkpasswd(const char *kind, /* for what purpose */ getpass_r(prompt, passwd, sizeof(passwd)); passwdlen = strlen(passwd); if(osep) *osep = ';'; /* extend the allocated memory area to fit the password too */ passptr = realloc(*userpwd, passwdlen + 1 + /* an extra for the colon */ Loading