diff options
author | Sung-jae Park <nicesj.park@samsung.com> | 2013-02-27 06:24:35 +0000 |
---|---|---|
committer | Sung-jae Park <nicesj.park@samsung.com> | 2013-02-27 06:50:40 +0000 |
commit | e37f1dfc7ba46b28de6e527a54707aeb2daba4c4 (patch) | |
tree | 84ff1df0f0d31a3ca6c82f202171814a642c8fbf | |
parent | 740f2fd1f550f28f57c09c085d83791fdc6ead0f (diff) | |
download | data-provider-master-e37f1dfc7ba46b28de6e527a54707aeb2daba4c4.tar.gz data-provider-master-e37f1dfc7ba46b28de6e527a54707aeb2daba4c4.tar.bz2 data-provider-master-e37f1dfc7ba46b28de6e527a54707aeb2daba4c4.zip |
Fix the prevent issue
Change-Id: I0a59afd51ea50aa69660bd119b49348c9bd6d86a
-rw-r--r-- | packaging/org.tizen.data-provider-master.spec | 2 | ||||
-rw-r--r-- | util_liveinfo/src/liveinfo.c | 17 | ||||
-rw-r--r-- | util_liveinfo/src/node.c | 1 |
3 files changed, 11 insertions, 9 deletions
diff --git a/packaging/org.tizen.data-provider-master.spec b/packaging/org.tizen.data-provider-master.spec index bb913e4..a297f42 100644 --- a/packaging/org.tizen.data-provider-master.spec +++ b/packaging/org.tizen.data-provider-master.spec @@ -1,6 +1,6 @@ Name: org.tizen.data-provider-master Summary: Master service provider for liveboxes. -Version: 0.16.14 +Version: 0.16.15 Release: 1 Group: framework/livebox License: Flora License diff --git a/util_liveinfo/src/liveinfo.c b/util_liveinfo/src/liveinfo.c index bd53a2d..058d696 100644 --- a/util_liveinfo/src/liveinfo.c +++ b/util_liveinfo/src/liveinfo.c @@ -438,6 +438,11 @@ static void send_inst_delete(void) name = node_name(parent); packet = packet_create_noack("pkg_ctrl", "sss", "rminst", name, inst->id); + if (!packet) { + printf("Failed to create a packet\n"); + return; + } + com_core_packet_send_only(s_info.fd, packet); packet_destroy(packet); s_info.cmd = INST_CTRL; @@ -653,9 +658,6 @@ static inline int do_stat(const char *cmd) case ROOT: printf("Not supported yet\n"); break; - default: - printf("Invalid type\n"); - return -EFAULT; } return 0; @@ -831,7 +833,7 @@ static inline void do_sh(const char *cmd) int idx; idx = 0; - while (idx < sizeof(command) && *cmd && *cmd != ' ') + while (idx < (sizeof(command) - 1) && *cmd && *cmd != ' ') command[idx++] = *cmd++; command[idx] = '\0'; @@ -871,9 +873,8 @@ static inline int get_pixmap_size(Display *disp, Pixmap id, int *x, int *y, unsi if (!y) y = &_y; - if (!XGetGeometry(disp, id, &dummy_win, x, y, w, h, &dummy_border, &dummy_depth)) { + if (!XGetGeometry(disp, id, &dummy_win, x, y, w, h, &dummy_border, &dummy_depth)) return -EFAULT; - } return 0; } @@ -937,8 +938,8 @@ static inline int do_capture(Display *disp, Pixmap id, const char *filename) XShmGetImage(disp, id, xim, 0, 0, 0xFFFFFFFF); XSync(disp, False); - fd = open(filename, O_CREAT | O_RDWR); - if (fd > 0) { + fd = open(filename, O_CREAT | O_RDWR, 0644); + if (fd >= 0) { if (write(fd, xim->data, bufsz) != bufsz) printf("Data is not fully written\n"); diff --git a/util_liveinfo/src/node.c b/util_liveinfo/src/node.c index 108f4c6..d68f096 100644 --- a/util_liveinfo/src/node.c +++ b/util_liveinfo/src/node.c @@ -204,6 +204,7 @@ struct node *node_create(struct node *parent, const char *name, enum node_type t node->name = strdup(name); if (!node->name) { printf("Error: %s\n", strerror(errno)); + free(node); return NULL; } } else { |