mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 08:54:38 +09:00
Fixed buffer size and function name
This commit is contained in:
@@ -130,7 +130,7 @@ FREERDP_ADDIN** freerdp_channels_list_client_static_addins(LPSTR pszName, LPSTR
|
||||
}
|
||||
|
||||
sprintf_s(pAddin->cName, ARRAYSIZE(pAddin->cName), "%s", CLIENT_STATIC_ADDIN_TABLE[i].name);
|
||||
_snprintf(pAddin->cSubsystem, ARRAYSIZE(pAddin->cSubsystem), "%s", subsystems[j].name);
|
||||
sprintf_s(pAddin->cSubsystem, ARRAYSIZE(pAddin->cSubsystem), "%s", subsystems[j].name);
|
||||
pAddin->dwFlags = FREERDP_ADDIN_CLIENT;
|
||||
pAddin->dwFlags |= FREERDP_ADDIN_STATIC;
|
||||
pAddin->dwFlags |= FREERDP_ADDIN_NAME;
|
||||
|
||||
@@ -218,7 +218,7 @@ char* crypto_cert_fingerprint(X509* xcert)
|
||||
UINT32 fp_len;
|
||||
BYTE fp[EVP_MAX_MD_SIZE];
|
||||
X509_digest(xcert, EVP_sha1(), fp, &fp_len);
|
||||
fp_buffer = (char*) calloc(fp_len, 3);
|
||||
fp_buffer = (char*) calloc(fp_len + 1, 3);
|
||||
|
||||
if (!fp_buffer)
|
||||
return NULL;
|
||||
@@ -227,11 +227,11 @@ char* crypto_cert_fingerprint(X509* xcert)
|
||||
|
||||
for (i = 0; i < (fp_len - 1); i++)
|
||||
{
|
||||
sprintf_s(p, fp_len * 3 - i, "%02"PRIx8":", fp[i]);
|
||||
sprintf_s(p, (fp_len - i) * 3, "%02"PRIx8":", fp[i]);
|
||||
p = &fp_buffer[(i + 1) * 3];
|
||||
}
|
||||
|
||||
sprintf_s(p, fp_len * 3 - i, "%02"PRIx8"", fp[i]);
|
||||
sprintf_s(p, (fp_len - i) * 3, "%02"PRIx8"", fp[i]);
|
||||
return fp_buffer;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user