diff options
author | Gabor X Toth <*@tg-x.net> | 2016-09-22 11:35:38 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2016-09-22 11:35:38 +0000 |
commit | 76a029cc8d1dbf3d470079e98be1f3b7c4783ef0 (patch) | |
tree | 0448061d5cbfcab71265ec71b32ed83b8e591e9a /src/psyc/psyc_api.c | |
parent | 2f26cb57675966de7f04606fa83b0f0fc1dae46b (diff) | |
download | gnunet-76a029cc8d1dbf3d470079e98be1f3b7c4783ef0.tar.gz gnunet-76a029cc8d1dbf3d470079e98be1f3b7c4783ef0.zip |
psyc,psycstore,social fixes
Diffstat (limited to 'src/psyc/psyc_api.c')
-rw-r--r-- | src/psyc/psyc_api.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/psyc/psyc_api.c b/src/psyc/psyc_api.c index 9c5832293..9769bb853 100644 --- a/src/psyc/psyc_api.c +++ b/src/psyc/psyc_api.c | |||
@@ -386,6 +386,11 @@ handle_channel_state_result (void *cls, | |||
386 | } | 386 | } |
387 | 387 | ||
388 | const struct GNUNET_MessageHeader *mod = GNUNET_MQ_extract_nested_mh (res); | 388 | const struct GNUNET_MessageHeader *mod = GNUNET_MQ_extract_nested_mh (res); |
389 | if (NULL == mod) | ||
390 | { | ||
391 | GNUNET_break_op (0); | ||
392 | return; | ||
393 | } | ||
389 | uint16_t mod_size = ntohs (mod->size); | 394 | uint16_t mod_size = ntohs (mod->size); |
390 | 395 | ||
391 | switch (ntohs (mod->type)) | 396 | switch (ntohs (mod->type)) |
@@ -397,9 +402,11 @@ handle_channel_state_result (void *cls, | |||
397 | 402 | ||
398 | const char *name = (const char *) &pmod[1]; | 403 | const char *name = (const char *) &pmod[1]; |
399 | uint16_t name_size = ntohs (pmod->name_size); | 404 | uint16_t name_size = ntohs (pmod->name_size); |
400 | if ('\0' != name[name_size - 1]) | 405 | if (0 == name_size |
406 | || mod_size - sizeof (*pmod) < name_size | ||
407 | || '\0' != name[name_size - 1]) | ||
401 | { | 408 | { |
402 | GNUNET_break (0); | 409 | GNUNET_break_op (0); |
403 | return; | 410 | return; |
404 | } | 411 | } |
405 | sr->var_cb (sr->cls, mod, name, name + name_size, | 412 | sr->var_cb (sr->cls, mod, name, name + name_size, |