From 2a122485b3899e70f56aa27065caeed1ec3ec715 Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Sat, 10 Aug 2024 18:56:24 -0400 Subject: [PATCH] scanner: Reject version 0 It is not valid in Wayland. Signed-off-by: Demi Marie Obenour --- src/scanner.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scanner.c b/src/scanner.c index 3f7bc1fe..241755b6 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -752,6 +752,8 @@ start_element(void *data, const char *element_name, const char **atts) version = strtouint(atts[i + 1]); if (version == -1) fail(&ctx->loc, "wrong version (%s)", atts[i + 1]); + if (version == 0) + fail(&ctx->loc, "version 0 is invalid"); } else if (strcmp(atts[i], "type") == 0) type = atts[i + 1]; else if (strcmp(atts[i], "value") == 0)