rpms/gnome-applet-netspeed/F-11 netspeed_applet-0.15.2-graph.patch, NONE, 1.1 gnome-applet-netspeed.spec, 1.19, 1.20

Michael Schwendt mschwendt at fedoraproject.org
Wed Apr 14 20:57:30 UTC 2010


Author: mschwendt

Update of /cvs/pkgs/rpms/gnome-applet-netspeed/F-11
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv3195

Modified Files:
	gnome-applet-netspeed.spec 
Added Files:
	netspeed_applet-0.15.2-graph.patch 
Log Message:
* Wed Apr 14 2010 Michael Schwendt <mschwendt at fedoraproject.org> - 0.15.2-3.2
- Fix out-of-bounds array access for the in/out graph,
  and center it a bit more horizontally.


netspeed_applet-0.15.2-graph.patch:
 netspeed.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- NEW FILE netspeed_applet-0.15.2-graph.patch ---
diff -Nur netspeed_applet-0.15.2-orig/src/netspeed.c netspeed_applet-0.15.2/src/netspeed.c
--- netspeed_applet-0.15.2-orig/src/netspeed.c	2008-09-13 21:59:52.000000000 +0200
+++ netspeed_applet-0.15.2/src/netspeed.c	2010-04-14 19:17:07.000000000 +0200
@@ -463,18 +463,18 @@
 	
 	/* calculate the polygons (GdkPoint[]) for the graphs */ 
 	offset = 0;
-	for (i = applet->index_graph + 1; applet->in_graph[i] < 0; i = (i + 1) % GRAPH_VALUES)
+	for (i = applet->index_graph + 1; applet->in_graph[i%GRAPH_VALUES] < 0; i = (i + 1) % GRAPH_VALUES)
 		offset++;
 	for (i = offset + 1; i < GRAPH_VALUES; i++)
 	{
 		int index = (applet->index_graph + i) % GRAPH_VALUES;
-		out_points[i].x = in_points[i].x = ((w - 8) * i) / GRAPH_VALUES + 2;
+		out_points[i].x = in_points[i].x = ((w - 6) * i) / GRAPH_VALUES + 4;
 		in_points[i].y = h - 6 - (int)((h - 8) * applet->in_graph[index] / max_val);
 		out_points[i].y = h - 6 - (int)((h - 8) * applet->out_graph[index] / max_val);
 	}	
-	in_points[offset].x = out_points[offset].x = ((w - 8) * offset) / GRAPH_VALUES + 2;
-	in_points[offset].y = in_points[offset + 1].y;
-	out_points[offset].y = out_points[offset + 1].y;
+	in_points[offset].x = out_points[offset].x = ((w - 6) * offset) / GRAPH_VALUES + 4;
+	in_points[offset].y = in_points[(offset + 1) % GRAPH_VALUES].y;
+	out_points[offset].y = out_points[(offset + 1) % GRAPH_VALUES].y;
 	
 	/* draw the background */
 	gdk_gc_set_rgb_fg_color (gc, &da->style->black);


Index: gnome-applet-netspeed.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-applet-netspeed/F-11/gnome-applet-netspeed.spec,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -p -r1.19 -r1.20
--- gnome-applet-netspeed.spec	12 Feb 2010 11:22:33 -0000	1.19
+++ gnome-applet-netspeed.spec	14 Apr 2010 20:57:29 -0000	1.20
@@ -1,6 +1,6 @@
 Name:           gnome-applet-netspeed    
 Version:        0.15.2
-Release:        3%{?dist}.1
+Release:        3%{?dist}.2
 Summary:        GNOME applet that shows traffic on a network device
 
 Group:          Applications/Internet
@@ -15,6 +15,10 @@ Patch0: netspeed_applet-0.15.2-follow-de
 Patch1: netspeed_applet-0.15.2-icon-theme-update.patch
 # GNOME bz 567079
 Patch2: netspeed_applet-0.15.2-wireless-quality.patch
+# don't exceed array boundaries for applet->in_graph (read access)
+# and arrays in_points/out_points (write access)
+# plus: center graph a bit more horizontally
+Patch3: netspeed_applet-0.15.2-graph.patch
 
 BuildRequires:  pkgconfig, gettext, scrollkeeper, intltool
 BuildRequires:  libgtop2-devel
@@ -36,6 +40,7 @@ specified network device (for example et
 %patch0 -p1 -b .follow-default-route
 %patch1 -p1 -b .icon-theme-update
 %patch2 -p1 -b .wireless-quality
+%patch3 -p1 -b .graph-issues
 
 
 %build
@@ -91,6 +96,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/omf/netspeed_applet/
 
 %changelog
+* Wed Apr 14 2010 Michael Schwendt <mschwendt at fedoraproject.org> - 0.15.2-3.2
+- Fix out-of-bounds array access for the in/out graph,
+  and center it a bit more horizontally.
+
 * Fri Feb 12 2010 Michael Schwendt <mschwendt at fedoraproject.org> - 0.15.2-3.1
 - Fix "follow default route" feature (also upstream bz 593346).
 - Fix superfluous wireless quality icon updates (upstream bz 580683).



More information about the scm-commits mailing list