diff options
| author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2026-10-13 14:28:33 +0200 |
|---|---|---|
| committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2026-10-16 13:23:34 +0200 |
| commit | 7283c8c0ac9db8b38bb280576668256023d82fb4 (patch) | |
| tree | d5f925d5020fda87db91c7c3b9e7a4f74377b3c8 /LICENSE | |
| parent | 44dbc6809d05b8f2addc483f882e670db0b6b8e9 (diff) | |
check and restrict size hint values
Could not reproduce a crash, but may mess up window geometry, etc.
Test program below to give an idea:
cc repro.c -o repro -lX11; ./repro
int
main(void)
{
Display *d;
int screen;
Window root;
Window win;
d = XOpenDisplay(NULL);
if (!d) {
fprintf(stderr, "XOpenDisplay failed\n");
return 1;
}
screen = DefaultScreen(d);
root = RootWindow(d, screen);
win = XCreateSimpleWindow(d, root, 0, 0, 100, 100, 0, 0, 0);
if (!win) {
fprintf(stderr, "XCreateSimpleWindow failed\n");
XCloseDisplay(d);
return 1;
}
//XMapWindow(d, win);
XMapRaised(d, win);
XSizeHints h = {0};
h.flags = PResizeInc | PBaseSize | PMinSize;
h.width_inc = -1;
h.height_inc = -1;
h.base_width = INT_MIN + 500; /* window is 500px wide */
h.base_height = 0;
h.min_width = ~0L;
h.min_height = ~0L;
XSetWMNormalHints(d, win, &h);
sleep(3);
//XDestroyWindow(d, win);
XCloseDisplay(d);
return 0;
}
Diffstat (limited to 'LICENSE')
0 files changed, 0 insertions, 0 deletions
