Skip to content

Commit

Permalink
Fixed buffer size and function name
Browse files Browse the repository at this point in the history
  • Loading branch information
akallabeth committed Aug 27, 2018
1 parent 456b95c commit 5bc3993
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion channels/client/addin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions libfreerdp/crypto/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit 5bc3993

Please sign in to comment.