mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
cursor: Ignore invalid cursor files
The header offset must not be smaller than file header length. Ignore such invalid files. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
This commit is contained in:
parent
5c2f31d8d6
commit
2978fd701a
1 changed files with 2 additions and 0 deletions
|
|
@ -259,6 +259,8 @@ xcursor_read_file_header(FILE *file)
|
|||
return NULL;
|
||||
if (!xcursor_read_uint(file, &head.ntoc))
|
||||
return NULL;
|
||||
if (head.header < XCURSOR_FILE_HEADER_LEN)
|
||||
return NULL;
|
||||
skip = head.header - XCURSOR_FILE_HEADER_LEN;
|
||||
if (skip)
|
||||
if (fseek(file, skip, SEEK_CUR) == EOF)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue