- code format update in mms_server_common.c and additional NULL check after memory allocation

v1.6
Michael Zillgith 4 weeks ago
parent a4c750820b
commit 3a9833bad1

@ -46,10 +46,12 @@ mmsServer_createConfirmedResponse(uint32_t invokeId)
{
MmsPdu_t* mmsPdu = (MmsPdu_t*)GLOBAL_CALLOC(1, sizeof(MmsPdu_t));
if (mmsPdu)
{
mmsPdu->present = MmsPdu_PR_confirmedResponsePdu;
asn_long2INTEGER(&(mmsPdu->choice.confirmedResponsePdu.invokeID),
invokeId);
asn_long2INTEGER(&(mmsPdu->choice.confirmedResponsePdu.invokeID), invokeId);
}
return mmsPdu;
}
@ -57,8 +59,8 @@ mmsServer_createConfirmedResponse(uint32_t invokeId)
static void
mapErrorTypeToErrorClass(MmsError errorType, uint8_t* tag, uint8_t* value)
{
switch (errorType) {
switch (errorType)
{
case MMS_ERROR_ACCESS_OBJECT_ACCESS_UNSUPPORTED:
*tag = 0x87; /* access */
*value = 1;
@ -361,24 +363,21 @@ exit_function:
int
mmsServer_getLowIndex(AlternateAccess_t* alternateAccess)
{
if (alternateAccess->list.array[0]->choice.unnamed->choice.selectAccess.present
== AlternateAccessSelection__selectAccess_PR_index)
if (alternateAccess->list.array[0]->choice.unnamed->choice.selectAccess.present ==
AlternateAccessSelection__selectAccess_PR_index)
{
long index;
asn_INTEGER2long(
&alternateAccess->list.array[0]->choice.unnamed->choice.selectAccess.choice.index,
&index);
asn_INTEGER2long(&alternateAccess->list.array[0]->choice.unnamed->choice.selectAccess.choice.index, &index);
return (int)index;
}
if (alternateAccess->list.array[0]->choice.unnamed->choice.selectAccess.present
== AlternateAccessSelection__selectAccess_PR_indexRange)
if (alternateAccess->list.array[0]->choice.unnamed->choice.selectAccess.present ==
AlternateAccessSelection__selectAccess_PR_indexRange)
{
long index;
asn_INTEGER2long(
&alternateAccess->list.array[0]->choice.unnamed->choice.selectAccess.choice.indexRange.lowIndex,
&index);
&alternateAccess->list.array[0]->choice.unnamed->choice.selectAccess.choice.indexRange.lowIndex, &index);
return (int)index;
}
@ -389,8 +388,8 @@ mmsServer_getLowIndex(AlternateAccess_t* alternateAccess)
int
mmsServer_getNumberOfElements(AlternateAccess_t* alternateAccess)
{
if (alternateAccess->list.array[0]->choice.unnamed->choice.selectAccess.present
== AlternateAccessSelection__selectAccess_PR_indexRange)
if (alternateAccess->list.array[0]->choice.unnamed->choice.selectAccess.present ==
AlternateAccessSelection__selectAccess_PR_indexRange)
{
long number;

Loading…
Cancel
Save