From: Yang Tse Date: Wed, 8 Oct 2008 18:32:06 +0000 (+0000) Subject: fix missing null-pointer check X-Git-Tag: curl-7_19_1~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4754880099059865cad14f54af683bf416ad4439;p=thirdparty%2Fcurl.git fix missing null-pointer check --- diff --git a/lib/url.c b/lib/url.c index a1174a63b5..fe32cba777 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1501,8 +1501,14 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, * user:password to use in the operation */ { - char* userpwd = va_arg(param, char *); - char* separator = strchr(userpwd, ':'); + char* userpwd; + char* separator; + + userpwd = va_arg(param, char *); + if(userpwd == NULL) + break; + + separator = strchr(userpwd, ':'); if (separator != NULL) { /* store username part of option */