Merge branch 'begin-check-index' into 'main'

tools: fix begin check index and access by array

See merge request dbus/dbus!538
This commit is contained in:
Herman Semenov 2025-08-26 00:25:25 -12:00
commit 95a14579d0

View file

@ -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;