ucm: fix the possible buffer overflow (substitution)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2020-06-22 09:02:11 +02:00
parent b13b911605
commit 089bb8762f

View file

@ -334,7 +334,7 @@ __match2:
tmp = strchr(value + idsize, '}');
if (tmp) {
rvalsize = tmp - (value + idsize);
if (rvalsize > sizeof(v2)) {
if (rvalsize >= sizeof(v2)) {
err = -ENOMEM;
goto __error;
}