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/social | |
parent | 2f26cb57675966de7f04606fa83b0f0fc1dae46b (diff) | |
download | gnunet-76a029cc8d1dbf3d470079e98be1f3b7c4783ef0.tar.gz gnunet-76a029cc8d1dbf3d470079e98be1f3b7c4783ef0.zip |
psyc,psycstore,social fixes
Diffstat (limited to 'src/social')
-rw-r--r-- | src/social/social_api.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/social/social_api.c b/src/social/social_api.c index e34774aae..f05e437ca 100644 --- a/src/social/social_api.c +++ b/src/social/social_api.c | |||
@@ -657,10 +657,17 @@ check_place_state_result (void *cls, | |||
657 | const struct GNUNET_OperationResultMessage *res) | 657 | const struct GNUNET_OperationResultMessage *res) |
658 | { | 658 | { |
659 | const struct GNUNET_MessageHeader *mod = GNUNET_MQ_extract_nested_mh (res); | 659 | const struct GNUNET_MessageHeader *mod = GNUNET_MQ_extract_nested_mh (res); |
660 | uint16_t mod_size = ntohs (mod->size); | 660 | if (NULL == mod) |
661 | uint16_t size = ntohs (res->header.size); | 661 | { |
662 | GNUNET_break_op (0); | ||
663 | LOG (GNUNET_ERROR_TYPE_WARNING, | ||
664 | "Invalid modifier in state result\n"); | ||
665 | return GNUNET_SYSERR; | ||
666 | } | ||
662 | 667 | ||
663 | if (NULL == mod || size - sizeof (*res) != mod_size) | 668 | uint16_t size = ntohs (res->header.size); |
669 | uint16_t mod_size = ntohs (mod->size); | ||
670 | if (size - sizeof (*res) != mod_size) | ||
664 | { | 671 | { |
665 | GNUNET_break_op (0); | 672 | GNUNET_break_op (0); |
666 | LOG (GNUNET_ERROR_TYPE_WARNING, | 673 | LOG (GNUNET_ERROR_TYPE_WARNING, |
@@ -700,7 +707,9 @@ handle_place_state_result (void *cls, | |||
700 | 707 | ||
701 | const char *name = (const char *) &pmod[1]; | 708 | const char *name = (const char *) &pmod[1]; |
702 | uint16_t name_size = ntohs (pmod->name_size); | 709 | uint16_t name_size = ntohs (pmod->name_size); |
703 | if ('\0' != name[name_size - 1]) | 710 | if (0 == name_size |
711 | || mod_size - sizeof (*pmod) < name_size | ||
712 | || '\0' != name[name_size - 1]) | ||
704 | { | 713 | { |
705 | GNUNET_break_op (0); | 714 | GNUNET_break_op (0); |
706 | LOG (GNUNET_ERROR_TYPE_WARNING, | 715 | LOG (GNUNET_ERROR_TYPE_WARNING, |