mirror of
https://github.com/hufrea/byedpi.git
synced 2024-12-22 22:35:39 +00:00
Remove unnecessary check
This commit is contained in:
parent
64a6989f7a
commit
3ac582550e
14
desync.c
14
desync.c
@ -159,10 +159,9 @@ int disorder_attack(int sfd, char *buffer,
|
|||||||
int oob_attack(int sfd, char *buffer,
|
int oob_attack(int sfd, char *buffer,
|
||||||
ssize_t n, int pos, int fa)
|
ssize_t n, int pos, int fa)
|
||||||
{
|
{
|
||||||
int size = oob_data.size;
|
int size = oob_data.size - 1;
|
||||||
char *data = oob_data.data;
|
char *data = oob_data.data + 1;
|
||||||
|
|
||||||
if (pos < n && size) {
|
|
||||||
char rchar = buffer[pos];
|
char rchar = buffer[pos];
|
||||||
buffer[pos] = data[0];
|
buffer[pos] = data[0];
|
||||||
|
|
||||||
@ -172,18 +171,9 @@ int oob_attack(int sfd, char *buffer,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
buffer[pos] = rchar;
|
buffer[pos] = rchar;
|
||||||
size--;
|
|
||||||
data++;
|
|
||||||
if (size) {
|
if (size) {
|
||||||
delay(params.sfdelay);
|
delay(params.sfdelay);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (send(sfd, buffer, pos, 0) < 0) {
|
|
||||||
uniperror("send");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
if (send(sfd, data + i, 1, MSG_OOB) < 0) {
|
if (send(sfd, data + i, 1, MSG_OOB) < 0) {
|
||||||
uniperror("send");
|
uniperror("send");
|
||||||
|
Loading…
Reference in New Issue
Block a user