Linux maintainer tooling and workflows
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Kernel.org Tools" <tools@kernel.org>
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Subject: [PATCH b4 v2 5/5] misc/send-receive: require messages payload to be a list
Date: Sun, 11 Oct 2026 22:58:30 -0700	[thread overview]
Message-ID: <20261011-send-series-bcc-v2-5-cd17584c40fb@gmail.com> (raw)
In-Reply-To: <20261011-send-series-bcc-v2-0-cd17584c40fb@gmail.com>

In Python, str is a subclass of collections.abc.Sequence, so checking
isinstance(umsgs, Sequence) accepts a bare string value for "messages"
and iterates over individual characters during validation.

Check isinstance(umsgs, list) directly so non-array JSON values for
"messages" immediately fail with "Invalid messages array".

Assisted-by: LLM
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 misc/send-receive.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/send-receive.py b/misc/send-receive.py
index 22e049b..96eb3fb 100644
--- a/misc/send-receive.py
+++ b/misc/send-receive.py
@@ -514,7 +514,7 @@ class SendReceiveListener(object):
         if not umsgs:
             self.send_error(resp, message='Missing the messages array')
             return
-        if not isinstance(umsgs, Sequence):
+        if not isinstance(umsgs, list):
             self.send_error(resp, message='Invalid messages array')
             return
         logger.debug('Received a request for %s messages', len(umsgs))

-- 
2.56.0.385.gd3acb90ef8-goog


  parent reply	other threads:[~2026-10-12  5:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12  5:58 [PATCH b4 v2 0/5] b4: Implement BCC support for patch submissions and review Dmitry Torokhov
2026-10-12  5:58 ` [PATCH b4 v2 1/5] misc/send-receive: support BCC in web submission endpoint Dmitry Torokhov
2026-10-12  5:58 ` [PATCH b4 v2 2/5] b4: implement --bcc and send-series-bcc config option Dmitry Torokhov
2026-10-12  5:58 ` [PATCH b4 v2 3/5] b4: handle per-message Bcc headers in send_mail and TUIs Dmitry Torokhov
2026-10-12  5:58 ` [PATCH b4 v2 4/5] b4: reject Bcc trailers in patches and cover letter Dmitry Torokhov
2026-10-12  5:58 ` Dmitry Torokhov [this message]
2026-11-13  2:00 ` [PATCH b4 v2 0/5] b4: Implement BCC support for patch submissions and review Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261011-send-series-bcc-v2-5-cd17584c40fb@gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=konstantin@linuxfoundation.org \
    --cc=tools@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox