tests: libs: Fix string overflow

This fixes a string overflow past the end of a buffer
which was reported by coverity.

Coverity-CID: 152044

Change-Id: I5b331135e338fa43b5589a9488b06367e8cad5a7
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
This commit is contained in:
Jithu Joseph 2016-11-17 15:26:08 -08:00 committed by Anas Nashif
commit e8c7c0b400

View file

@ -271,9 +271,9 @@ int strcpy_test(void)
TC_PRINT("\tstrcpy ...\t");
memset(buffer, '\0', BUFSIZE);
strcpy(buffer, "10 chars!!\0");
strcpy(buffer, "10 chars!\0");
if (strcmp(buffer, "10 chars!!\0") != 0) {
if (strcmp(buffer, "10 chars!\0") != 0) {
TC_PRINT("failed\n");
return TC_FAIL;
}