summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-03-12 19:25:50 -0500
committerSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-03-12 19:25:50 -0500
commit08939ef8428d4cde3c76adef1ec8ef253c3f669c (patch)
tree644e01749a64a19698476833f8f085e966f49146
parentcd874b642ce9f86d63583b6a2d012d5f445895da (diff)
downloadscreen-08939ef8428d4cde3c76adef1ec8ef253c3f669c.tar.gz
Fix an invalid memory read.
Thanks a bunch to Friedrich Delgado Friedrichs for providing the valgrind logs.
-rw-r--r--src/resize.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/resize.c b/src/resize.c
index 7782c2b..5d1df4b 100644
--- a/src/resize.c
+++ b/src/resize.c
@@ -369,8 +369,7 @@ struct display *norefdisp;
/* If 'flayer' and 'l' are for the same window, then we will not
* restore 'flayer'. */
if (oldflayer && (l == oldflayer || Layer2Window(oldflayer) == p))
- while (oldflayer->l_next)
- oldflayer = oldflayer->l_next;
+ oldflayer = NULL;
flayer = l;
@@ -413,7 +412,7 @@ struct display *norefdisp;
/* If we started resizing a non-flayer layer, then restore the flayer.
* Otherwise, flayer should already be updated to the topmost foreground layer. */
- if (Layer2Window(flayer) != Layer2Window(oldflayer))
+ if (oldflayer)
flayer = oldflayer;
display = olddisplay;
}