diff options
Diffstat (limited to 'meta-oe/recipes-extended/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch')
| -rw-r--r-- | meta-oe/recipes-extended/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch | 145 |
1 files changed, 0 insertions, 145 deletions
diff --git a/meta-oe/recipes-extended/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch b/meta-oe/recipes-extended/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch deleted file mode 100644 index 6faf5f9d9a..0000000000 --- a/meta-oe/recipes-extended/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch +++ /dev/null | |||
| @@ -1,145 +0,0 @@ | |||
| 1 | Index: git/tftpd_list.c | ||
| 2 | =================================================================== | ||
| 3 | --- git.orig/tftpd_list.c 2012-10-24 21:48:47.000000000 -0700 | ||
| 4 | +++ git/tftpd_list.c 2012-10-24 21:52:04.266205076 -0700 | ||
| 5 | @@ -49,11 +49,11 @@ | ||
| 6 | */ | ||
| 7 | int tftpd_list_add(struct thread_data *new) | ||
| 8 | { | ||
| 9 | - struct thread_data *current = thread_data; | ||
| 10 | + struct thread_data *current; | ||
| 11 | int ret; | ||
| 12 | |||
| 13 | pthread_mutex_lock(&thread_list_mutex); | ||
| 14 | - | ||
| 15 | + current = thread_data; | ||
| 16 | number_of_thread++; | ||
| 17 | |||
| 18 | ret = number_of_thread; | ||
| 19 | @@ -81,11 +81,13 @@ | ||
| 20 | */ | ||
| 21 | int tftpd_list_remove(struct thread_data *old) | ||
| 22 | { | ||
| 23 | - struct thread_data *current = thread_data; | ||
| 24 | + struct thread_data *current; | ||
| 25 | int ret; | ||
| 26 | |||
| 27 | pthread_mutex_lock(&thread_list_mutex); | ||
| 28 | |||
| 29 | + current = thread_data; | ||
| 30 | + | ||
| 31 | number_of_thread--; | ||
| 32 | ret = number_of_thread; | ||
| 33 | |||
| 34 | @@ -137,23 +139,26 @@ | ||
| 35 | struct thread_data *data, | ||
| 36 | struct client_info *client) | ||
| 37 | { | ||
| 38 | - struct thread_data *current = thread_data; /* head of the list */ | ||
| 39 | - struct tftp_opt *tftp_options = data->tftp_options; | ||
| 40 | + struct thread_data *current; /* head of the list */ | ||
| 41 | + struct tftp_opt *tftp_options; | ||
| 42 | struct client_info *tmp; | ||
| 43 | char options[MAXLEN]; | ||
| 44 | char string[MAXLEN]; | ||
| 45 | char *index; | ||
| 46 | int len; | ||
| 47 | |||
| 48 | + /* lock the whole list before walking it */ | ||
| 49 | + pthread_mutex_lock(&thread_list_mutex); | ||
| 50 | + | ||
| 51 | *thread = NULL; | ||
| 52 | |||
| 53 | + current = thread_data; | ||
| 54 | + tftp_options = data->tftp_options; | ||
| 55 | + | ||
| 56 | opt_request_to_string(tftp_options, options, MAXLEN); | ||
| 57 | index = strstr(options, "multicast"); | ||
| 58 | len = (int)index - (int)options; | ||
| 59 | |||
| 60 | - /* lock the whole list before walking it */ | ||
| 61 | - pthread_mutex_lock(&thread_list_mutex); | ||
| 62 | - | ||
| 63 | while (current) | ||
| 64 | { | ||
| 65 | if (current != data) | ||
| 66 | @@ -214,9 +219,10 @@ | ||
| 67 | void tftpd_clientlist_remove(struct thread_data *thread, | ||
| 68 | struct client_info *client) | ||
| 69 | { | ||
| 70 | - struct client_info *tmp = thread->client_info; | ||
| 71 | + struct client_info *tmp; | ||
| 72 | |||
| 73 | pthread_mutex_lock(&thread->client_mutex); | ||
| 74 | + tmp = thread->client_info; | ||
| 75 | while ((tmp->next != client) && (tmp->next != NULL)) | ||
| 76 | tmp = tmp->next; | ||
| 77 | if (tmp->next == NULL) | ||
| 78 | @@ -231,9 +237,11 @@ | ||
| 79 | void tftpd_clientlist_free(struct thread_data *thread) | ||
| 80 | { | ||
| 81 | struct client_info *tmp; | ||
| 82 | - struct client_info *head = thread->client_info; | ||
| 83 | + struct client_info *head; | ||
| 84 | |||
| 85 | pthread_mutex_lock(&thread->client_mutex); | ||
| 86 | + head = thread->client_info; | ||
| 87 | + | ||
| 88 | while (head) | ||
| 89 | { | ||
| 90 | tmp = head; | ||
| 91 | @@ -250,9 +258,10 @@ | ||
| 92 | struct client_info *client, | ||
| 93 | struct sockaddr_storage *sock) | ||
| 94 | { | ||
| 95 | - struct client_info *head = thread->client_info; | ||
| 96 | + struct client_info *head; | ||
| 97 | |||
| 98 | pthread_mutex_lock(&thread->client_mutex); | ||
| 99 | + head = thread->client_info; | ||
| 100 | |||
| 101 | if (client) | ||
| 102 | { | ||
| 103 | @@ -334,10 +343,10 @@ | ||
| 104 | |||
| 105 | void tftpd_list_kill_threads(void) | ||
| 106 | { | ||
| 107 | - struct thread_data *current = thread_data; /* head of list */ | ||
| 108 | + struct thread_data *current; /* head of list */ | ||
| 109 | |||
| 110 | pthread_mutex_lock(&thread_list_mutex); | ||
| 111 | - | ||
| 112 | + current = thread_data; | ||
| 113 | |||
| 114 | while (current != NULL) | ||
| 115 | { | ||
| 116 | Index: git/tftpd_mcast.c | ||
| 117 | =================================================================== | ||
| 118 | --- git.orig/tftpd_mcast.c 2012-10-24 21:48:47.000000000 -0700 | ||
| 119 | +++ git/tftpd_mcast.c 2012-10-24 21:49:11.570201582 -0700 | ||
| 120 | @@ -51,9 +51,11 @@ | ||
| 121 | */ | ||
| 122 | int tftpd_mcast_get_tid(char **addr, short *port) | ||
| 123 | { | ||
| 124 | - struct tid *current = tid_list; | ||
| 125 | + struct tid *current; | ||
| 126 | |||
| 127 | pthread_mutex_lock(&mcast_tid_list); | ||
| 128 | + current = tid_list; | ||
| 129 | + | ||
| 130 | /* walk the list for a free tid */ | ||
| 131 | while (current != NULL) | ||
| 132 | { | ||
| 133 | @@ -74,9 +76,11 @@ | ||
| 134 | |||
| 135 | int tftpd_mcast_free_tid(char *addr, short port) | ||
| 136 | { | ||
| 137 | - struct tid *current = tid_list; | ||
| 138 | + struct tid *current; | ||
| 139 | |||
| 140 | pthread_mutex_lock(&mcast_tid_list); | ||
| 141 | + current = tid_list; | ||
| 142 | + | ||
| 143 | while (current != NULL) | ||
| 144 | { | ||
| 145 | if ((current->used == 1) && (current->port == port) && | ||
