diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-12 13:04:38 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-12 13:04:38 +0000 |
commit | 6272777c0cdf48f86b96e2b7c4749e821ccba286 (patch) | |
tree | e965c5bf722fbd264540b01325ba2b53025281f2 /src/peerinfo-tool/gnunet-peerinfo_plugins.c | |
parent | f7b950749a0b2cf525cd812576ecde4227f813a2 (diff) | |
download | gnunet-6272777c0cdf48f86b96e2b7c4749e821ccba286.tar.gz gnunet-6272777c0cdf48f86b96e2b7c4749e821ccba286.zip |
substring search is the root of all evil:
peerinfo did load wrong plugin if substring matches: used https for http address
Diffstat (limited to 'src/peerinfo-tool/gnunet-peerinfo_plugins.c')
-rw-r--r-- | src/peerinfo-tool/gnunet-peerinfo_plugins.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/peerinfo-tool/gnunet-peerinfo_plugins.c b/src/peerinfo-tool/gnunet-peerinfo_plugins.c index 3bca9feb2..29dc4d017 100644 --- a/src/peerinfo-tool/gnunet-peerinfo_plugins.c +++ b/src/peerinfo-tool/gnunet-peerinfo_plugins.c | |||
@@ -168,14 +168,23 @@ GPI_plugins_find (const char *name) | |||
168 | struct TransportPlugin *head = plugins_head; | 168 | struct TransportPlugin *head = plugins_head; |
169 | 169 | ||
170 | char *stripped = GNUNET_strdup (name); | 170 | char *stripped = GNUNET_strdup (name); |
171 | char *head_stripped; | ||
171 | char *sep = strchr (stripped, '_'); | 172 | char *sep = strchr (stripped, '_'); |
172 | if (NULL != sep) | 173 | if (NULL != sep) |
173 | sep[0] = '\0'; | 174 | sep[0] = '\0'; |
174 | 175 | ||
175 | while (head != NULL) | 176 | while (head != NULL) |
176 | { | 177 | { |
177 | if (head->short_name == strstr (head->short_name, stripped)) | 178 | head_stripped = GNUNET_strdup(head->short_name); |
178 | break; | 179 | char *head_sep = strchr (head_stripped, '_'); |
180 | if (NULL != head_sep) | ||
181 | head_sep[0] = '\0'; | ||
182 | if (0 == strcmp (head_stripped, stripped)) | ||
183 | { | ||
184 | GNUNET_free (head_stripped); | ||
185 | break; | ||
186 | } | ||
187 | GNUNET_free (head_stripped); | ||
179 | head = head->next; | 188 | head = head->next; |
180 | } | 189 | } |
181 | GNUNET_free (stripped); | 190 | GNUNET_free (stripped); |