It looks like a S/W bug to me in utils/cmdline.c Can someone at TI have a look?
I am getting faults due to memory dereferences beyond the end of the command table.
See code line approx 152.
When the command is not found in the command table it increments pCmdEntry past the end of the table.
Then the argument to the next test of the while loop dereferences that pointer . The argument of the while() is a POINTER to a char and is NOT NULL.
On the other hand the inline comments suggent the table is terminated by a NULL command string. This would require a dereference in the while argument and an additional null entry into the table which is not shown in the exaple code.
What was the intent: null string or null pointer?
Thanks
-A
//
// Search through the command table until a null command string is
// found, which marks the end of the table.
//
while(pCmdEntry->pcCmd)
---------------------------
if(argc)
{
//
// Start at the beginning of the command table, to look for a matching
// command.
//
pCmdEntry = &g_sCmdTable[0];
//
// Search through the command table until a null command string is
// found, which marks the end of the table.
//
while(pCmdEntry->pcCmd)
{
//
// If this command entry command string matches argv[0], then call
// the function for this command, passing the command line
// arguments.
//
if(!strcmp(argv[0], pCmdEntry->pcCmd))
{
return(pCmdEntry->pfnCmd(argc, argv));
}
//
// Not found, so advance to the next entry.
//
pCmdEntry++;
}
}