diff options
| author | liuxueli <[email protected]> | 2023-03-15 19:36:33 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2023-03-15 19:36:33 +0800 |
| commit | 31207a118feb72df08d0d8ca1fd480caac507174 (patch) | |
| tree | b85d123a6c9bb371f4c5cec88500c05874ee9729 | |
| parent | 1010ea6bacfe320b6c241e22808f048be513d1bf (diff) | |
TSG-14048: 未对raw_pkt判空,访问非法指针导致段错误v4.2.97
| -rw-r--r-- | src/packet_io/packet_io_marsio.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/packet_io/packet_io_marsio.c b/src/packet_io/packet_io_marsio.c index bd27cbe..1eee02a 100644 --- a/src/packet_io/packet_io_marsio.c +++ b/src/packet_io/packet_io_marsio.c @@ -382,19 +382,20 @@ int marsio_dl_io_raw_pkt_send(void *phandle, unsigned char *data,int datalen, vo send_option = MARSIO_SEND_OPT_FAST;
}
- if(raw_pkt){
+ if(raw_pkt)
+ {
packet_io_hook_sendto(raw_pkt, route_dir, real_buf, (void *)send_mbuf[0]);
+
+ if(ptr_marsio_buff_set_ctrlbuf!=NULL && raw_pkt->is_send_ctrl_pkt==1)
+ {
+ ptr_marsio_buff_set_ctrlbuf(send_mbuf[0]);
+ unsigned short offset=(unsigned short)(ptr_marsio_buff_datalen(send_mbuf[0]) - raw_pkt->payload_len);
+ marsio_update_payload_offset(offset, (void *)send_mbuf[0]);
+ }
}
ptr_marsio_buff_ctrlzone_set(send_mbuf[0], 0, &mr_ctrlzone, sizeof(struct mr_tunnat_ctrlzone));
- if(ptr_marsio_buff_set_ctrlbuf!=NULL && raw_pkt->is_send_ctrl_pkt==1)
- {
- ptr_marsio_buff_set_ctrlbuf(send_mbuf[0]);
- unsigned short offset=(unsigned short)(ptr_marsio_buff_datalen(send_mbuf[0]) - raw_pkt->payload_len);
- marsio_update_payload_offset(offset, (void *)send_mbuf[0]);
- }
-
ret = ptr_marsio_send_burst_with_options((struct mr_sendpath *)arg, thread_seq, send_mbuf, 1, send_option);
if(ret < 0){
return -1;
|
