mirror of
https://github.com/hufrea/byedpi.git
synced 2024-12-22 14:25:44 +00:00
Fix tlsrec on negative position
This commit is contained in:
parent
b95926d9d2
commit
8116b0de61
10
desync.c
10
desync.c
@ -481,13 +481,13 @@ ssize_t desync(int sfd, char *buffer, size_t bfsize,
|
|||||||
for (int i = 0; i < dp.tlsrec_n; i++) {
|
for (int i = 0; i < dp.tlsrec_n; i++) {
|
||||||
struct part part = dp.tlsrec[i];
|
struct part part = dp.tlsrec[i];
|
||||||
|
|
||||||
long pos = part.pos + i * 5;
|
long pos = i * 5;
|
||||||
if (pos < 0 || part.flag) {
|
pos += gen_offset(part.pos,
|
||||||
|
part.flag, n - pos, lp, type, host_pos, len);
|
||||||
|
|
||||||
|
if (part.pos < 0 || part.flag) {
|
||||||
pos -= 5;
|
pos -= 5;
|
||||||
}
|
}
|
||||||
pos = gen_offset(pos,
|
|
||||||
part.flag, n, lp, type, host_pos, len);
|
|
||||||
|
|
||||||
if (pos < lp) {
|
if (pos < lp) {
|
||||||
LOG(LOG_E, "tlsrec cancel: %ld < %ld\n", pos, lp);
|
LOG(LOG_E, "tlsrec cancel: %ld < %ld\n", pos, lp);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user