From f84cd4ced7b36fddb8e4ee24404cf7c091d27020 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sun, 30 Aug 2026 20:20:30 +0200 Subject: [PATCH] control: ctlparse - another fix for one-byte overrrun in __snd_ctl_ascii_elem_id_parse Follows 1e27d63ef6d1dcf7d1f1a1e1eca3ea779e7de377 . Link: https://lore.kernel.org/alsa-devel/CACBQ=P2FhO3M6dkv3cWuKb6Qhs92ouV+FJ3SJZ_PVBSSdJWRAQ@mail.gmail.com/ Reported-by: Harsh Raj Singhania Signed-off-by: Jaroslav Kysela --- src/control/ctlparse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/control/ctlparse.c b/src/control/ctlparse.c index c40de2bd..7132210e 100644 --- a/src/control/ctlparse.c +++ b/src/control/ctlparse.c @@ -219,7 +219,7 @@ int __snd_ctl_ascii_elem_id_parse(snd_ctl_elem_id_t *dst, const char *str, if (*str == '\'' || *str == '\"') { c = *str++; while (*str && *str != c) { - if (size < (int)sizeof(buf)) { + if (size < (int)sizeof(buf) - 1) { *ptr++ = *str; size++; } @@ -229,7 +229,7 @@ int __snd_ctl_ascii_elem_id_parse(snd_ctl_elem_id_t *dst, const char *str, str++; } else { while (*str && *str != ',') { - if (size < (int)sizeof(buf)) { + if (size < (int)sizeof(buf) - 1) { *ptr++ = *str; size++; } -- 2.52.0