git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 0a9118c) | patch
ecpg: Fix zero-termination of string generated by intoasc()
2024年2月19日 02:38:18 +0000 (11:38 +0900)
2024年2月19日 02:38:18 +0000 (11:38 +0900)
commit e77a1c58e338a1aebf00e3ae82d282f8bd32fe17
ecpg: Fix zero-termination of string generated by intoasc()

intoasc(), a wrapper for PGTYPESinterval_to_asc that converts an
interval to its textual representation, used a plain memcpy() when
copying its result. This could miss a zero-termination in the result
string, leading to an incorrect result.

The routines in informix.c do not provide the length of their result
buffer, which would allow a replacement of strcpy() to safer strlcpy()
calls, but this requires an ABI breakage and that cannot happen in
back-branches.

Author: Oleg Tselebrovskiy
Reviewed-by: Ashutosh Bapat
Discussion: https://postgr.es/m/bf47888585149f83b276861a1662f7e4@postgrespro.ru
Backpatch-through: 12
src/interfaces/ecpg/compatlib/informix.c diff | blob | blame | history
src/interfaces/ecpg/test/compat_informix/.gitignore diff | blob | blame | history
src/interfaces/ecpg/test/compat_informix/Makefile diff | blob | blame | history
src/interfaces/ecpg/test/compat_informix/intoasc.pgc [new file with mode: 0644] blob
src/interfaces/ecpg/test/compat_informix/meson.build diff | blob | blame | history
src/interfaces/ecpg/test/ecpg_schedule diff | blob | blame | history
src/interfaces/ecpg/test/expected/compat_informix-intoasc.c [new file with mode: 0644] blob
src/interfaces/ecpg/test/expected/compat_informix-intoasc.stderr [new file with mode: 0644] blob
src/interfaces/ecpg/test/expected/compat_informix-intoasc.stdout [new file with mode: 0644] blob
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /