You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplified illegal ctrl char ccheck logic for quoted-strings in addr-specs
Also added definition obs-qp for reference and explained why we are not
going to support escaped ctrl characters even though, technically, obs-qp
allows them (the newer syntax does not).
@@ -348,14 +356,16 @@ static bool SkipQuoted (byte[] text, ref int index, int endIndex, bool throwOnEr
348
356
// to that, obs-qtext also explicitly allows linear whitespace (SPACE %d32 and HTAB %d09), so
349
357
// the only characters that are not allowed are the control characters (%d0-8 and %d10-31),
350
358
// the double-quote character (%d34), and the delete character (%d127).
351
-
if(c<9||(c>9&&c<32)||c==34||c==127){
359
+
if((c<32&&c!=9)||c==127){
352
360
if(throwOnError)
353
361
thrownewParseException(string.Format(CultureInfo.InvariantCulture,"Invalid character in quoted-string token at offset {0}",startIndex),startIndex,index);
354
362
355
363
returnfalse;
356
364
}
357
365
}else{
358
-
if(c<9||(c>9&&c<32)||c==127){
366
+
// Note: We are going to make the decision to not support any escaped ctrl characters even
367
+
// though they are allowed by obs-qp. They are just too dangerous.
368
+
if((c<32&&c!=9)||c==127){
359
369
if(throwOnError)
360
370
thrownewParseException(string.Format(CultureInfo.InvariantCulture,"Invalid quoted-pair in quoted-string token at offset {0}",startIndex),startIndex,index);
0 commit comments