sysprog21 / vwifi

A virtual wireless device driver for Linux
MIT License
203 stars 39 forks source link

Fix buffer overflow #65

Closed jychen0611 closed 4 months ago

jychen0611 commented 4 months ago

When compiling, the following warning message is generated: "warning: ‘strncpy’ writing 1040 bytes into a region of size 1024 overflows the destination" This is because calloc allocates NLMSG_SPACE(MAX_PAYLOAD) space for nlh, which includes the space for the header, so the actual space available for the message is only MAX_PAYLOAD. @vax-r

vax-r commented 4 months ago

Nice catch ! LGTM .

jserv commented 4 months ago

Thank @jychen0611 for contributing!