summaryrefslogtreecommitdiff
path: root/src/lib/eldbus
diff options
context:
space:
mode:
authorHermet Park <chuneon.park@samsung.com>2020-06-08 11:00:26 +0900
committerHermet Park <chuneon.park@samsung.com>2020-06-08 11:00:27 +0900
commit8559602bccb2a722822f0b42ca122db8827e1644 (patch)
tree7a4f870af83e0397b63d7d604285d58050a5b616 /src/lib/eldbus
parent9afc497269cc5760fa7de01c6c712df6070bdf28 (diff)
eldbus: fix the data size issue.
Summary: dbus message requires the void* value for the message data, the returned value of dbus_message_iter_get_basic() can be mismatched by to the architure, This could bring the returned va_argues memory corrupted among the series of values. We can use the defined type for exceptions. Reviewers: herb, kimcinoo, jsuya, raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11940
Diffstat (limited to 'src/lib/eldbus')
-rw-r--r--src/lib/eldbus/eldbus_message.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/lib/eldbus/eldbus_message.c b/src/lib/eldbus/eldbus_message.c
index e7295077ab..f8605dd9d1 100644
--- a/src/lib/eldbus/eldbus_message.c
+++ b/src/lib/eldbus/eldbus_message.c
@@ -619,32 +619,36 @@ eldbus_message_iter_next(Eldbus_Message_Iter *iter)
619static void 619static void
620get_basic(char type, DBusMessageIter *iter, va_list *vl) 620get_basic(char type, DBusMessageIter *iter, va_list *vl)
621{ 621{
622 DBusBasicValue val;
623
622 switch (type) 624 switch (type)
623 { 625 {
624 case DBUS_TYPE_BYTE: 626 case DBUS_TYPE_BYTE:
625 { 627 {
626 uint8_t *byte = va_arg(*vl, uint8_t *); 628 uint8_t *byte = va_arg(*vl, uint8_t *);
627 dbus_message_iter_get_basic(iter, byte); 629 dbus_message_iter_get_basic(iter, &val);
630 *byte = val.bool_val;
628 break; 631 break;
629 } 632 }
630 case DBUS_TYPE_BOOLEAN: 633 case DBUS_TYPE_BOOLEAN:
631 { 634 {
632 Eina_Bool *boolean = va_arg(*vl, Eina_Bool *); 635 Eina_Bool *boolean = va_arg(*vl, Eina_Bool *);
633 dbus_bool_t val;
634 dbus_message_iter_get_basic(iter, &val); 636 dbus_message_iter_get_basic(iter, &val);
635 *boolean = val; 637 *boolean = val.bool_val;
636 break; 638 break;
637 } 639 }
638 case DBUS_TYPE_INT16: 640 case DBUS_TYPE_INT16:
639 { 641 {
640 int16_t *int16 = va_arg(*vl, int16_t *); 642 int16_t *int16 = va_arg(*vl, int16_t *);
641 dbus_message_iter_get_basic(iter, int16); 643 dbus_message_iter_get_basic(iter, &val);
644 *int16 = val.i16;
642 break; 645 break;
643 } 646 }
644 case DBUS_TYPE_UINT16: 647 case DBUS_TYPE_UINT16:
645 { 648 {
646 uint16_t *uint16 = va_arg(*vl, uint16_t *); 649 uint16_t *uint16 = va_arg(*vl, uint16_t *);
647 dbus_message_iter_get_basic(iter, uint16); 650 dbus_message_iter_get_basic(iter, &val);
651 *uint16 = val.u16;
648 break; 652 break;
649 } 653 }
650 case DBUS_TYPE_INT32: 654 case DBUS_TYPE_INT32:
@@ -653,31 +657,36 @@ get_basic(char type, DBusMessageIter *iter, va_list *vl)
653#endif 657#endif
654 { 658 {
655 int32_t *int32 = va_arg(*vl, int32_t *); 659 int32_t *int32 = va_arg(*vl, int32_t *);
656 dbus_message_iter_get_basic(iter, int32); 660 dbus_message_iter_get_basic(iter, &val);
661 *int32 = val.i32;
657 break; 662 break;
658 } 663 }
659 case DBUS_TYPE_UINT32: 664 case DBUS_TYPE_UINT32:
660 { 665 {
661 uint32_t *uint32 = va_arg(*vl, uint32_t *); 666 uint32_t *uint32 = va_arg(*vl, uint32_t *);
662 dbus_message_iter_get_basic(iter, uint32); 667 dbus_message_iter_get_basic(iter, &val);
668 *uint32 = val.u32;
663 break; 669 break;
664 } 670 }
665 case DBUS_TYPE_INT64: 671 case DBUS_TYPE_INT64:
666 { 672 {
667 int64_t *int64 = va_arg(*vl, int64_t *); 673 int64_t *int64 = va_arg(*vl, int64_t *);
668 dbus_message_iter_get_basic(iter, int64); 674 dbus_message_iter_get_basic(iter, &val);
675 *int64 = val.i64;
669 break; 676 break;
670 } 677 }
671 case DBUS_TYPE_UINT64: 678 case DBUS_TYPE_UINT64:
672 { 679 {
673 uint64_t *uint64 = va_arg(*vl, uint64_t *); 680 uint64_t *uint64 = va_arg(*vl, uint64_t *);
674 dbus_message_iter_get_basic(iter, uint64); 681 dbus_message_iter_get_basic(iter, &val);
682 *uint64 = val.u64;
675 break; 683 break;
676 } 684 }
677 case DBUS_TYPE_DOUBLE: 685 case DBUS_TYPE_DOUBLE:
678 { 686 {
679 double *double_ieee = va_arg(*vl, double *); 687 double *double_ieee = va_arg(*vl, double *);
680 dbus_message_iter_get_basic(iter, double_ieee); 688 dbus_message_iter_get_basic(iter, &val);
689 *double_ieee = val.dbl;
681 break; 690 break;
682 } 691 }
683 case DBUS_TYPE_STRING: 692 case DBUS_TYPE_STRING:
@@ -685,7 +694,8 @@ get_basic(char type, DBusMessageIter *iter, va_list *vl)
685 case DBUS_TYPE_SIGNATURE: 694 case DBUS_TYPE_SIGNATURE:
686 { 695 {
687 char **string = va_arg(*vl, char**); 696 char **string = va_arg(*vl, char**);
688 dbus_message_iter_get_basic(iter, string); 697 dbus_message_iter_get_basic(iter, &val);
698 *string = val.str;
689 break; 699 break;
690 } 700 }
691 default: 701 default: