From: Sunggyu Choi Date: Fri, 20 Apr 2018 06:03:13 +0000 (+0900) Subject: Fix buffer size for resolving coverity issue - 111299 X-Git-Tag: submit/tizen/20180420.060534^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0dbe39458967667aba50083db6cc03ee50de9978;p=platform%2Fcore%2Fapi%2Fcommon.git Fix buffer size for resolving coverity issue - 111299 Change-Id: I2938875f0e7208b4cfa6d7298321e1053facec4c Signed-off-by: Sunggyu Choi --- diff --git a/packaging/capi-base-common.spec b/packaging/capi-base-common.spec index 0020b9a..742643b 100644 --- a/packaging/capi-base-common.spec +++ b/packaging/capi-base-common.spec @@ -1,6 +1,6 @@ Name: capi-base-common Summary: Common header files of Tizen Native API -Version: 0.4.24 +Version: 0.4.25 Release: 1 Group: Base License: Apache-2.0 diff --git a/src/tizen_error.c b/src/tizen_error.c index c31e6e4..03de2a9 100644 --- a/src/tizen_error.c +++ b/src/tizen_error.c @@ -66,11 +66,11 @@ char *get_error_message(int err_code) } else if (err_code >= TIZEN_ERROR_MIN_PLATFORM_ERROR && err_code < TIZEN_ERROR_END_OF_COLLECTION) { tmp = _get_error_message(err_code); if (tmp != NULL) - strncpy(msg, tmp, sizeof(msg)); + strncpy(msg, tmp, sizeof(msg) - 1); } else if (err_code >= TIZEN_ERROR_MIN_PLATFORM_MODULE && err_code < -0x009F0000) { tmp = _get_error_message(err_code); if (tmp != NULL) - strncpy(msg, tmp, sizeof(msg)); + strncpy(msg, tmp, sizeof(msg) - 1); } else {; } return msg;