[Modify] Break if it cannot be decoded

This commit is contained in:
sta 2018-11-16 19:53:20 +09:00
parent ad2046a123
commit f2ceac67a4

View File

@ -508,18 +508,12 @@ namespace WebSocketSharp.Net
var c = (char) b; var c = (char) b;
if (c == '%') { if (c == '%') {
if (i > end - 2) { if (i > end - 2)
buff.Write (bytes, i, end - i + 1);
break; break;
}
var num = getNumber (bytes, i + 1, 2); var num = getNumber (bytes, i + 1, 2);
if (num == -1) { if (num == -1)
buff.Write (bytes, i, 3); break;
i += 2;
continue;
}
buff.WriteByte ((byte) num); buff.WriteByte ((byte) num);
i += 2; i += 2;