From: Daniel Stenberg Date: Fri, 30 Mar 2007 20:52:42 +0000 (+0000) Subject: Pointer "cur_pos" dereferenced before NULL check, found by coverity.com scan. X-Git-Tag: curl-7_16_2~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74e54c5a49aab4e71439b905f40c7b35d13258a2;p=thirdparty%2Fcurl.git Pointer "cur_pos" dereferenced before NULL check, found by coverity.com scan. Removed the NULL check since the pointer must be valid already. --- diff --git a/lib/ftp.c b/lib/ftp.c index 4fe25dc973..eb92a67f47 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -3674,7 +3674,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn) case FTPFILE_SINGLECWD: /* get the last slash */ slash_pos=strrchr(cur_pos, '/'); - if(slash_pos || !cur_pos || !*cur_pos) { + if(slash_pos || !*cur_pos) { ftpc->dirdepth = 1; /* we consider it to be a single dir */ ftpc->dirs = (char **)calloc(1, sizeof(ftpc->dirs[0])); if(!ftpc->dirs)