summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-10-21 09:55:32 (GMT)
committerSung-jae Park <nicesj.park@samsung.com>2013-10-21 09:55:32 (GMT)
commit51497ecf16867c5c8d8f4210823125cf1c2c8df7 (patch)
tree69d13084fdc4f00a2ad9611497a600618b1f8363
parent509b0f9d4897dfe95845e58cea61b9fbf1f11109 (diff)
downloaddata-provider-master-51497ecf16867c5c8d8f4210823125cf1c2c8df7.zip
data-provider-master-51497ecf16867c5c8d8f4210823125cf1c2c8df7.tar.gz
data-provider-master-51497ecf16867c5c8d8f4210823125cf1c2c8df7.tar.bz2
Mark the end of file buffer
Change-Id: Ia097463edc4c9d530dfa158d42bd0f0ea73d85f1
-rw-r--r--packaging/data-provider-master.spec2
-rw-r--r--src/script_handler.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec
index 04cf59a..803ba21 100644
--- a/packaging/data-provider-master.spec
+++ b/packaging/data-provider-master.spec
@@ -1,6 +1,6 @@
Name: data-provider-master
Summary: Master service provider for liveboxes
-Version: 0.25.17
+Version: 0.25.18
Release: 1
Group: HomeTF/Livebox
License: Flora License
diff --git a/src/script_handler.c b/src/script_handler.c
index a4af88c..3d298de 100644
--- a/src/script_handler.c
+++ b/src/script_handler.c
@@ -1165,7 +1165,7 @@ static inline char *load_file(const char *filename)
goto errout;
}
- filebuf = malloc(filesize);
+ filebuf = malloc(filesize + 1);
if (!filebuf) {
ErrPrint("malloc: %s\n", strerror(errno));
goto errout;
@@ -1188,6 +1188,10 @@ static inline char *load_file(const char *filename)
readsize += ret;
}
+ if (filebuf) {
+ filebuf[readsize] = '\0';
+ }
+
/*!
* \note
* Now, we are ready to parse the filebuf.
@@ -1468,6 +1472,7 @@ HAPI int script_handler_parse_desc(struct inst_info *inst, const char *filename,
state = BEGIN;
block->filename = filename;
block_list = eina_list_append(block_list, block);
+ block = NULL;
} else {
state = FIELD;
continue;