Eclipse Tahu addresses the existence of legacy SCADA/DCS/ICS protocols and infrastructures and provides a much-needed definition of how best to apply MQTT into these existing industrial operational environments.
If the num_of_columns or num_of_rows parameter value is 0, some of the memory allocations will have size 0, so the calls to malloc() may return NULL, causing init_dataset() to return an error. Change the function to only allocate dataset->columns and dataset->types if num_of_columns is not 0, and to only allocate dataset->rows if num_of_rows is not 0, setting the pointers to NULL without returning an error when not allocated.
If the
num_of_columns
ornum_of_rows
parameter value is 0, some of the memory allocations will have size 0, so the calls tomalloc()
may returnNULL
, causinginit_dataset()
to return an error. Change the function to only allocatedataset->columns
anddataset->types
ifnum_of_columns
is not 0, and to only allocatedataset->rows
ifnum_of_rows
is not 0, setting the pointers toNULL
without returning an error when not allocated.