mirror of https://github.com/aria2/aria2
Use len formal parameter of util::parse_content_disposition
parent
5dfd1a5af7
commit
49e9f66c16
|
@ -895,7 +895,7 @@ int parse_content_disposition(char *dest, size_t destlen,
|
||||||
const char **charsetp, size_t *charsetlenp,
|
const char **charsetp, size_t *charsetlenp,
|
||||||
const char *in, size_t len)
|
const char *in, size_t len)
|
||||||
{
|
{
|
||||||
const char *p = in, *mark_first = NULL, *mark_last = NULL;
|
const char *p = in, *eop = in + len, *mark_first = NULL, *mark_last = NULL;
|
||||||
int state = CD_BEFORE_DISPOSITION_TYPE;
|
int state = CD_BEFORE_DISPOSITION_TYPE;
|
||||||
int in_file_parm = 0;
|
int in_file_parm = 0;
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
@ -911,7 +911,7 @@ int parse_content_disposition(char *dest, size_t destlen,
|
||||||
*charsetp = NULL;
|
*charsetp = NULL;
|
||||||
*charsetlenp = 0;
|
*charsetlenp = 0;
|
||||||
|
|
||||||
for(; *p; ++p) {
|
for(; p != eop; ++p) {
|
||||||
switch(state) {
|
switch(state) {
|
||||||
case CD_BEFORE_DISPOSITION_TYPE:
|
case CD_BEFORE_DISPOSITION_TYPE:
|
||||||
if(inRFC2616HttpToken(*p)) {
|
if(inRFC2616HttpToken(*p)) {
|
||||||
|
|
Loading…
Reference in New Issue