protocol: fix host origin checking

Thanks @ben365 (#75)
This commit is contained in:
Shuanglei Tao
2017-10-24 20:24:51 +08:00
parent 7a25074b4f
commit 784ac09f05
2 changed files with 22 additions and 15 deletions

View File

@@ -270,7 +270,7 @@ main(int argc, char **argv) {
}
break;
case 'i':
strncpy(iface, optarg, sizeof(iface));
strncpy(iface, optarg, sizeof(iface) - 1);
iface[sizeof(iface) - 1] = '\0';
break;
case 'c':