1
0
mirror of https://github.com/coturn/coturn.git synced 2025-10-24 20:41:03 +02:00

Fix buffer overflow in generate_enc_password with increase rsalt by 2 (#1463)

before this change i see a bufferflow during `readable_string`.
This commit is contained in:
Stefan Junker 2024-05-04 18:26:35 +02:00 committed by GitHub
parent e1d8661b40
commit 158fe9b698
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -292,8 +292,9 @@ static void readable_string(unsigned char *orig, unsigned char *out, size_t sz)
out[0] = 0;
for (i = 0; i < sz; ++i) {
snprintf((char *)(out + (i * 2)), 4, "%02x", (unsigned int)orig[i]);
snprintf((char *)(out + (i * 2)), 3, "%02x", (unsigned int)orig[i]);
}
out[sz * 2] = 0;
}
static void generate_enc_password(const char *pwd, char *result, const unsigned char *orig_salt) {