From: Daniel Stenberg Date: Mon, 10 May 2004 09:16:21 +0000 (+0000) Subject: checkpasswd() prevents segfault by checking that input argument is non-NULL X-Git-Tag: curl-7_12_0~149 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=00557a5475483078c8d08c496dfc08f3efdfdfc5;p=thirdparty%2Fcurl.git checkpasswd() prevents segfault by checking that input argument is non-NULL --- diff --git a/src/main.c b/src/main.c index a11f0277cf..5439253d95 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]="";