summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author杨威 <[email protected]>2023-07-04 16:42:41 +0800
committer杨威 <[email protected]>2023-07-04 16:42:41 +0800
commit9ea6b23d2bfb437d7fdf701d31c7b93c43c63c57 (patch)
treea2cd07776cc656f3460166e309816708e3fe84b9
parentb2bec2e92c55d57c7950dae580071ae29bbd4818 (diff)
🐞 fix(tcp_deal_data_stream): 修复可能在tcp_free_stream后非法访存的bugv4.3.13
-rw-r--r--src/dealpkt/deal_tcp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dealpkt/deal_tcp.c b/src/dealpkt/deal_tcp.c
index fa140d9..dd9d32c 100644
--- a/src/dealpkt/deal_tcp.c
+++ b/src/dealpkt/deal_tcp.c
@@ -3120,8 +3120,9 @@ static int deal_tcp_stream(struct streamindex *pindex, const void *this_iphdr, s
return ret;
}
+ pdetail_pr =(struct tcpdetail_private*)(pstream->pdetail);
//adjust by lqy 20150107 Ϊ�˷�ֹSYN�ؽ�����ʱSYN�ڵ�һ��������
- if((0 == call_tcpall_after_reset) && pindex_tcp && (pstream->pktstate!=OP_STATE_CLOSE))
+ if((pdetail_pr != NULL) && (0 == call_tcpall_after_reset) && pindex_tcp && (pstream->pktstate!=OP_STATE_CLOSE))
{
//ȫ���ӿ��õ�������ָ��ǰ����ԭʼ����
if(tcplen == 0)
@@ -3144,8 +3145,10 @@ static int deal_tcp_stream(struct streamindex *pindex, const void *this_iphdr, s
goto fun_exit;
}
}
-
- if(pdetail_pr->offload_stream_flag==(SMART_OFFLOAD_FLAG_TCP|SMART_OFFLOAD_FLAG_TCPALL) && DROP!=ret && (g_CurrentTime > pdetail_pr->offload_stream_timestamp_s))
+ if(pdetail_pr != NULL
+ && pdetail_pr->offload_stream_flag==(SMART_OFFLOAD_FLAG_TCP|SMART_OFFLOAD_FLAG_TCPALL)
+ && DROP!=ret
+ && (g_CurrentTime > pdetail_pr->offload_stream_timestamp_s))
{
local_sys_stat->count[SAPP_STAT_TCP_OFFLOAD_STREAM]++;
MESA_send_smart_offload(pstream, (const void *)raw_pkt, pstream->threadnum);