mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 22:26:18 +00:00
Fixed null dereference.
This commit is contained in:
6
window.c
6
window.c
@@ -2188,7 +2188,7 @@ window_pane_float_geometry(struct window *w, struct window_pane *wp,
|
|||||||
u_int x, y, sx, sy;
|
u_int x, y, sx, sy;
|
||||||
const u_int cx = 4, cy = 2;
|
const u_int cx = 4, cy = 2;
|
||||||
|
|
||||||
if ((wp->flags & PANE_SAVED_FLOAT) &&
|
if (wp != NULL && (wp->flags & PANE_SAVED_FLOAT) &&
|
||||||
!args_has(args, 'x') && !args_has(args, 'y') &&
|
!args_has(args, 'x') && !args_has(args, 'y') &&
|
||||||
!args_has(args, 'X') && !args_has(args, 'Y')) {
|
!args_has(args, 'X') && !args_has(args, 'Y')) {
|
||||||
x = wp->saved_float_xoff;
|
x = wp->saved_float_xoff;
|
||||||
@@ -2198,7 +2198,7 @@ window_pane_float_geometry(struct window *w, struct window_pane *wp,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Default size */
|
/* Default size. */
|
||||||
sx = w->sx / 2;
|
sx = w->sx / 2;
|
||||||
sy = w->sy / 2;
|
sy = w->sy / 2;
|
||||||
|
|
||||||
@@ -2215,7 +2215,7 @@ window_pane_float_geometry(struct window *w, struct window_pane *wp,
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Position defaults to cascading when not defined */
|
/* Position defaults to cascading when not defined. */
|
||||||
if (args_has(args, 'X')) {
|
if (args_has(args, 'X')) {
|
||||||
x = args_percentage_and_expand(args, 'X', 0, USHRT_MAX, w->sx,
|
x = args_percentage_and_expand(args, 'X', 0, USHRT_MAX, w->sx,
|
||||||
item, cause);
|
item, cause);
|
||||||
|
|||||||
Reference in New Issue
Block a user