Unverified Commit c95c92da authored by Kristiyan Tsaklev's avatar Kristiyan Tsaklev Committed by Daniel Stenberg
Browse files

curl: don't pass semicolons when parsing Content-Disposition

Test 1422 updated to verify.

Closes #1964
parent 06cb8add
Loading
Loading
Loading
Loading
+6 −9
Original line number Original line Diff line number Diff line
@@ -161,8 +161,13 @@ static char *parse_filename(const char *ptr, size_t len)
  else
  else
    stop = ';';
    stop = ';';


  /* scan for the end letter and stop there */
  q = strchr(p, stop);
  if(q)
    *q = '\0';

  /* if the filename contains a path, only use filename portion */
  /* if the filename contains a path, only use filename portion */
  q = strrchr(copy, '/');
  q = strrchr(p, '/');
  if(q) {
  if(q) {
    p = q + 1;
    p = q + 1;
    if(!*p) {
    if(!*p) {
@@ -183,14 +188,6 @@ static char *parse_filename(const char *ptr, size_t len)
    }
    }
  }
  }


  /* scan for the end letter and stop there */
  for(q = p; *q; ++q) {
    if(*q == stop) {
      *q = '\0';
      break;
    }
  }

  /* make sure the file name doesn't end in \r or \n */
  /* make sure the file name doesn't end in \r or \n */
  q = strchr(p, '\r');
  q = strchr(p, '\r');
  if(q)
  if(q)
+1 −1
Original line number Original line Diff line number Diff line
@@ -16,7 +16,7 @@ Server: test-server/fake
Content-Length: 0
Content-Length: 0
Connection: close
Connection: close
Content-Type: text/html
Content-Type: text/html
Content-Disposition: filename=name1422; charset=funny; option=strange
Content-Disposition: filename=name1422; charset=funny; option=str//nge


</data>
</data>
</reply>
</reply>