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

Potential Underflow Issue #83

Open
chrisg111111 opened this issue Nov 22, 2024 · 0 comments
Open

Potential Underflow Issue #83

chrisg111111 opened this issue Nov 22, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@chrisg111111
Copy link

I tried the following part of your code in a personal Wingrid tool. When _NET_FRAME_EXTENTS is 0, 0, 0, 0 and _GTK_FRAME_EXTENTS is 2, 2, 22, 10 (or similar values), the tool subtracts 2, 2, 22, 10 from 0, 0, 0, 0. However, since ext is a uint array, this results in underflow, producing values like [18446744073709551600, 18446744073709551600, 18446744073709551606, 18446744073709551584].

// Window extents (server/client decorations of the window)
extNet, _ := xprop.PropValNums(xprop.GetProperty(X, w, "_NET_FRAME_EXTENTS"))
extGtk, _ := xprop.PropValNums(xprop.GetProperty(X, w, "_GTK_FRAME_EXTENTS"))

ext := make([]uint, 4)
for i, e := range extNet {
	ext[i] += e
}
for i, e := range extGtk {
	ext[i] -= e
}
@leukipp leukipp self-assigned this Dec 17, 2024
@leukipp leukipp added the bug Something isn't working label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants