diff options
| author | chenzizhan <[email protected]> | 2023-10-20 16:44:06 +0800 |
|---|---|---|
| committer | chenzizhan <[email protected]> | 2023-10-20 16:44:06 +0800 |
| commit | e5139c45f2ac53b1fdf8538f01092cf4a78a32bd (patch) | |
| tree | a7d149377a125802020d526000fc3d40a15cc647 | |
| parent | f5e95d386adad3b4ab21cc5dc4522d21f7ed2b04 (diff) | |
fix: cell id checkv4.4.0b
| -rw-r--r-- | src/fieldstat.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/fieldstat.c b/src/fieldstat.c index 92bcae2..89ac879 100644 --- a/src/fieldstat.c +++ b/src/fieldstat.c @@ -659,6 +659,9 @@ int fieldstat_hll_add(struct fieldstat *instance, int cube_id, int metric_id, co return FS_ERR_INVALID_PARAM; } int cell_id = fieldstat_cube_add(instance, cube_id, tags, n_tag, 0); + if (cell_id < 0) { + return FS_ERR_TOO_MANY_CELLS; + } struct metric *metric = find_or_add_metric(instance, cube_id, metric_id); metric_hll_add(metric, cell_id, key, key_len); @@ -676,6 +679,9 @@ int fieldstat_hist_record(struct fieldstat *instance, int cube_id, int metric_id } int cell_id = fieldstat_cube_add(instance, cube_id, tags, n_tag, 0); + if (cell_id < 0) { + return FS_ERR_TOO_MANY_CELLS; + } struct metric *metric = find_or_add_metric(instance, cube_id, metric_id); ret = metric_histogram_record(metric, cell_id, value); |
