wangyu- / udp2raw

A Tunnel which Turns UDP Traffic into Encrypted UDP/FakeTCP/ICMP Traffic by using Raw Socket,helps you Bypass UDP FireWalls(or Unstable UDP Environment)
MIT License
7.16k stars 1.16k forks source link

fix possible null pointer dereference #493

Closed HiGarfield closed 7 months ago

HiGarfield commented 11 months ago

cppcheck reports:

network.cpp:1717:22: error: Null pointer dereference: payload [ctunullpointer]
    memcpy(tcp_data, payload, payloadlen);
                     ^
client.cpp:193:22: note: Calling function send_raw0, 2nd argument is null
            send_raw0(raw_info, 0, 0);
                     ^
network.cpp:2534:20: note: Calling function send_raw_tcp, 2nd argument is null
            return send_raw_tcp(raw_info, payload, payloadlen);
                   ^
network.cpp:1717:22: note: Dereferencing argument payload that is null
    memcpy(tcp_data, payload, payloadlen);
                     ^