diff options
author | lurchi <lurchi@strangeplace.net> | 2018-01-07 16:13:02 +0100 |
---|---|---|
committer | lurchi <lurchi@strangeplace.net> | 2018-01-07 16:13:09 +0100 |
commit | dbebf1ac6181b8ef4a89d01976f063a6ecf69fae (patch) | |
tree | f646098488ffa910ccaea845b33ccad4d79c0071 | |
parent | 800cb255ea7ae4e6b55095949bc84eb864c08b2e (diff) | |
download | gnunet-dbebf1ac6181b8ef4a89d01976f063a6ecf69fae.tar.gz gnunet-dbebf1ac6181b8ef4a89d01976f063a6ecf69fae.zip |
Revert "fix dereferencing uninitialized pointer"
This reverts commit 201a67be13ae31b4eb7fb8ad38b349fe287c0baf.
-rw-r--r-- | src/util/scheduler.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 2912dd78b..fecbc0de5 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -756,8 +756,8 @@ init_fd_info (struct GNUNET_SCHEDULER_Task *t, | |||
756 | t->fds = fdi; | 756 | t->fds = fdi; |
757 | if (1 == read_nh_len) | 757 | if (1 == read_nh_len) |
758 | { | 758 | { |
759 | GNUNET_assert (NULL != read_nh); | ||
760 | fdi->fd = *read_nh; | 759 | fdi->fd = *read_nh; |
760 | GNUNET_assert (NULL != fdi->fd); | ||
761 | fdi->et = GNUNET_SCHEDULER_ET_IN; | 761 | fdi->et = GNUNET_SCHEDULER_ET_IN; |
762 | fdi->sock = GNUNET_NETWORK_get_fd (*read_nh); | 762 | fdi->sock = GNUNET_NETWORK_get_fd (*read_nh); |
763 | t->read_fd = fdi->sock; | 763 | t->read_fd = fdi->sock; |
@@ -765,8 +765,8 @@ init_fd_info (struct GNUNET_SCHEDULER_Task *t, | |||
765 | } | 765 | } |
766 | else if (1 == write_nh_len) | 766 | else if (1 == write_nh_len) |
767 | { | 767 | { |
768 | GNUNET_assert (NULL != write_nh); | ||
769 | fdi->fd = *write_nh; | 768 | fdi->fd = *write_nh; |
769 | GNUNET_assert (NULL != fdi->fd); | ||
770 | fdi->et = GNUNET_SCHEDULER_ET_OUT; | 770 | fdi->et = GNUNET_SCHEDULER_ET_OUT; |
771 | fdi->sock = GNUNET_NETWORK_get_fd (*write_nh); | 771 | fdi->sock = GNUNET_NETWORK_get_fd (*write_nh); |
772 | t->read_fd = -1; | 772 | t->read_fd = -1; |
@@ -774,8 +774,8 @@ init_fd_info (struct GNUNET_SCHEDULER_Task *t, | |||
774 | } | 774 | } |
775 | else if (1 == read_fh_len) | 775 | else if (1 == read_fh_len) |
776 | { | 776 | { |
777 | GNUNET_assert (NULL != read_fh); | ||
778 | fdi->fh = *read_fh; | 777 | fdi->fh = *read_fh; |
778 | GNUNET_assert (NULL != fdi->fh); | ||
779 | fdi->et = GNUNET_SCHEDULER_ET_IN; | 779 | fdi->et = GNUNET_SCHEDULER_ET_IN; |
780 | fdi->sock = (*read_fh)->fd; // FIXME: does not work under WIN32 | 780 | fdi->sock = (*read_fh)->fd; // FIXME: does not work under WIN32 |
781 | t->read_fd = fdi->sock; | 781 | t->read_fd = fdi->sock; |
@@ -783,8 +783,8 @@ init_fd_info (struct GNUNET_SCHEDULER_Task *t, | |||
783 | } | 783 | } |
784 | else | 784 | else |
785 | { | 785 | { |
786 | GNUNET_assert (NULL != write_fh); | ||
787 | fdi->fh = *write_fh; | 786 | fdi->fh = *write_fh; |
787 | GNUNET_assert (NULL != fdi->fh); | ||
788 | fdi->et = GNUNET_SCHEDULER_ET_OUT; | 788 | fdi->et = GNUNET_SCHEDULER_ET_OUT; |
789 | fdi->sock = (*write_fh)->fd; // FIXME: does not work under WIN32 | 789 | fdi->sock = (*write_fh)->fd; // FIXME: does not work under WIN32 |
790 | t->read_fd = -1; | 790 | t->read_fd = -1; |
@@ -1750,11 +1750,8 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, | |||
1750 | const struct GNUNET_DISK_FileHandle **write_fhandles; | 1750 | const struct GNUNET_DISK_FileHandle **write_fhandles; |
1751 | unsigned int read_nhandles_len, write_nhandles_len, | 1751 | unsigned int read_nhandles_len, write_nhandles_len, |
1752 | read_fhandles_len, write_fhandles_len; | 1752 | read_fhandles_len, write_fhandles_len; |
1753 | int no_fdsets = (NULL == rs) && (NULL == ws); | ||
1754 | int no_socket_descriptors = | ||
1755 | ((NULL != rs) && (0 == rs->nsds)) && ((NULL != ws) && (0 == ws->nsds)); | ||
1756 | 1753 | ||
1757 | if (no_fdsets || no_socket_descriptors) | 1754 | if (((NULL == rs) && (NULL == ws)) || ((0 == rs->nsds) && (0 == ws->nsds))) |
1758 | return GNUNET_SCHEDULER_add_delayed_with_priority (delay, | 1755 | return GNUNET_SCHEDULER_add_delayed_with_priority (delay, |
1759 | prio, | 1756 | prio, |
1760 | task, | 1757 | task, |