PsppireOutputView redefined parameter y to be of type long.
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 21 Jun 2015 06:10:46 +0000 (08:10 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 21 Jun 2015 06:17:44 +0000 (08:17 +0200)
The variable y was defined as int, but being cast to long when set in the tree store.  This seems like it
could give rise to integer overflow.  This change redefines y to be of type long.

Possibly related to bug #45272

src/ui/gui/psppire-output-view.c

index 83029959cff2bd907514540faf9bc8eb34b79f98..93afbd6035d7be38183a74fd9497c75d31bcf932 100644 (file)
@@ -54,7 +54,7 @@ struct psppire_output_view
     GtkLayout *output;
     int render_width;
     int max_width;
-    int y;
+    glong y;
 
     struct string_map render_opts;
     GtkTreeView *overview;
@@ -371,7 +371,7 @@ psppire_output_view_put (struct psppire_output_view *view,
       gtk_tree_store_set (store, &iter,
                           COL_NAME, ds_cstr (&name),
                          COL_ADDR, item,
-                          COL_Y, (glong)(view->y),
+                          COL_Y, (view->y),
                           -1);
       ds_destroy (&name);