mirror of
https://github.com/bol-van/zapret2.git
synced 2026-03-13 22:03:09 +00:00
AI fixes
This commit is contained in:
@@ -803,8 +803,8 @@ static BOOL RemoveTokenPrivs(void)
|
||||
if (memcmp(&privs->Privileges[k].Luid, &luid_SeChangeNotifyPrivilege, sizeof(LUID)))
|
||||
privs->Privileges[k].Attributes = SE_PRIVILEGE_REMOVED;
|
||||
}
|
||||
bRes = AdjustTokenPrivileges(hToken, FALSE, privs, dwSize, NULL, NULL);
|
||||
}
|
||||
bRes = AdjustTokenPrivileges(hToken, FALSE, privs, dwSize, NULL, NULL);
|
||||
free(privs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2003,7 +2003,7 @@ static uint8_t dpi_desync_icmp_packet(
|
||||
// invert direction. they are answering to this packet
|
||||
bReverse = !bReverse;
|
||||
DLOG("found conntrack entry. inverted reverse=%u\n",bReverse);
|
||||
if (ctrack->dp_search_complete)
|
||||
if (ctrack->dp_search_complete && ctrack->dp)
|
||||
{
|
||||
// RELATED icmp processed within base connection profile
|
||||
dp = ctrack->dp;
|
||||
|
||||
21
nfq2/lua.c
21
nfq2/lua.c
@@ -1905,11 +1905,24 @@ static bool lua_reconstruct_ip6exthdr(lua_State *L, int idx, struct ip6_hdr *ip6
|
||||
lua_getfield(L,-1, "data");
|
||||
if (lua_type(L,-1)!=LUA_TSTRING) goto err;
|
||||
if (!(p=(uint8_t*)lua_tolstring(L,-1,&l))) l=0;
|
||||
if (l<6 || (l+2)>left || (type==IPPROTO_AH ? (l>=1024 || ((l+2) & 3)) : (l>=2048 || ((l+2) & 7)))) goto err;
|
||||
memcpy(data+2,p,l);
|
||||
l+=2;
|
||||
|
||||
if (l<6 || (l+2)>left) goto err;
|
||||
if (type==IPPROTO_AH)
|
||||
{
|
||||
if (l>=1024 || ((l+2) & 3)) goto err;
|
||||
memcpy(data+2,p,l);
|
||||
l+=2;
|
||||
data[1] = (l>>2)-2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (l>=2048 || ((l+2) & 7)) goto err;
|
||||
memcpy(data+2,p,l);
|
||||
l+=2;
|
||||
data[1] = (l>>3)-1;
|
||||
}
|
||||
|
||||
data[0] = next; // may be overwritten later
|
||||
data[1] = (type==IPPROTO_AH) ? (l>>2)-2 : (l>>3)-1;
|
||||
if (!preserve_next) *last_proto = type;
|
||||
last_proto = data; // first byte of header holds type
|
||||
left -= l; data += l; filled += l;
|
||||
|
||||
@@ -260,8 +260,8 @@ static int nfq_cb(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, struct nfq_da
|
||||
uint32_t mark;
|
||||
struct ifreq ifr_in, ifr_out;
|
||||
|
||||
ph = nfq_get_msg_packet_hdr(nfa);
|
||||
id = ph ? ntohl(ph->packet_id) : 0;
|
||||
if (!(ph = nfq_get_msg_packet_hdr(nfa))) return 0; // should not happen
|
||||
id = ntohl(ph->packet_id);
|
||||
|
||||
mark = nfq_get_nfmark(nfa);
|
||||
ilen = nfq_get_payload(nfa, &data);
|
||||
@@ -666,6 +666,7 @@ static int dvt_main(void)
|
||||
if (rd < 0)
|
||||
{
|
||||
DLOG_PERROR("recvfrom");
|
||||
if (errno==ENOBUFS) continue;
|
||||
goto exiterr;
|
||||
}
|
||||
else if (rd > 0)
|
||||
|
||||
@@ -565,7 +565,7 @@ bool TLSFindExtLenOffsetInHandshake(const uint8_t *data, size_t len, size_t *off
|
||||
}
|
||||
bool TLSFindExtLen(const uint8_t *data, size_t len, size_t *off)
|
||||
{
|
||||
if (!TLSFindExtLenOffsetInHandshake(data+5,len-5,off))
|
||||
if (len<5 || !TLSFindExtLenOffsetInHandshake(data+5,len-5,off))
|
||||
return false;
|
||||
*off+=5;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user