The following issues were found
test/sql/broken_tables.sql
1 issues
Line: 8
Column: 1
-- Hypertables can break as a result of race conditions, but we should
-- still not crash when trying to truncate or delete the broken table.
\c :TEST_DBNAME :ROLE_SUPERUSER
CREATE VIEW missing_slices AS
SELECT DISTINCT
dimension_slice_id,
constraint_name,
Reported by SQLint.
src/time_utils.c
1 issues
Line: 545
Column: 43
CWE codes:
126
ts_get_mock_time_or_current_time(void)
{
Datum res;
if (ts_current_timestamp_mock != NULL && strlen(ts_current_timestamp_mock) != 0)
{
res = DirectFunctionCall3(timestamptz_in,
CStringGetDatum(ts_current_timestamp_mock),
0,
Int32GetDatum(-1));
Reported by FlawFinder.
src/telemetry/uuid.c
1 issues
Line: 41
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
{
TimestampTz ts = GetCurrentTimestamp();
memcpy(&gen_uuid[8], &ts, sizeof(TimestampTz));
}
gen_uuid[6] = (gen_uuid[6] & 0x0f) | 0x40; /* "version" field */
gen_uuid[8] = (gen_uuid[8] & 0x3f) | 0x80; /* "variant" field */
Reported by FlawFinder.
src/tablespace.c
1 issues
Line: 54
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
tspc = &tspcs->tablespaces[tspcs->num_tablespaces++];
memcpy(&tspc->fd, form, sizeof(FormData_tablespace));
tspc->tablespace_oid = tspc_oid;
return tspc;
}
Reported by FlawFinder.
src/process_utility.c
1 issues
Line: 571
Column: 3
CWE codes:
134
Suggestion:
Use a constant for the format specification
args->completion_tag->nprocessed = processed;
#else
if (args->completion_tag)
snprintf(args->completion_tag, COMPLETION_TAG_BUFSIZE, "COPY " UINT64_FORMAT, processed);
#endif
add_hypertable_to_process_args(args, ht);
ts_cache_release(hcache);
Reported by FlawFinder.
src/adts/vec.h
1 issues
Line: 213
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
VEC_RESERVE(vec, num_elements);
Assert(vec->num_elements < vec->max_elements);
first_new_element = vec->data + vec->num_elements;
memcpy(first_new_element, elements, sizeof(*elements) * num_elements);
vec->num_elements += num_elements;
return first_new_element;
}
VEC_SCOPE void
Reported by FlawFinder.
tsl/test/sql/debug_notice.sql
1 issues
Line: 13
Column: 1
-- and `get_foreign_upper_paths` respectively, but if that changes,
-- they might need to be changed.
\c :TEST_DBNAME :ROLE_CLUSTER_SUPERUSER
\set DN_DBNAME_1 :TEST_DBNAME _1
\set DN_DBNAME_2 :TEST_DBNAME _2
\set DN_DBNAME_3 :TEST_DBNAME _3
-- Add data nodes using the TimescaleDB node management API
Reported by SQLint.
src/plan_expand_hypertable.c
1 issues
Line: 1465
Column: 9
CWE codes:
126
Suggestion:
This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it
*/
foreach (lc_ri, ctx->restrictions)
{
if (equal(castNode(RestrictInfo, lfirst(lc_ri))->clause, propagated))
{
new_qual = false;
break;
}
}
Reported by FlawFinder.
src/nodes/hypertable_insert.c
1 issues
Line: 496
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
hipath = palloc0(sizeof(HypertableInsertPath));
/* Copy costs, etc. */
memcpy(&hipath->cpath.path, path, sizeof(Path));
hipath->cpath.path.type = T_CustomPath;
hipath->cpath.path.pathtype = T_CustomScan;
hipath->cpath.custom_paths = list_make1(mtpath);
hipath->cpath.methods = &hypertable_insert_path_methods;
hipath->distributed_insert_plans = distributed_insert_plans;
Reported by FlawFinder.
src/nodes/chunk_insert_state.c
1 issues
Line: 294
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* If no tuple conversion between the chunk and root hyper relation is
* needed, we can get away with a (mostly) shallow copy */
memcpy(onconfl, hyper_rri->ri_onConflict, sizeof(OnConflictSetState));
chunk_rri->ri_onConflict = onconfl;
}
static ExprState *
Reported by FlawFinder.