mirror of
https://github.com/postgres/postgres.git
synced 2026-06-10 01:00:11 -04:00
ECPGdeallocate_all(), ECPGprepared_statement(), ECPGget_desc(), and ecpg_freeStmtCacheEntry() could crash with a SIGSEGV when called without an established connection (for example, when EXEC SQL CONNECT was forgotten or a non-existent connection name was used), because they dereferenced the result of ecpg_get_connection() without first checking it for NULL. Each site is fixed in the style of the surrounding code. New tests are added for these conditions. Author: Shruthi Gowda <gowdashru@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Reviewed-by: Mahendra Singh Thalor <mahi6run@gmail.com> Reviewed-by: Nishant Sharma <nishant.sharma@enterprisedb.com> Discussion: https://postgr.es/m/3007317.1765210195@sss.pgh.pa.us Backpatch-through: 14
13 lines
326 B
Makefile
13 lines
326 B
Makefile
subdir = src/interfaces/ecpg/test/connect
|
|
top_builddir = ../../../../..
|
|
include $(top_builddir)/src/Makefile.global
|
|
include $(top_srcdir)/$(subdir)/../Makefile.regress
|
|
|
|
TESTS = test1 test1.c \
|
|
test2 test2.c \
|
|
test3 test3.c \
|
|
test4 test4.c \
|
|
test5 test5.c \
|
|
test6 test6.c
|
|
|
|
all: $(TESTS)
|