提交 3bba8475 编写于 作者: W wujing 提交者: lifeng68

enhanced string verification

Signed-off-by: Nwujing <wujing50@huawei.com>
上级 195b0cb2
......@@ -1227,7 +1227,7 @@ static int fetch_layers(pull_descriptor *desc)
if (list != NULL) {
for (j = 0; j < list->layers_len; j++) {
if ((list->layers[j]->parent == NULL && i == 0) ||
(parent_chain_id != NULL &&
(parent_chain_id != NULL && list->layers[j]->parent != NULL &&
!strcmp(list->layers[j]->parent, without_sha256_prefix(parent_chain_id)))) {
desc->layers[i].already_exist = true;
desc->layers[i].diff_id = util_strdup_s(list->layers[j]->uncompressed_digest);
......
......@@ -734,7 +734,8 @@ static int get_layers_from_manifest(const registry_manifest_schema1 *manifest, l
if (list != NULL) {
for (j = 0; j < list->layers_len; j++) {
if ((list->layers[j]->parent == NULL && index == 0) ||
(parent_chain_id != NULL && !strcmp(list->layers[j]->parent, without_sha256_prefix(parent_chain_id)))) {
(parent_chain_id != NULL && list->layers[j]->parent != NULL &&
!strcmp(list->layers[j]->parent, without_sha256_prefix(parent_chain_id)))) {
layers[index].diff_id = util_strdup_s(list->layers[j]->uncompressed_digest);
layers[i].chain_id = util_string_append(list->layers[j]->id, SHA256_PREFIX);
parent_chain_id = layers[i].chain_id;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册