Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safe guard against ill formed index.themes #7211

Merged
merged 1 commit into from
Aug 7, 2024
Merged

Conversation

gulafaran
Copy link
Contributor

@gulafaran gulafaran commented Aug 7, 2024

if the index.theme is ill formatted it could add invalid entries to inherits and unnecesserly scan them for cursor files, no harm there since its catched later in either "/cursors" not existing or the shape fails to load.

@vaxerski
Copy link
Member

vaxerski commented Aug 7, 2024

the integer overflows in compositor and layout are bad tho. monitor id is of type uint64_t and is initialized as -1 making it uin64_t max

just make it int then lol

@gulafaran
Copy link
Contributor Author

the integer overflows in compositor and layout are bad tho. monitor id is of type uint64_t and is initialized as -1 making it uin64_t max

just make it int then lol

yeah but there are like 100 different hits of where this is casted to uint64_t or is used as uint64_t, the least common place where it wont require +100 line change is here

@gulafaran
Copy link
Contributor Author

the integer overflows in compositor and layout are bad tho. monitor id is of type uint64_t and is initialized as -1 making it uin64_t max

just make it int then lol

yeah but there are like 100 different hits of where this is casted to uint64_t or is used as uint64_t, the least common place where it wont require +100 line change is here

https://github.com/search?q=repo%3Ahyprwm%2FHyprland%20getMonitorFromID&type=code i mean, gonna require some nifty effort to ensure it isnt overflowing on other places too its being passed uint_32t and uint64_t all over

@vaxerski
Copy link
Member

vaxerski commented Aug 7, 2024

I'd be for the ID refactor in a different MR, and doing it with typedefs.

typedef int64_t WINDOWID;
typedef int64_t MONITORID;
typedef int64_t WORKSPACEID;

etc

@gulafaran gulafaran changed the title safe guard against ill formed index.themes and avoid two implicit integer overflows safe guard against ill formed index.themes Aug 7, 2024
@gulafaran
Copy link
Contributor Author

I'd be for the ID refactor in a different MR, and doing it with typedefs.

typedef int64_t WINDOWID;
typedef int64_t MONITORID;
typedef int64_t WORKSPACEID;

etc

dropped those for now, il see if i can refactor the types then in another PR

@gulafaran
Copy link
Contributor Author

I'd be for the ID refactor in a different MR, and doing it with typedefs.

typedef int64_t WINDOWID;
typedef int64_t MONITORID;
typedef int64_t WORKSPACEID;

etc

dropped those for now, il see if i can refactor the types then in another PR

or im about to seems i force pushed the wrong commit -_-

avoid adding ill formed Inherit lines to inherit vector and later
scanning them, it wont change anything in practice but makes the inherit
theme parsing more in line with what its supposed todo. also check for
return values of the various string functions so we dont end up erasing
the wrong thing.
@gulafaran
Copy link
Contributor Author

I'd be for the ID refactor in a different MR, and doing it with typedefs.

typedef int64_t WINDOWID;
typedef int64_t MONITORID;
typedef int64_t WORKSPACEID;

etc

dropped those for now, il see if i can refactor the types then in another PR

or im about to seems i force pushed the wrong commit -_-

now

@vaxerski vaxerski merged commit a399f98 into hyprwm:main Aug 7, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants