diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-08-23 07:25:44 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-08-23 07:25:44 +0000 |
commit | bf72c5e286b577e6287697f8f9c9601dfe2a08de (patch) | |
tree | a5231ca517b864262044fd2467524f1232b2d372 /src | |
parent | 8f094f4d1e2825ac43923a33ab5b303ff58aad7b (diff) | |
download | gnunet-bf72c5e286b577e6287697f8f9c9601dfe2a08de.tar.gz gnunet-bf72c5e286b577e6287697f8f9c9601dfe2a08de.zip |
safety checks for arguments
Diffstat (limited to 'src')
-rw-r--r-- | src/core/core_api.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c index 2198f7e2c..959eb275a 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -1143,6 +1143,7 @@ GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1143 | { | 1143 | { |
1144 | struct GNUNET_CORE_Handle *h; | 1144 | struct GNUNET_CORE_Handle *h; |
1145 | 1145 | ||
1146 | GNUNET_assert (NULL != cfg); | ||
1146 | h = GNUNET_new (struct GNUNET_CORE_Handle); | 1147 | h = GNUNET_new (struct GNUNET_CORE_Handle); |
1147 | h->cfg = cfg; | 1148 | h->cfg = cfg; |
1148 | h->cls = cls; | 1149 | h->cls = cls; |
@@ -1181,6 +1182,8 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle) | |||
1181 | { | 1182 | { |
1182 | struct ControlMessage *cm; | 1183 | struct ControlMessage *cm; |
1183 | 1184 | ||
1185 | GNUNET_assert (NULL != handle); | ||
1186 | |||
1184 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from CORE service\n"); | 1187 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from CORE service\n"); |
1185 | if (NULL != handle->cth) | 1188 | if (NULL != handle->cth) |
1186 | { | 1189 | { |
@@ -1271,6 +1274,9 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork, | |||
1271 | struct PeerRecord *pr; | 1274 | struct PeerRecord *pr; |
1272 | struct GNUNET_CORE_TransmitHandle *th; | 1275 | struct GNUNET_CORE_TransmitHandle *th; |
1273 | 1276 | ||
1277 | GNUNET_assert (NULL != handle); | ||
1278 | GNUNET_assert (NULL != target); | ||
1279 | |||
1274 | if (notify_size > GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE) | 1280 | if (notify_size > GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE) |
1275 | { | 1281 | { |
1276 | GNUNET_break (0); | 1282 | GNUNET_break (0); |
@@ -1324,6 +1330,7 @@ GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle *th) | |||
1324 | struct PeerRecord *pr = th->peer; | 1330 | struct PeerRecord *pr = th->peer; |
1325 | struct GNUNET_CORE_Handle *h; | 1331 | struct GNUNET_CORE_Handle *h; |
1326 | 1332 | ||
1333 | GNUNET_assert (NULL != th); | ||
1327 | GNUNET_assert (NULL != pr); | 1334 | GNUNET_assert (NULL != pr); |
1328 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1335 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1329 | "Aborting transmission request to core for %u bytes to `%s'\n", | 1336 | "Aborting transmission request to core for %u bytes to `%s'\n", |