From ae990470960ae42b86fcc41807e56f3904016aab Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Wed, 29 May 2013 16:05:47 +0900 Subject: [PATCH] Fix prevent issues. Change-Id: Ib601a9b9f8a74a625724a4697f2fad4909877582 --- lib/src/icon.c | 15 ++++++++++++--- packaging/libshortcut.spec | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/src/icon.c b/lib/src/icon.c index b4eddce..99d5ea6 100644 --- a/lib/src/icon.c +++ b/lib/src/icon.c @@ -404,9 +404,18 @@ static inline int shortcut_icon_desc_add_block(struct shortcut_desc *handle, con block->idx = handle->last_idx++; handle->block_list = dlist_append(handle->block_list, block); } else { - if (strcmp(block->type, type) || strcmp(block->target_id, target_id)) { - ErrPrint("type or target id is not valid (%s, %s) or (%s, %s)\n", - block->type, type, block->target_id, target_id); + if (strcmp(block->type, type)) { + ErrPrint("type is not valid (%s, %s)\n", block->type, type); + return -EINVAL; + } + + if ((block->target_id && !target_id) || (!block->target_id && target_id)) { + ErrPrint("type is not valid (%s, %s)\n", block->type, type); + return -EINVAL; + } + + if (block->target_id && target_id && strcmp(block->target_id, target_id)) { + ErrPrint("type is not valid (%s, %s)\n", block->type, type); return -EINVAL; } diff --git a/packaging/libshortcut.spec b/packaging/libshortcut.spec index d194ff9..ec95ed2 100644 --- a/packaging/libshortcut.spec +++ b/packaging/libshortcut.spec @@ -1,6 +1,6 @@ Name: libshortcut Summary: Shortcut add feature supporting library -Version: 0.6.2 +Version: 0.6.3 Release: 0 Group: HomeTF/Framework License: Apache License -- 2.7.4