*/
case FR_TYPE_DATE:
{
- int i, length = 4;
+ size_t i, length = 4;
int precision = FR_TIME_RES_SEC;
uint64_t date;
struct timespec ts;
precision = enumv->flags.type_size;
}
+ /*
+ * Input data doesn't match what we were told we
+ * need.
+ */
+ if (len != length) return -1;
+
/*
* Just loop over the input data until we reach
* the end. Shifting it every time.
case FR_TYPE_TIME_DELTA:
{
- int i, length = 4;
+ size_t i, length = 4;
int precision = FR_TIME_RES_SEC;
uint64_t date;
precision = enumv->flags.type_size;
}
+ /*
+ * Input data doesn't match what we were told we
+ * need.
+ */
+ if (len != length) return -1;
+
/*
* Just loop over the input data until we reach
* the end. Shifting it every time.