Fix the prevent issue (from the private repository)
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 24 Jan 2013 05:38:26 +0000 (05:38 +0000)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 24 Jan 2013 05:38:26 +0000 (05:38 +0000)
Change-Id: I8caf02f3716341b50bcf0552099c09779e420570

packaging/liblivebox-service.spec
src/util.c

index df9690f..7f0ab49 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox-service
 Summary: Library for the development of a livebox service
-Version: 0.2.11
+Version: 0.2.12
 Release: 1
 Group: main/app
 License: Flora License
index 566dab9..e5a545e 100644 (file)
@@ -160,7 +160,7 @@ char *util_replace_string(const char *src, const char *pattern, const char *repl
 
        rlen = strlen(replace);
        len = strlen(src);
-       result = malloc(len);
+       result = malloc(len + 1);
        if (!result) {
                ErrPrint("Heap:%s\n", strerror(errno));
                return NULL;
@@ -174,7 +174,7 @@ char *util_replace_string(const char *src, const char *pattern, const char *repl
                        char *tmp;
 
                        len += (rlen > len ? rlen : len);
-                       tmp = realloc(result, len);
+                       tmp = realloc(result, len + 1);
                        if (!tmp) {
                                ErrPrint("Heap: %s\n", strerror(errno));
                                free(result);
@@ -191,7 +191,7 @@ char *util_replace_string(const char *src, const char *pattern, const char *repl
                        if (r_idx == len) {
                                char *tmp;
                                len += (rlen > len ? rlen : len);
-                               tmp = realloc(result, len);
+                               tmp = realloc(result, len + 1);
                                if (!tmp) {
                                        ErrPrint("Heap: %s\n", strerror(errno));
                                        free(result);
@@ -210,7 +210,7 @@ char *util_replace_string(const char *src, const char *pattern, const char *repl
                                                        if (r_idx == len) {
                                                                char *tmp;
                                                                len += (rlen > len ? rlen : len);
-                                                               tmp = realloc(result, len);
+                                                               tmp = realloc(result, len + 1);
                                                                if (!tmp) {
                                                                        ErrPrint("Heap: %s\n", strerror(errno));
                                                                        free(result);
@@ -239,7 +239,7 @@ char *util_replace_string(const char *src, const char *pattern, const char *repl
                                if (idx + rlen >= len) {
                                        char *tmp;
                                        len += (rlen > len ? rlen : len);
-                                       tmp = realloc(result, len);
+                                       tmp = realloc(result, len + 1);
                                        if (!tmp) {
                                                ErrPrint("Heap: %s\n", strerror(errno));
                                                free(result);