Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

小修小补 #86

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

小修小补 #86

wants to merge 2 commits into from

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