OSDN Git Service

ucm: fix the possible buffer overflow (substitution)
authorJaroslav Kysela <perex@perex.cz>
Mon, 22 Jun 2020 07:02:11 +0000 (09:02 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 22 Jun 2020 07:05:05 +0000 (09:05 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/ucm/ucm_subs.c

index e6af502..293426f 100644 (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;
                        }