Skip to content

Potential Underflow Issue #83

@chrisgoldberg1

Description

@chrisgoldberg1

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
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions