Change-Id: Id3be83c815b0a3af4046cf0b9ba89237c3be953f
mServiceName = "";
mInitDiscNum = 1;
mOpenState = VINE_DP_PUBSUB_OPEN_STATE_NONE;
+ mSdPubSubState = VINE_DP_PUBSUB_SD_STATE_NONE;
// Network Info
mAddrFamily = VINE_ADDRESS_FAMILY_DEFAULT;
#include <sys/syscall.h>
#include <sys/timerfd.h>
#include <stdio.h>
+#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
static int _send_message_from_file(vine_dp_h dp)
{
unsigned char *buf;
- size_t size, count = 0;
+ long size;
+ size_t count;
int ret;
FILE *file = fopen(vine_configs.file, "r");
fseek(file, 0, SEEK_END);
size = ftell(file);
+ if (size < 0 || size >= SIZE_MAX - 1) {
+ return -1;
+ }
buf = (unsigned char *)calloc(sizeof(unsigned char), size + 1);
fseek(file, 0, SEEK_SET);