Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ AC_ARG_ENABLE([gtestapp],
[echo "Gtestapp is disabled"])
AM_CONDITIONAL([WITH_GTEST_SUPPORT], [test x$GTEST_SUPPORT_ENABLED = xtrue])

AC_ARG_ENABLE([cord],
AS_HELP_STRING([--enable-cord],[enable CORD persistent storage support (default is no)]),
[
case "${enableval}" in
yes) CORD_ENABLED=true
CFLAGS="$CFLAGS -DCORD_ENABLED";;
no) CORD_ENABLED=false;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-cord]);;
esac
],
[CORD_ENABLED=false])
AM_CONDITIONAL([WITH_CORD_SUPPORT], [test x$CORD_ENABLED = xtrue])

Comment on lines +43 to +55
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CORD_ENABLED adds new references to cord_* APIs, but the build system here only appends -DCORD_ENABLED to CFLAGS; there’s no library detection/linking (e.g., AC_CHECK_LIB / pkg-config) and WITH_CORD_SUPPORT isn’t referenced elsewhere. As-is, --enable-cord is likely to compile but fail to link (undefined references) or not propagate link flags to the relevant targets. Please add proper dependency checks and wire the conditional into Makefile.am to add the required include/lib flags.

Copilot uses AI. Check for mistakes.
AC_PREFIX_DEFAULT(`pwd`)
AC_ENABLE_SHARED
AC_DISABLE_STATIC
Expand Down
5 changes: 4 additions & 1 deletion scripts/ccsp_restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ exec 3>&1 4>&2 >>$SELFHEALFILE 2>&1
fi
killall CcspLMLite
killall CcspXdnsSsp
if [ "$VOICE_SUPPORTED" != "false" ]; then
if [ -f "/tmp/mta_initialized" ]
then
rm -rf /tmp/mta_initialized
fi
killall CcspMtaAgentSsp
fi
killall CcspHotspot


Expand Down Expand Up @@ -174,6 +176,7 @@ ulimit -c unlimited

sleep 3
#mta
if [ "$VOICE_SUPPORTED" != "false" ]; then
if [ "$MODEL_NUM" = "DPC3939B" ] || [ "$MODEL_NUM" = "DPC3941B" ]; then
echo_t "Disabling MTA for BWG "
else
Expand All @@ -185,7 +188,7 @@ ulimit -c unlimited
$BINPATH/CcspMtaAgentSsp -subsys $Subsys
fi
fi

fi
sleep 3
echo "[`getDateTime`] RDKB_SELFHEAL : Resetting process webpa on atom reset"
cd /usr/ccsp/webpa
Expand Down
2 changes: 2 additions & 0 deletions scripts/cosa_start_arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ if [ "x"$1 = "xkill" ] || [ "x"$2 = "xkill" ]; then
# killall CcspRmSsp
killall CcspCrSsp
# killall CcspLmSsp
if [ "$VOICE_SUPPORTED" != "false" ]; then
killall CcspMtaAgentSsp
fi
killall CcspCMAgentSsp
killall CcspLMLite
killall CcspXdnsSsp
Expand Down
3 changes: 2 additions & 1 deletion scripts/cosa_start_rem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ syscfg set mgmt_wan_sshaccess 1
syscfg commit
echo_t "PWD is `pwd`"


if [ "$VOICE_SUPPORTED" != "false" ]; then
if [ "$MODEL_NUM" = "DPC3939B" ] || [ "$MODEL_NUM" = "DPC3941B" ]; then
echo_t "Disabling MTA for BWG "
else
Expand All @@ -212,6 +212,7 @@ if [ -e ./mta ]; then
cd ..
fi
fi
fi

if [ -e ./moca ]; then
cd moca
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,11 @@ DslhObjcoGetParamValueByName
/*AnscTraceVerbose(("DslhObjcoGetParamValueByName -- name %s\n", pName));*/

