3

Here is the code snippet

typedef struct
{
   unsigned char L2maclegacyString2[14];
}L2macLegacyLogPayload;

L2macLegacyLogPayload* _lData_=(L2macLegacyLogPayload*)buffData; 
memccpy(_lData_->L2maclegacyString2,"RACH-RM-Exec",'\0',sizeof(_lData_->L2maclegacyString2)); 

CID 138514 (#2 of 3): Out-of-bounds access (OVERRUN) 10. overrun-buffer-arg: Overrunning array "RACH-RM-Exec" of 13 bytes by passing it to a function which accesses it at byte offset 13 using argument 14U.

Looks like coverity is not following memccpy correctly. Is my understanding correct? If yes, how can I annotate the abobe code to suppress the false coverity error? Thank you very much in advance.

0 Answers0