From 19d1f3a5ed774f69723a5515207c4ad436c34002 Mon Sep 17 00:00:00 2001 From: Luan-233 <2533556772@qq.com> Date: Thu, 21 Sep 2023 20:40:29 -0700 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BE=B9=E7=95=8C=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=EF=BC=8C=E9=98=B2=E6=AD=A2=E7=BC=96=E8=AF=91=E6=97=B6?= =?UTF-8?q?=E6=8A=A5warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- psycopg/bytes_format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psycopg/bytes_format.c b/psycopg/bytes_format.c index 8628489..0264a6d 100644 --- a/psycopg/bytes_format.c +++ b/psycopg/bytes_format.c @@ -227,7 +227,7 @@ PyObject *Bytes_Format(PyObject *format, PyObject *args, char place_holder) { } /* '%' */ } /* until end */ - if (dict) { // if args' type is dict, the func ends + if (dict || (arglen < 0) || (argidx < 0)) { // args' type is dict, the func ends if (args_owned) Py_DECREF(args); if (!(result = resize_bytes(result, reslen - rescnt))) return NULL; // resize and return if (place_holder != '%') {