Fix missing strncpy in fix_stun_check_message_integrity_str (#1282)
Co-authored-by: Gustavo Garcia <gustavogb@mail.com> Co-authored-by: Pavel Punsky <eakraly@users.noreply.github.com>
This commit is contained in:
parent
213ecd3388
commit
597b36c5a2
@ -1967,10 +1967,12 @@ int stun_check_message_integrity_str(turn_credential_type ct, uint8_t *buf, size
|
||||
hmackey_t key;
|
||||
password_t pwd;
|
||||
|
||||
if (ct == TURN_CREDENTIALS_SHORT_TERM)
|
||||
strncpy((char *)pwd, (const char *)upwd, sizeof(password_t));
|
||||
else if (stun_produce_integrity_key_str(uname, realm, upwd, key, shatype) < 0)
|
||||
if (ct == TURN_CREDENTIALS_SHORT_TERM) {
|
||||
len = strncpy((char *)pwd, (const char *)upwd, sizeof(password_t) - 1);
|
||||
pwd[sizeof(password_t) - 1] = 0;
|
||||
} else if (stun_produce_integrity_key_str(uname, realm, upwd, key, shatype) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return stun_check_message_integrity_by_key_str(ct, buf, len, key, pwd, shatype);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user