Skip to content

Conversation

@chenjunyu19
Copy link
Contributor

  1. 把上一次 PR(Fix crash on DHCP double auth and some other memory issues #80)里的“将最后一字节置零来保证 null-terminated”替换为了 strndup 自动置零
  2. IFNAMSIZ 是包含空终止字符的缓冲区大小,因此需要限制用户输入的网络界面名字符串长度为 IFNAMSIZ - 1

The <net/if.h> header shall define the following symbolic constant for the length of a buffer containing an interface name (including the terminating NULL character): IF_NAMESIZE Interface name length.

Buffer size is not string length. According to the manual, the size of buffer includes the terminating NULL character.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant