summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-10-21 04:38:21 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-10-21 04:38:21 +0000
commit23032f2ab5720e4d11be357f6fde4759a7c56c4c (patch)
tree6b275a0c1716e5e47f6a90cdcdd97c707ec93568 /legacy
parent6c10a447b170542029641803143d13eec4630496 (diff)
calling memcpy on an uninitialized pointer??? who would do such a thing!
SVN revision: 64232
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/src/lib/elm_cnp_helper.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/legacy/elementary/src/lib/elm_cnp_helper.c b/legacy/elementary/src/lib/elm_cnp_helper.c
index 5e9b10bcb6..c0b5d015b8 100644
--- a/legacy/elementary/src/lib/elm_cnp_helper.c
+++ b/legacy/elementary/src/lib/elm_cnp_helper.c
@@ -600,6 +600,7 @@ targets_converter(char *target __UNUSED__, void *data, int size, void **data_ret
600 { 600 {
601 if (data_ret) 601 if (data_ret)
602 { 602 {
603 *data_ret = malloc(size * sizeof(char) + 1);
603 memcpy(*data_ret, data, size); 604 memcpy(*data_ret, data, size);
604 ((char**)(data_ret))[0][size] = 0; 605 ((char**)(data_ret))[0][size] = 0;
605 } 606 }
@@ -811,9 +812,9 @@ notify_handler_uri(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
811 } 812 }
812 else 813 else
813 { 814 {
815 stripstr = p = malloc(data->length * sizeof(char) + 1);
814 memcpy(stripstr, data->data, data->length); 816 memcpy(stripstr, data->data, data->length);
815 stripstr[data->length] = 0; 817 stripstr[data->length] = 0;
816 p = stripstr;
817 } 818 }
818 819
819 if (!p) 820 if (!p)
@@ -988,6 +989,7 @@ text_converter(char *target __UNUSED__, void *data, int size, void **data_ret, i
988 { 989 {
989 if (data_ret) 990 if (data_ret)
990 { 991 {
992 *data_ret = malloc(size * sizeof(char) + 1);
991 memcpy(*data_ret, data, size); 993 memcpy(*data_ret, data, size);
992 ((char**)(data_ret))[0][size] = 0; 994 ((char**)(data_ret))[0][size] = 0;
993 } 995 }
@@ -1034,6 +1036,7 @@ general_converter(char *target __UNUSED__, void *data, int size, void **data_ret
1034 { 1036 {
1035 if (data_ret) 1037 if (data_ret)
1036 { 1038 {
1039 *data_ret = malloc(size * sizeof(char) + 1);
1037 memcpy(*data_ret, data, size); 1040 memcpy(*data_ret, data, size);
1038 ((char**)(data_ret))[0][size] = 0; 1041 ((char**)(data_ret))[0][size] = 0;
1039 } 1042 }