diff options
author | Yang Tse <yangsita@gmail.com> | 2008-10-08 18:32:06 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2008-10-08 18:32:06 +0000 |
commit | 4754880099059865cad14f54af683bf416ad4439 (patch) | |
tree | 805ef9787e0cd5bf3674e03cc756ef024e4290f3 | |
parent | 1fea66e5279bb0265dfb0089e4253089683d33a1 (diff) |
fix missing null-pointer check
-rw-r--r-- | lib/url.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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 */ |