mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-01 22:58:40 -04:00
scanner: Fail on empty enumerations
Without this patch, the scanner would generate invalid C which wouldn't compile anyway, so lets be nice and fail earlier and point out where the error is. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: David Fort <contact@hardening-consulting.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
parent
313b26f415
commit
0583ce741e
1 changed files with 4 additions and 0 deletions
|
|
@ -552,6 +552,10 @@ end_element(void *data, const XML_Char *name)
|
|||
strcmp(name, "event") == 0) {
|
||||
ctx->message = NULL;
|
||||
} else if (strcmp(name, "enum") == 0) {
|
||||
if (wl_list_empty(&ctx->enumeration->entry_list)) {
|
||||
fail(&ctx->loc, "enumeration %s was empty",
|
||||
ctx->enumeration->name);
|
||||
}
|
||||
ctx->enumeration = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue