Skip to contentSkip to conversation

dbus-util: fix fixed-array file descriptor check

PATCH In review John Keeping 2 participants 2 messages Apr 7, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dbus-util: fix fixed-array file descriptor check

The code does not match the comment here since 'n' is the type code for a signed 16-bit integer. Change to use the correct type code for file descriptors to match the intent expressed by the comment.

---
 ell/dbus-util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ell/dbus-util.c +1 -1
index cd8ba7f..b6220d2 100644
@@ -716,7 +716,7 @@ bool _dbus1_iter_get_fixed_array(struct l_dbus_message_iter *iter,
 	size = get_basic_size(type);
 
 	/* Fail if the array is not a fixed size or contains file descriptors */
-	if (!size || type == 'n')
+	if (!size || type == 'h')
 		return false;
 
 	/*
Signature · 1 line
2.35.1
#1 lore raw

Hi John,

Quoted 7 lines · John Keeping

The code does not match the comment here since 'n' is the type code for a signed 16-bit integer. Change to use the correct type code for file descriptors to match the intent expressed by the comment.

---
  ell/dbus-util.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Nice catch. Applied, thanks.

Regards,
-Denis