/* check whether it's a count of table (xxxNumberOfEntries) or not */
#ifdef _64BIT_ARCH_SUPPORT_
if(pSlapVariable->Syntax == (ULONG)SLAP_VAR_SYNTAX_uint32)
#else
if(pSlapVariable->Syntax == SLAP_VAR_SYNTAX_uint32)
#endif
{
pFind = _ansc_strstr(pName, TR69_NUMBER_OF_ENTRIES_STRING);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@


#include "ansc_uint_array_co_global.h"
#include <stdint.h>


/**********************************************************************
Expand Down Expand Up @@ -276,7 +275,11 @@ AnscUIntArrayGetAt

pStorage = (PUINT)pUIntArray->hStorage;

return (ANSC_OBJECT_ARRAY_DATA)(uintptr_t)pStorage[ulIndex];
#ifdef _64BIT_ARCH_SUPPORT_
return (ANSC_OBJECT_ARRAY_DATA)(ULONG)pStorage[ulIndex];
#else
return (ANSC_OBJECT_ARRAY_DATA)pStorage[ulIndex];
#endif
}

return (ANSC_OBJECT_ARRAY_DATA)NULL;
Expand Down Expand Up @@ -332,7 +335,11 @@ AnscUIntArraySetAt
PUINT pStorage;

pStorage = (PUINT)pUIntArray->hStorage;
pStorage[ulIndex] = (uintptr_t)Data;
#ifdef _64BIT_ARCH_SUPPORT_
pStorage[ulIndex] = (ULONG)Data;
#else
pStorage[ulIndex] = (UINT)Data;
#endif
}
}

Expand Down Expand Up @@ -413,7 +420,11 @@ AnscUIntArrayInsertAt

for (i = 0; i < ulCount; i ++)
{
pStorage[i + ulIndex] = (uintptr_t)Data;
#ifdef _64BIT_ARCH_SUPPORT_
pStorage[i + ulIndex] = (ULONG)Data;
#else
pStorage[i + ulIndex] = (UINT)Data;
#endif
}
}
}
Expand Down Expand Up @@ -528,7 +539,11 @@ AnscUIntArrayAdd
PUINT pStorage;

pStorage = (PUINT)pUIntArray->hStorage;
pStorage[pUIntArray->ulItemCount ++] = (uintptr_t)Data;
#ifdef _64BIT_ARCH_SUPPORT_
pStorage[pUIntArray->ulItemCount ++] = (ULONG)Data;
#else
pStorage[pUIntArray->ulItemCount ++] = (UINT)Data;
#endif

return pUIntArray->ulItemCount;
}
Expand Down Expand Up @@ -661,7 +676,11 @@ AnscUIntArrayFind
LONG Count = pUIntArray->ulItemCount;
LONG i;
PUINT pStorage = (PUINT)pUIntArray->hStorage;
UINT uSample = (uintptr_t)Data;
#ifdef _64BIT_ARCH_SUPPORT_
UINT uSample = (ULONG)Data;
#else
UINT uSample = (UINT)Data;
#endif

for (i = 0; i < Count; i ++)
{
Expand Down
2 changes: 1 addition & 1 deletion source/cosa/utilities/bsp_eng/bspeng_branch_co_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ BspTemplateBranchLoadBranchData
if (!bSucc)
return FALSE;

pBrData->type = (BSP_TEMPLATE_BRANCH_TYPE)ucType;
pBrData->type = (BSP_TEMPLATE_OPERATOR)ucType;
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pBrData->type is declared as BSP_TEMPLATE_BRANCH_TYPE (see bspeng_co_interface.h), but this assignment casts ucType to BSP_TEMPLATE_OPERATOR instead. This changes the meaning of the persisted/loaded branch data and will break the subsequent switch over branch types. Cast to BSP_TEMPLATE_BRANCH_TYPE (as before) so the enum domain matches the field type.

Suggested change
pBrData->type = (BSP_TEMPLATE_OPERATOR)ucType;
pBrData->type = (BSP_TEMPLATE_BRANCH_TYPE)ucType;

Copilot uses AI. Check for mistakes.

Comment on lines +681 to 682
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pBrData->type is declared as BSP_TEMPLATE_BRANCH_TYPE (see bspeng_co_interface.h), but it’s being assigned by casting to BSP_TEMPLATE_OPERATOR. This mixes two unrelated enums and can produce invalid type values, breaking the subsequent switch. Please cast ucType to BSP_TEMPLATE_BRANCH_TYPE (or validate the byte value before assignment).

Suggested change
pBrData->type = (BSP_TEMPLATE_OPERATOR)ucType;
switch (ucType)
{
case BspBranch_eBranch:
case BspBranch_eString:
case BspBranch_eNumber:
case BspBranch_eReal:
case BspBranch_eVar:
case BspBranch_eArrayDim:
case BspBranch_eEmpty:
case BspBranch_eArrayItem:
case BspBranch_eApiParams:
pBrData->type = (BSP_TEMPLATE_BRANCH_TYPE)ucType;
break;
default:
return FALSE;
}

Copilot uses AI. Check for mistakes.
switch (pBrData->type)
{
Expand Down
14 changes: 11 additions & 3 deletions source/cosa/utilities/bsp_eng/bspeng_co_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

**********************************************************************/

#include <stdint.h>

#include "bspeng_co_global.h"
#include "safec_lib_common.h"

Expand Down Expand Up @@ -6198,7 +6198,11 @@ BspTemplateEngGetSlapObjectString

if (pString)
{
rc = sprintf_s(pString, ulSize, "%.08X", (UINT)(uintptr_t)pSlapVar->Variant.varHandle);
#ifdef _64BIT_ARCH_SUPPORT_
rc = sprintf_s(pString, ulSize, "%.08X", (UINT)(ULONG)pSlapVar->Variant.varHandle);
#else
rc = sprintf_s(pString, ulSize, "%.08X", (UINT)pSlapVar->Variant.varHandle);
#endif
if(rc < EOK)
{
ERR_CHK(rc);
Expand Down Expand Up @@ -6417,7 +6421,11 @@ BspTemplateEngGetSlapObjectString
pString + AnscSizeOfString(pString),
ulSize+1,
(i == 0)? "%.08X" : ".%.08X",
(UINT)(uintptr_t)pArray->Array.arrayHandle[i]
#ifdef _64BIT_ARCH_SUPPORT_
(UINT)(ULONG)pArray->Array.arrayHandle[i]
#else
(UINT)pArray->Array.arrayHandle[i]
#endif
);
if(rc < EOK)
{
Expand Down
2 changes: 2 additions & 0 deletions source/debug_api/ansc_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ const char *CcspTraceGetRdkLogModule(const char *pComponentName)
#if !defined (NO_MOCA_FEATURE_SUPPORT)
if (strcmp(pComponentName, "moca") == 0) return "LOG.RDK.MOCA";
#endif
#if !defined (NO_MTA_FEATURE_SUPPORT)
if (strcmp(pComponentName, "mta") == 0) return "LOG.RDK.MTA";
#endif
break;
case 'n':
#if defined (FEATURE_RDKB_NFC_MANAGER)
Expand Down
9 changes: 9 additions & 0 deletions source/debug_api/ansc_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,8 +958,13 @@ AnscTraceMemoryTable2
sprintf
(
pTraceMessage,
#ifdef _64BIT_ARCH_SUPPORT_
" *** mem_block = %p, size = %9d bytes, id = %6d, %s ***",
pMemoryAllocItem->MemoryPointer,
#else
" *** mem_block = 0x%8X, size = %9d bytes, id = %6d, %s ***",
(UINT)pMemoryAllocItem->MemoryPointer,
#endif
(int)pMemoryAllocItem->MemorySize,
(int)pMemoryAllocItem->AllocId,
pMemoryAllocItem->OwnerDesp
Expand Down Expand Up @@ -1444,7 +1449,11 @@ void AnscLiveMemoryInspectRecordDetail

pPrevAllocItem = AnscGetPrevMemoryAllocItem(pMemoryBlock);

#ifdef _64BIT_ARCH_SUPPORT_
printf("found %p\n",pPrevAllocItem);
#else
printf("found %x\n",(UINT)pPrevAllocItem);
#endif

if ( !pPrevAllocItem )
{
Expand Down
8 changes: 8 additions & 0 deletions source/util_api/ansc/AnscPlatform/ansc_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,11 @@ AnscDumpMemory
/*
* Print the address
*/
#ifdef _64BIT_ARCH_SUPPORT_
_ansc_sprintf(PrintBuffer, "%p", pCurr);
#else
_ansc_sprintf(PrintBuffer, "0x%08X", (unsigned int)pCurr);
#endif
_ansc_strcat (PrintBuffer, ": ");

/*
Expand Down Expand Up @@ -691,7 +695,11 @@ AnscDumpMemory
/*
* Print the address
*/
#ifdef _64BIT_ARCH_SUPPORT_
_ansc_sprintf(PrintBuffer, "%p", pCurr);
#else
_ansc_sprintf(PrintBuffer, "0x%08X", (unsigned int)pCurr);
#endif
_ansc_strcat (PrintBuffer, ": " );

/*
Expand Down
23 changes: 19 additions & 4 deletions source/util_api/ansc/AnscPlatform/ansc_file_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

**********************************************************************/

#include <stdint.h>

#include "ansc_platform.h"
#include "ansc_external_storage.h"
#include "ansc_crypto_interface.h"
Expand Down Expand Up @@ -245,7 +245,12 @@ AnscReadFile

if ( pFileInfo->bZlibCompressed )
{
iReturnsize = _ansc_get_file_size((VOID*)(uintptr_t)pFileInfo->Handle);
#ifdef _64BIT_ARCH_SUPPORT_
ULONG uHandle = pFileInfo->Handle;
iReturnsize = _ansc_get_file_size((VOID*)uHandle);
#else
iReturnsize = _ansc_get_file_size((VOID*)pFileInfo->Handle);
#endif
if ( iReturnsize < 0 )
{
return ANSC_STATUS_FAILURE;
Expand Down Expand Up @@ -482,7 +487,12 @@ AnscGetFileSize
{
int iReadSize = (int)0;

iReturnSize = _ansc_get_file_size((VOID*)(uintptr_t)pFileInfo->Handle);
#ifdef _64BIT_ARCH_SUPPORT_
ULONG uHandle = pFileInfo->Handle;
iReturnSize = _ansc_get_file_size((VOID*)uHandle);
#else
iReturnSize = _ansc_get_file_size((VOID*)pFileInfo->Handle);
#endif
if ( iReturnSize < 0 )
{
return 0;
Expand Down Expand Up @@ -536,7 +546,12 @@ AnscGetFileSize
else
{
/*CID: 59651 Improper use of negative value*/
iReturnSize = _ansc_get_file_size((VOID*)(uintptr_t)pFileInfo->Handle);
#ifdef _64BIT_ARCH_SUPPORT_
ULONG uHandle = pFileInfo->Handle;
iReturnSize = _ansc_get_file_size((VOID*)uHandle);
#else
iReturnSize = _ansc_get_file_size((VOID*)pFileInfo->Handle);
#endif
if(iReturnSize < 0)
{
return 0;
Expand Down
12 changes: 8 additions & 4 deletions source/util_api/ansc/AnscPlatform/user_file_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@

#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include "ansc_global.h"

#include "user_base.h"
Expand Down Expand Up @@ -309,9 +308,14 @@ inline int
user_get_file_size(PVOID h)
{
int length = 0;
length = lseek((int)(uintptr_t)h, 0, SEEK_END);
lseek((int)(uintptr_t)h, 0, SEEK_SET);
return length;
#ifdef _64BIT_ARCH_SUPPORT_
length = lseek((int)(ULONG)h, 0, SEEK_END);
lseek((int)(ULONG)h, 0, SEEK_SET);
#else
length = lseek((int)h, 0, SEEK_END);
lseek((int)h, 0, SEEK_SET);
#endif
return length;
}

/*
Expand Down
21 changes: 21 additions & 0 deletions source/util_api/ansc/AnscXmlDomParser/ansc_xml_dom_node_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,17 @@ AnscXmlDomNodeRemove
{
AnscXmlWarning
(
#ifdef _64BIT_ARCH_SUPPORT_
"The child node queue of XML node '%s' is corrupted.cookie1= %p\n",
#else
"The child node queue of XML node '%s' is corrupted.cookie1= 0x%.8X\n",
#endif
(char *)pXmlNode->ChildNodeQueueLock,
#ifdef _64BIT_ARCH_SUPPORT_
(void*)pNameAttr->StringData
#else
(unsigned int)pNameAttr->StringData
Comment on lines 261 to +265
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AnscXmlWarning format string expects the node name for %s and the cookie/lock value for %p/0x%X, but the arguments are reversed (and the first argument is cast from a cookie value to char*). This can crash or print garbage. Pass pNameAttr->StringData (as char*) for %s and the cookie/lock value for the %p/hex placeholder in the correct order.

Suggested change
(char *)pXmlNode->ChildNodeQueueLock,
#ifdef _64BIT_ARCH_SUPPORT_
(void*)pNameAttr->StringData
#else
(unsigned int)pNameAttr->StringData
(char *)pNameAttr->StringData,
#ifdef _64BIT_ARCH_SUPPORT_
(void*)pXmlNode->ChildNodeQueueLock
#else
(unsigned int)pXmlNode->ChildNodeQueueLock

Copilot uses AI. Check for mistakes.
#endif
);
}

Expand All @@ -270,17 +278,30 @@ AnscXmlDomNodeRemove
{
AnscXmlWarning
(
#ifdef _64BIT_ARCH_SUPPORT_
"The child node queue of XML node is corrupted. cookie2= %p\n",
(void*)pXmlNode->AttributesListLock
#else
"The child node queue of XML node is corrupted. cookie2= 0x%.8X\n",
(unsigned int)pXmlNode->AttributesListLock
#endif
);
}
else
{
AnscXmlWarning
(
#ifdef _64BIT_ARCH_SUPPORT_
"The child node queue of XML node '%s' is corrupted.cookie2= %p\n",
#else
"The child node queue of XML node '%s' is corrupted.cookie2= 0x%.8X\n",
#endif
(char *)pXmlNode->AttributesListLock,
#ifdef _64BIT_ARCH_SUPPORT_
(void*)pNameAttr->StringData
#else
(unsigned int)pNameAttr->StringData
Comment on lines 299 to +303
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same argument ordering issue as above: the warning format expects %s for the node name and %p/hex for the cookie/lock value, but the call passes (char*)pXmlNode->AttributesListLock for %s and pNameAttr->StringData for the pointer/hex placeholder. Swap these to match the format string and use correct casts.

Suggested change
(char *)pXmlNode->AttributesListLock,
#ifdef _64BIT_ARCH_SUPPORT_
(void*)pNameAttr->StringData
#else
(unsigned int)pNameAttr->StringData
(char *)pNameAttr->StringData,
#ifdef _64BIT_ARCH_SUPPORT_
(void*)pXmlNode->AttributesListLock
#else
(unsigned int)pXmlNode->AttributesListLock

Copilot uses AI. Check for mistakes.
#endif
Comment on lines +294 to +304
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same argument-order issue for the cookie2 warning: the %s placeholder should receive the node name (pNameAttr->StringData), but pXmlNode->AttributesListLock is currently passed as the string. This can lead to invalid memory reads/crashes in the warning path. Please fix the argument order and use a cookie format that matches the cookie’s type.

Copilot uses AI. Check for mistakes.
);
}

Expand Down
Loading
Loading