Fix bound check

This commit is contained in:
Zhi Guan
2026-06-17 15:56:18 +08:00
parent b0928e7321
commit be94ca8268
3 changed files with 4 additions and 3 deletions

View File

@@ -383,7 +383,7 @@ int tls13_client_main(int argc, char *argv[])
} else if (!strcmp(*argv, "-psk_dhe_ke")) {
psk_dhe_ke = 1;
} else if (!strcmp(*argv, "-psk_identity")) {
if (psk_identities_cnt > sizeof(psk_identities)/sizeof(psk_identities[0])) {
if (psk_identities_cnt >= sizeof(psk_identities)/sizeof(psk_identities[0])) {
fprintf(stderr, "%s: too many -psk_identity options\n", prog);
return -1;
}