Merge pull request #12382 from akallabeth/fix-issues

Fix some checks
This commit is contained in:
akallabeth
2026-02-26 14:08:35 +01:00
committed by GitHub
2 changed files with 21 additions and 6 deletions

View File

@@ -1055,6 +1055,8 @@ static BOOL s_update_end_paint(rdpContext* context)
return FALSE;
wStream* s = update->us;
update->us = NULL;
Stream_SealLength(s);
Stream_SetPosition(s, update->offsetOrders);
Stream_Write_UINT16(s, update->numberOrders); /* numberOrders (2 bytes) */
@@ -1070,7 +1072,7 @@ static BOOL s_update_end_paint(rdpContext* context)
update->combineUpdates = FALSE;
update->numberOrders = 0;
update->offsetOrders = 0;
update->us = NULL;
rc = TRUE;
fail:
Stream_Free(s, TRUE);

View File

@@ -439,16 +439,28 @@ error:
* @return new X.509 certificate chain
*/
static rdpX509CertChain certificate_new_x509_certificate_chain(UINT32 count)
static BOOL certificate_new_x509_certificate_chain(UINT32 count, wStream* s,
rdpX509CertChain* chain)
{
WINPR_ASSERT(chain);
rdpX509CertChain x509_cert_chain = WINPR_C_ARRAY_INIT;
*chain = x509_cert_chain;
if (!Stream_CheckAndLogRequiredCapacityOfSize(TAG, s, count, sizeof(rdpCertBlob)))
return FALSE;
if (count == 0)
return TRUE;
x509_cert_chain.array = (rdpCertBlob*)calloc(count, sizeof(rdpCertBlob));
if (!x509_cert_chain.array)
return FALSE;
if (x509_cert_chain.array)
x509_cert_chain.count = count;
x509_cert_chain.count = count;
return x509_cert_chain;
*chain = x509_cert_chain;
return TRUE;
}
/**
@@ -1039,7 +1051,8 @@ static BOOL certificate_read_server_x509_certificate_chain(rdpCertificate* cert,
Stream_Read_UINT32(s, numCertBlobs); /* numCertBlobs */
certificate_free_x509_certificate_chain(&cert->x509_cert_chain);
cert->x509_cert_chain = certificate_new_x509_certificate_chain(numCertBlobs);
if (!certificate_new_x509_certificate_chain(numCertBlobs, s, &cert->x509_cert_chain))
return FALSE;
for (UINT32 i = 0; i < cert->x509_cert_chain.count; i++)
{