summaryrefslogtreecommitdiff
path: root/gtk/gtksocket-x11.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-09-30 14:57:02 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-09-30 14:57:02 +0000
commit51c6eb961e77ea871c54955c282b9c55a5e98b49 (patch)
treea902eb5cd2d26dbf434ec0fdf407fa9872038acc /gtk/gtksocket-x11.c
parent56b4314ae94a98b4d785d1190784e20aae0c37b2 (diff)
downloadgtk+-51c6eb961e77ea871c54955c282b9c55a5e98b49.tar.gz
Prevent overflow when storing size hints in an unsigned short variable.
2005-09-30 Matthias Clasen <mclasen@redhat.com> * gtk/gtksocket-x11.c (_gtk_socket_windowing_size_request): Prevent overflow when storing size hints in an unsigned short variable. Tracked down by Ray Strode and Søren Sandmann.
Diffstat (limited to 'gtk/gtksocket-x11.c')
-rw-r--r--gtk/gtksocket-x11.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtksocket-x11.c b/gtk/gtksocket-x11.c
index 0470a7c896..9554d67ffc 100644
--- a/gtk/gtksocket-x11.c
+++ b/gtk/gtksocket-x11.c
@@ -101,13 +101,13 @@ _gtk_socket_windowing_size_request (GtkSocket *socket)
{
if (hints.flags & PMinSize)
{
- socket->request_width = hints.min_width;
- socket->request_height = hints.min_height;
+ socket->request_width = MAX (hints.min_width, 1);
+ socket->request_height = MAX (hints.min_height, 1);
}
else if (hints.flags & PBaseSize)
{
- socket->request_width = hints.base_width;
- socket->request_height = hints.base_height;
+ socket->request_width = MAX (hints.base_width, 1);
+ socket->request_height = MAX (hints.base_height, 1);
}
}
socket->have_size = TRUE;