mirror of
https://github.com/openharmony/bundlemanager_bundle_framework_lite.git
synced 2026-07-20 23:55:24 -04:00
!221 BundleParser::ParseAbilityDeviceCap deviceCapObject->valuestring未判断
Merge pull request !221 from sunman4/OpenHarmony-3.0-LTS
This commit is contained in:
@@ -711,8 +711,9 @@ uint8_t BundleParser::ParseAbilityDeviceCap(const cJSON *abilityObjectItem, Abil
|
||||
continue;
|
||||
}
|
||||
deviceCapName = abilityInfo.deviceCap.systemCapName + index;
|
||||
if (strncpy_s(deviceCapName->name, sizeof(deviceCapName->name),
|
||||
deviceCapObject->valuestring, strlen(deviceCapObject->valuestring)) != EOK) {
|
||||
if ((deviceCapObject->valuestring != nullptr) &&
|
||||
(strncpy_s(deviceCapName->name, sizeof(deviceCapName->name),
|
||||
deviceCapObject->valuestring, strlen(deviceCapObject->valuestring)) != EOK)) {
|
||||
HILOG_ERROR(HILOG_MODULE_APP, "ParseAbilityDeviceCap strncpy deviceCap fail!");
|
||||
AdapterFree(abilityInfo.deviceCap.systemCapName);
|
||||
abilityInfo.deviceCap.systemCapNum = 0;
|
||||
|
||||
Reference in New Issue
Block a user