1
0
mirror of https://github.com/coturn/coturn.git synced 2025-11-01 07:21:04 +01:00

Fix off-by-one when terminating gcm_nonce (#1039)

The `gcm_nonce` character array is `12 + 1` chars long. Writing to
`gcm_nonce[12 + 1]` overflows the array by one char.
This commit is contained in:
Gregor Jasny 2022-10-24 22:35:09 +02:00 committed by GitHub
parent 6f14716149
commit f488aa6921
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -337,7 +337,7 @@ int main(int argc, char **argv)
nonce_size=OAUTH_GCM_NONCE_SIZE;
}
strncpy(gcm_nonce,nonce_val,nonce_size);
gcm_nonce[ nonce_size + 1 ]='\0';
gcm_nonce[ nonce_size ]='\0';
break;
case 'p':
//token-mac-key