From: Karol Pawlowski Date: Tue, 16 Apr 2013 14:31:56 +0000 (+0200) Subject: Buffer not null terminated X-Git-Tag: accepted/tizen_2.1/20130425.023916~5^2~18^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee2fed50d786cfaa7a3e46aae738efc16aa73b27;p=framework%2Fweb%2Fwrt-installer.git Buffer not null terminated [Issue#] N/A [Feature/Bug] N/A [Problem] The string buffer may not have a null terminator [Cause] Coverity warnings [Solution] Strings possible length decremented Change-Id: I90bfeec77c4731ac06dd279ef2da1e486d1e41f2 --- diff --git a/src/pkg-manager/backendlib.cpp b/src/pkg-manager/backendlib.cpp index e569561..5637e1f 100644 --- a/src/pkg-manager/backendlib.cpp +++ b/src/pkg-manager/backendlib.cpp @@ -368,7 +368,7 @@ int getWidgetDetailInfoFromPackage(const char* pkgPath, if (!configInfo.tizenAppId.IsNull()) { strncpy(pkg_detail_info->pkg_name, DPL::ToUTF8String(*configInfo.tizenAppId).c_str(), - PKG_NAME_STRING_LEN_MAX); + PKG_NAME_STRING_LEN_MAX - 1); } if (!configInfo.version.IsNull()) { strncpy(pkg_detail_info->version, @@ -410,7 +410,7 @@ int getWidgetDetailInfoFromPackage(const char* pkgPath, if (!configInfo.tizenMinVersionRequired.IsNull()) { strncpy(pkg_detail_info->min_platform_version, DPL::ToUTF8String(*configInfo.tizenMinVersionRequired).c_str(), - PKG_VERSION_STRING_LEN_MAX); + PKG_VERSION_STRING_LEN_MAX - 1); } if (!configInfo.authorName.IsNull()) {