Skip to content

Commit

Permalink
arc_canon_strip_b: account for FWS around the '='
Browse files Browse the repository at this point in the history
  • Loading branch information
flowerysong committed Nov 2, 2024
1 parent c3f8d0d commit eb89e81
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions libopenarc/arc-canon.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,10 @@ arc_canon_strip_b(ARC_MESSAGE *msg, char *text)
tmp = tmpbuf;
end = tmpbuf + sizeof tmpbuf - 1;

/* FIXME: this looks overly simplistic. tag-lists are allowed to
* contain FWS, and headers are allowed to contain CFWS.
/* Strictly speaking this is wrong, RFC 8617 allows CFWS around i=
* and cv= so this code could be confused by interestingly-shaped
* comments, but that part of the syntax is different from all other
* tag-lists so we're going to pretend it says FWS.
*/
for (p = text; *p != '\0'; p++)
{
Expand Down Expand Up @@ -1004,7 +1006,10 @@ arc_canon_strip_b(ARC_MESSAGE *msg, char *text)
tmp = tmpbuf;
}

last = *p;
if (!isspace(*p))
{
last = *p;
}
}

/* flush anything cached */
Expand Down

0 comments on commit eb89e81

Please sign in to comment.