-
Notifications
You must be signed in to change notification settings - Fork 883
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix string literal length for compressed_data_info
The function `compressed_data_info` returns a record containing `name` but copies the data from string literal. Since `heap_form_tuple` expects a `name` value as source as well, it will copy too much data from the source, leading to ASAN complaining about copying outside the allocated range of data. The problem is fixed by using buffers of size `NAMEDATALEN` for each source string, ensuring that each of the string literals has sufficient data for being copied as names.
- Loading branch information
Showing
3 changed files
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fixes: #7187 Fix string literal length for compressed_data_info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
CREATE FUNCTION _timescaledb_functions.compressed_data_info(_timescaledb_internal.compressed_data) | ||
RETURNS TABLE (algorithm name, has_nulls bool) | ||
AS 'SELECT NULL,FALSE' LANGUAGE SQL STRICT IMMUTABLE SET search_path = pg_catalog, pg_temp; | ||
AS $$ SELECT ''::name,FALSE $$ | ||
LANGUAGE SQL STRICT IMMUTABLE | ||
SET search_path = pg_catalog, pg_temp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters