[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pq d738d21b6a 52/63: Add checks for non-local exit.
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pq d738d21b6a 52/63: Add checks for non-local exit. |
Date: |
Mon, 14 Feb 2022 23:24:27 -0500 (EST) |
branch: externals/pq
commit d738d21b6aba4b447d2dada4999fe8031a377295
Author: Andreas Seltenreich <seltenreich@gmx.de>
Commit: Andreas Seltenreich <seltenreich@gmx.de>
Add checks for non-local exit.
Check for non-local-exit after every env->get_user_ptr(). Most
functions happened to DTRT without this check by accident because they
used connection_ok on the NULL pointer returned and bailed out.
Fpq_escape was not that lucky when invoked with bogus arguments and
crashed. Per report from @717g301github.
---
pq.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/pq.c b/pq.c
index af967812f5..a7faf37845 100644
--- a/pq.c
+++ b/pq.c
@@ -161,6 +161,9 @@ Fpq_query (emacs_env *env, ptrdiff_t nargs, emacs_value
args[], void *data)
return Qnil;
PGconn *conn = env->get_user_ptr(env, args[0]);
+ if (env->non_local_exit_check (env) != emacs_funcall_exit_return)
+ return NULL;
+
if (!connection_ok(env, conn)) {
return Qnil;
}
@@ -237,6 +240,9 @@ Fpq_escape (emacs_env *env, ptrdiff_t nargs, emacs_value
args[], void *data)
return Qnil;
PGconn *conn = env->get_user_ptr(env, args[0]);
+ if (env->non_local_exit_check (env) != emacs_funcall_exit_return)
+ return NULL;
+
char *value = my_string_to_c(env, args[1]);
char *(*escaper)(PGconn *, const char *, size_t) = data;
char *quoted = escaper(conn, value, strlen(value));
@@ -252,6 +258,9 @@ Fpq_reset (emacs_env *env, ptrdiff_t nargs, emacs_value
args[], void *data)
return Qnil;
PGconn *conn = env->get_user_ptr(env, args[0]);
+ if (env->non_local_exit_check (env) != emacs_funcall_exit_return)
+ return NULL;
+
PQreset(conn);
if (!connection_ok(env, conn)) {
- [elpa] externals/pq 2f63308225 24/63: Use PQexec instead of PQexecParams when no parameters are specified., (continued)
- [elpa] externals/pq 2f63308225 24/63: Use PQexec instead of PQexecParams when no parameters are specified., ELPA Syncer, 2022/02/14
- [elpa] externals/pq a70d1fe40d 37/63: Test encoding by using some high unicode codepoints., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 795260553a 17/63: Use load-path in test.el, ELPA Syncer, 2022/02/14
- [elpa] externals/pq a03d2c2e9b 44/63: Update README, ELPA Syncer, 2022/02/14
- [elpa] externals/pq 12c54fbf15 14/63: Add undef DEFUN macro, ELPA Syncer, 2022/02/14
- [elpa] externals/pq 862bf023c0 20/63: Add processing for asynchronous notices., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 9e719959b3 12/63: Avoid global variable for pq:error symbol., ELPA Syncer, 2022/02/14
- [elpa] externals/pq ca337173dd 08/63: Explicitly free the libpq result., ELPA Syncer, 2022/02/14
- [elpa] externals/pq e1d1b77b88 34/63: test: Notice receiver., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 499dc3b50e 57/63: Re-introduce custom error signal pq:error with SQLSTATE., ELPA Syncer, 2022/02/14
- [elpa] externals/pq d738d21b6a 52/63: Add checks for non-local exit.,
ELPA Syncer <=
- [elpa] externals/pq 8151e0bc99 60/63: Add function pq:notifies to support LISTEN., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 46e38888e3 01/63: Initial commit., ELPA Syncer, 2022/02/14
- [elpa] externals/pq b72ee45524 02/63: Add .gitignore, flush tempfile., ELPA Syncer, 2022/02/14
- [elpa] externals/pq dfa4ad04bb 03/63: README: clarify., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 8e13d07737 16/63: Update Makefile, ELPA Syncer, 2022/02/14
- [elpa] externals/pq e9e1998796 10/63: Handle booleans and fix some NULL handling., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 09e320f63f 29/63: Initial travis ci configuration, ELPA Syncer, 2022/02/14
- [elpa] externals/pq 76f81f5ca5 05/63: Replace low-level functions with a higher level one., ELPA Syncer, 2022/02/14
- [elpa] externals/pq 1048d41b99 28/63: Use pg_config to detect postgresql include directory, ELPA Syncer, 2022/02/14
- [elpa] externals/pq fb79f059fb 19/63: Flush debug fprintf()s., ELPA Syncer, 2022/02/14