Fix buffer size for resolving coverity issue - 111299 82/176582/1 accepted/tizen/unified/20180423.062800 submit/tizen/20180420.060534
authorSunggyu Choi <sunggyu.choi@samsung.com>
Fri, 20 Apr 2018 06:03:13 +0000 (15:03 +0900)
committerSunggyu Choi <sunggyu.choi@samsung.com>
Fri, 20 Apr 2018 06:03:13 +0000 (15:03 +0900)
Change-Id: I2938875f0e7208b4cfa6d7298321e1053facec4c
Signed-off-by: Sunggyu Choi <sunggyu.choi@samsung.com>
packaging/capi-base-common.spec
src/tizen_error.c

index 0020b9a..742643b 100644 (file)
@@ -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
index c31e6e4..03de2a9 100644 (file)
@@ -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;