mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-04-02 07:15:53 -04:00
scanner: Fail if 'since' is higher than the interface version
If an event or request have a "since" attribute that is larger than the version of the interface it is in, fail with an explaining error message. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
This commit is contained in:
parent
2f666ee34f
commit
3de1783e50
1 changed files with 5 additions and 1 deletions
|
|
@ -674,8 +674,12 @@ start_element(void *data, const char *element_name, const char **atts)
|
||||||
|
|
||||||
if (since != NULL) {
|
if (since != NULL) {
|
||||||
version = strtouint(since);
|
version = strtouint(since);
|
||||||
if (version == -1)
|
if (version == -1) {
|
||||||
fail(&ctx->loc, "invalid integer (%s)\n", since);
|
fail(&ctx->loc, "invalid integer (%s)\n", since);
|
||||||
|
} else if (version > ctx->interface->version) {
|
||||||
|
fail(&ctx->loc, "since (%u) larger than version (%u)\n",
|
||||||
|
version, ctx->interface->version);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
version = 1;
|
version = 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue