From 7095e150977d0b4ffd5804d075a50d35f08b1e63 Mon Sep 17 00:00:00 2001 From: GermanAizek Date: Sat, 23 Aug 2025 00:02:56 +0300 Subject: [PATCH] tools: fix begin check index and access by array This excludes accessing to array by non-valid index. --- tools/dbus-print-message.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/dbus-print-message.c b/tools/dbus-print-message.c index 08517a6f..b656d9a3 100644 --- a/tools/dbus-print-message.c +++ b/tools/dbus-print-message.c @@ -134,8 +134,8 @@ print_ay (DBusMessageIter *iter, int depth) for (i = 0; i < len; i++) { - if ((bytes[i] < 32 || bytes[i] > 126) && - (i < len - 1 || bytes[i] != '\0')) + if ((i < len - 1 || bytes[i] != '\0') && + (bytes[i] < 32 || bytes[i] > 126)) { all_ascii = FALSE; break;