unittest: Skip string test case for sizeof (src) > sizeof (dst) 29/25429/2
authorSteven Luong <sluong@cisco.com>
Tue, 25 Feb 2020 19:06:17 +0000 (11:06 -0800)
committerDave Barach <openvpp@barachs.net>
Tue, 25 Feb 2020 22:36:54 +0000 (22:36 +0000)
coverity complains that the subject test may cause dst buffer overrun
problem and it is right. The problem is when __builtin_constant_p (n)
returns true, memcpy_s_inline skips all the errors checking and does the
copy blindly. Please see the code in memcpy_s_inline.

The fix is to skip the subject test when the aformentioned builtin function
returns true.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I50de91cc0c853a134b3bcf3b0cd8d45d7668b092


No differences found