aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-10 09:16:21 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-10 09:16:21 +0000
commit00557a5475483078c8d08c496dfc08f3efdfdfc5 (patch)
treec1b51c10245554ad92cdcefedc1308b522cf82f7 /src
parente18d27b78ab32dec410c866050ece9e4c9670905 (diff)
checkpasswd() prevents segfault by checking that input argument is non-NULL
Diffstat (limited to 'src')
-rw-r--r--src/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index a11f0277c..5439253d9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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]="";