{
uint16_t size = ntohs (opres->header.size);
const char *str = (const char *) &opres[1];
- if ( (sizeof (struct OperationResult) < size) &&
+ if ( (sizeof (*opres) < size) &&
('\0' != str[size - sizeof (*opres) - 1]) )
{
GNUNET_break (0);
check_result_state (void *cls, const struct StateResult *sres)
{
const char *name = (const char *) &sres[1];
+ uint16_t size = ntohs (sres->header.size);
uint16_t name_size = ntohs (sres->name_size);
- if (name_size <= 2 || '\0' != name[name_size - 1])
+ if (name_size <= 2
+ || size - sizeof (*sres) < name_size
+ || '\0' != name[name_size - 1])
{
LOG (GNUNET_ERROR_TYPE_ERROR,
"check_result_state: Received state result message with invalid name.\n");
h->op = GNUNET_OP_create ();
GNUNET_assert (NULL == h->mq);
- h->mq = GNUNET_CLIENT_connecT (h->cfg, "psycstore",
+ h->mq = GNUNET_CLIENT_connect (h->cfg, "psycstore",
handlers, disconnected, h);
GNUNET_assert (NULL != h->mq);
}