summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-15 08:08:05 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-15 08:08:05 +0000
commit300c5ea037081c8e8f1009083876fbcbc8cb52ad (patch)
tree23dd199dbcdfb86a56bf86e1b27dccbdf70b1418 /src
parenta6e462f5b2b959ca3fd953d59f4b775ea881154d (diff)
more asserts for 1903
Diffstat (limited to 'src')
-rw-r--r--src/ats/ats_api_scheduling.c5
-rw-r--r--src/ats/gnunet-service-ats_addresses.c1
-rw-r--r--src/ats/gnunet-service-ats_scheduling.c4
3 files changed, 6 insertions, 4 deletions
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index 999104979..ac4cca882 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -822,8 +822,9 @@ GNUNET_ATS_address_destroyed (struct GNUNET_ATS_SchedulingHandle *sh,
size_t msize;
uint32_t session_id;
- GNUNET_break (address->transport_name != NULL);
- namelen = (address->transport_name == NULL) ? 0 : strlen (address->transport_name) + 1;
+ GNUNET_assert (address->transport_name != NULL);
+ namelen = strlen (address->transport_name) + 1;
+ GNUNET_assert (namelen > 1);
msize = sizeof (struct AddressDestroyedMessage) + address->address_length + namelen;
if ((msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE) ||
(address->address_length >= GNUNET_SERVER_MAX_MESSAGE_SIZE) ||
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c
index ee76842b6..f4f9607e6 100644
--- a/src/ats/gnunet-service-ats_addresses.c
+++ b/src/ats/gnunet-service-ats_addresses.c
@@ -348,6 +348,7 @@ GAS_addresses_destroy (const struct GNUNET_PeerIdentity *peer,
{
struct ATS_Address aa;
+ GNUNET_break (0 < strlen (plugin_name));
aa.peer = *peer;
aa.addr_len = plugin_addr_len;
aa.addr = plugin_addr;
diff --git a/src/ats/gnunet-service-ats_scheduling.c b/src/ats/gnunet-service-ats_scheduling.c
index dac84676f..4659a2363 100644
--- a/src/ats/gnunet-service-ats_scheduling.c
+++ b/src/ats/gnunet-service-ats_scheduling.c
@@ -359,8 +359,8 @@ GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
return;
}
- if ((plugin_name_length != 0) &&
- (plugin_name[plugin_name_length - 1] != '\0'))
+ if ( (plugin_name_length == 0) ||
+ (plugin_name[plugin_name_length - 1] != '\0'))
{
GNUNET_break (0);
GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);