Skip to content

Commit

Permalink
V2 of integrating uAMQP vixes into vendored copy (#5931)
Browse files Browse the repository at this point in the history
  • Loading branch information
LarryOsterman authored Aug 21, 2024
1 parent 40fa516 commit ef53810
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 183 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@ int amqp_frame_codec_encode_frame(AMQP_FRAME_CODEC_HANDLE amqp_frame_codec, uint
}
else
{
PAYLOAD* new_payloads = NULL;
size_t calloc_size = safe_add_size_t(payload_count, 1);
calloc_size = safe_multiply_size_t(calloc_size, sizeof(PAYLOAD));
if (calloc_size == SIZE_MAX ||
(new_payloads = (PAYLOAD*)calloc(1, calloc_size)) == NULL)
PAYLOAD* new_payloads = NULL;
size_t calloc_size = safe_add_size_t(payload_count, 1);
calloc_size = safe_multiply_size_t(calloc_size, sizeof(PAYLOAD));
if (calloc_size == SIZE_MAX ||
(new_payloads = (PAYLOAD*)calloc(1, calloc_size)) == NULL)
{
LogError("Could not allocate frame payloads, size:%zu", calloc_size);
result = MU_FAILURE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5485,6 +5485,7 @@ static int internal_decoder_decode_bytes(INTERNAL_DECODER_DATA* internal_decoder
{
AMQP_VALUE described_value;
internal_decoder_destroy(inner_decoder);
internal_decoder_data->inner_decoder = NULL;

described_value = REFCOUNT_TYPE_CREATE(AMQP_VALUE_DATA);
if (described_value == NULL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1595,9 +1595,7 @@ CONNECTION_HANDLE connection_create2(XIO_HANDLE xio, const char* hostname, const
{
connection->last_frame_sent_time = connection->last_frame_received_time;

/* Codes_S_R_S_CONNECTION_01_072: [When connection_create
* succeeds, the state of the connection shall be
* CONNECTION_STATE_START.] */
/* Codes_S_R_S_CONNECTION_01_072: [When connection_create succeeds, the state of the connection shall be CONNECTION_STATE_START.] */
connection_set_state(connection, CONNECTION_STATE_START);
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/azure-core-amqp/vendor/azure-uamqp-c/src/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ static void link_frame_received(void* context, AMQP_VALUE performative, uint32_t
}
else if (is_flow_type_by_descriptor(descriptor))
{
FLOW_HANDLE flow_handle=NULL;
FLOW_HANDLE flow_handle;
if (amqpvalue_get_flow(performative, &flow_handle) != 0)
{
LogError("Cannot get flow performative");
Expand Down Expand Up @@ -425,6 +425,7 @@ static void link_frame_received(void* context, AMQP_VALUE performative, uint32_t
}
}
}

flow_destroy(flow_handle);
}
}
Expand Down Expand Up @@ -470,7 +471,6 @@ static void link_frame_received(void* context, AMQP_VALUE performative, uint32_t
if ((link_instance->received_payload_size > 0) || more)
{
unsigned char* new_received_payload;;

size_t realloc_size = safe_add_size_t((size_t)link_instance->received_payload_size, payload_size);
if (realloc_size == SIZE_MAX ||
(new_received_payload = (unsigned char*)realloc(link_instance->received_payload, realloc_size)) == NULL)
Expand Down
Loading

0 comments on commit ef53810

Please sign in to comment.