device-mapper-multipath/0121-multipathd-set-reply-length-to-zero-for-NULL-replies.patch
Benjamin Marzinski 4512f00ef1 device-mapper-multipath-0.8.7-30
Add 0120-multipath-tools-fix-multipath-ll-bug-for-Native-NVME.patch
  * Fixes RHEL-28068
Add 0121-multipathd-set-reply-length-to-zero-for-NULL-replies.patch
  * Fixes RHEL-44569
Resolves: RHEL-28068
Resolves: RHEL-44569
2024-07-30 19:30:02 -04:00

30 lines
913 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Wed, 24 Jul 2024 16:38:52 -0400
Subject: [PATCH] multipathd: set reply length to zero for NULL replies
The multipathd cli handlers add one to the reply length to account for
NULL byte, but if the reply is NULL, there is no NULL by to account for,
and len should be 0, so that mutipathd replies to clients with a
default reply.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipathd/cli.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/multipathd/cli.c b/multipathd/cli.c
index eb2e8c1d..03ad0d64 100644
--- a/multipathd/cli.c
+++ b/multipathd/cli.c
@@ -496,6 +496,9 @@ parse_cmd (char * cmd, char ** reply, int * len, void * data, int timeout )
r = h->fn(cmdvec, reply, len, data);
free_keys(cmdvec);
+ if (*reply == NULL)
+ *len = 0;
+
return r;
}