summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinkyu Kang <mk7.kang@samsung.com>2015-10-13 05:45:20 (GMT)
committerMinkyu Kang <mk7.kang@samsung.com>2015-10-13 06:38:10 (GMT)
commit80f7a7d15c4a0e4dcfa7b948c8b97eed77268df0 (patch)
tree63589f0f0c651b0c4b28ee970c136316ff6d5787
parent39c36ee8d933b4e613a70c06dbf0e572bad5a2ba (diff)
downloadair_mediahub-80f7a7d15c4a0e4dcfa7b948c8b97eed77268df0.zip
air_mediahub-80f7a7d15c4a0e4dcfa7b948c8b97eed77268df0.tar.gz
air_mediahub-80f7a7d15c4a0e4dcfa7b948c8b97eed77268df0.tar.bz2
use strncat instead of strcat (prevent: 456955)refs/changes/18/49418/2
Change-Id: Ieef0ed3f49bd566ca399a480a90f40f3d3c49e54 Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
-rw-r--r--src/data/albumdata.c6
-rw-r--r--src/data/folderdata.c8
-rw-r--r--src/data/mediadata.c3
-rw-r--r--src/view/detail.c2
4 files changed, 7 insertions, 12 deletions
diff --git a/src/data/albumdata.c b/src/data/albumdata.c
index a0497c5..9b2ff52 100644
--- a/src/data/albumdata.c
+++ b/src/data/albumdata.c
@@ -98,16 +98,14 @@ static bool _create_filter(struct albumdata *ad, filter_h *filter,
snprintf(s1, sizeof(s1), " AND MEDIA_STORAGE_TYPE=%d",
ad->source_type);
-
- strcat(buf, s1);
+ strncat(buf, s1, strlen(s1));
}
if (cond) {
char s2[64];
snprintf(s2, sizeof(s2), " AND %s", cond);
-
- strcat(buf, s2);
+ strncat(buf, s2, strlen(s2));
}
media_filter_set_condition(tmp_filter, buf,
diff --git a/src/data/folderdata.c b/src/data/folderdata.c
index d9ef0e4..201d7d7 100644
--- a/src/data/folderdata.c
+++ b/src/data/folderdata.c
@@ -95,16 +95,14 @@ static bool _create_filter(struct folderdata *fd, filter_h *filter,
snprintf(s1, sizeof(s1), " AND MEDIA_STORAGE_TYPE=%d",
fd->source_type);
-
- strcat(buf, s1);
+ strncat(buf, s1, strlen(s1));
}
if (cond) {
char s2[256];
snprintf(s2, sizeof(s2), " AND %s", cond);
-
- strcat(buf, s2);
+ strncat(buf, s2, strlen(s2));
}
media_filter_set_order(tmp_filter, MEDIA_CONTENT_ORDER_ASC,
@@ -369,7 +367,7 @@ static bool _get_folder_list(struct folderdata *fd, char **path)
fd->parent_id);
}
- strcat(buf, s);
+ strncat(buf, s, strlen(s));
}
if (!_get_sub_folder_list(fd, buf)) {
diff --git a/src/data/mediadata.c b/src/data/mediadata.c
index c55572c..eb0ae3a 100644
--- a/src/data/mediadata.c
+++ b/src/data/mediadata.c
@@ -120,8 +120,7 @@ static bool _create_filter(struct mediadata *md, filter_h *filter)
snprintf(s, sizeof(s), " AND MEDIA_STORAGE_TYPE=%d",
md->source_type);
-
- strcat(buf, s);
+ strncat(buf, s, strlen(s));
}
media_filter_set_condition(tmp_filter, buf,
diff --git a/src/view/detail.c b/src/view/detail.c
index a182fb0..629f210 100644
--- a/src/view/detail.c
+++ b/src/view/detail.c
@@ -627,7 +627,7 @@ static void _get_place_title(const char *title, char *str, int size)
if (country) {
snprintf(s, sizeof(s), ", %s", country);
- strcat(str, s);
+ strncat(str, s, strlen(s));
}
}