[SyncEvolution] Broken UTF-8 item passed to backend (was Explicit type 'text/x-vcalendar' specified in command or item meta)

deloptes deloptes at gmail.com
Thu Oct 6 00:26:09 UTC 2016


Patrick Ohly wrote:

> +        // The Nokia N9 vCalendar implementation sends ==0A=0D= at the
> end of +        // the line when it should send just the =. Apparently the
> CRLF octets +        // get inserted before quoted-printable encoding and
> then get encoded. +        // Such a sequence is invalid because = cannot
> be used literally +        // and must be followed by characters
> representing the hex value, +        // i.e. == is already invalid.
> +        //
> +        // We must skip over the entire sequence and continue at the last
> +        // = in ==0A=0D=, otherwise the code below would insert
> additional +        // characters into the decoded text.

This seems to magically work

@@ -1937,6 +1938,23 @@ static void decodeValue(
         uInt16 code;
         const char *s;
         char hex[2];
+
+       // The Nokia N9 vCalendar implementation sends ==0D=0A= at the end
of
+       // the line when it should send just the =. Apparently the CRLF
octets
+       // get inserted before quoted-printable encoding and then get
encoded.
+       // Such a sequence is invalid because = cannot be used literally
+       // and must be followed by characters representing the hex value,
+       // i.e. == is already invalid.
+       //
+       // We must skip over the entire sequence and continue at the last
+       // = in ==0D=0A=, otherwise the code below would insert additional
+       // characters into the decoded text.
+        if (strncmp(p,"==0D=0A=",8)==0) {
+          p += strlen("==0D=0A")-1;
+          // put the cursor at the next useful =
+          p=nextunfolded(p,aMimeMode,true);
+          continue;
+        }
         s=nextunfolded(p,aMimeMode,true);
         if (*s==0) break; // end of string
         hex[0]=*s; // first digit



_______________________________________________
SyncEvolution mailing list
SyncEvolution at syncevolution.org
https://lists.syncevolution.org/mailman/listinfo/syncevolution


More information about the SyncEvolution mailing list