From 4754880099059865cad14f54af683bf416ad4439 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 8 Oct 2008 18:32:06 +0000 Subject: [PATCH] fix missing null-pointer check --- lib/url.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/url.c b/lib/url.c index a1174a63b..fe32cba77 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 */