Returning non-terminated string in ECPG Informix-compatible function

2024-01-29 Thread o . tselebrovskiy
Greetings, everyone! While analyzing output of Svace static analyzer [1] I've found a bug. In function intoasc(interval * i, char *str) from file src/interfaces/ecpg/compatlib/informix.c we return a non-terminated string since we use memcpy on tmp which is itself NULL-teminated but last zero

Valgrind errors on 32-bit OS

2023-07-10 Thread o . tselebrovskiy
Greetings, everyone! While working on an extension, I've found myself using valgrind on a 32-bit OS (Debian 11) and after executing any query (even 'select 1;') under valgrind I've been shown the same error everytime: ==00:00:00:18.109 2528== VALGRINDERROR-BEGIN ==00:00:00:18.109 2528== Use o

Error in calculating length of encoded base64 string

2023-06-08 Thread o . tselebrovskiy
Greetings, everyone! While working on an extension I've found an error in how length of encoded base64 string is calulated; This error is present in 3 files across all supported versions: /src/common/base64.c, function pg_b64_enc_len; /src/backend/utils/adt/encode.c, function pg_base64_enc_le

A bug with ExecCheckPermissions

2023-02-08 Thread o . tselebrovskiy
Greetings, everyone! While working on an extension my colleague and I have found an interesting case; When you try to execute next SQL statements on master branch of PostgreSQL: CREATE TABLE parted_fk_naming ( id bigint NOT NULL default 1, id_abc bigint,