public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in net-analyzer/bwmon/files: bwmon-1.3-overflow.patch bwmon-1.3-build.patch
@ 2012-11-05  2:58 Diego Petteno (flameeyes)
  0 siblings, 0 replies; only message in thread
From: Diego Petteno (flameeyes) @ 2012-11-05  2:58 UTC (permalink / raw
  To: gentoo-commits

flameeyes    12/11/05 02:58:43

  Added:                bwmon-1.3-overflow.patch bwmon-1.3-build.patch
  Log:
  Fix overflow identified by Vicente Olivert Riera in bug #441420; use a patch instead of a chain of seds for the makefile changes, which also saves us from using flag-o-matic.
  
  (Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key 1CD13C8AD4301342)

Revision  Changes    Path
1.1                  net-analyzer/bwmon/files/bwmon-1.3-overflow.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/bwmon/files/bwmon-1.3-overflow.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/bwmon/files/bwmon-1.3-overflow.patch?rev=1.1&content-type=text/plain

Index: bwmon-1.3-overflow.patch
===================================================================
Index: bwmon-1.3/src/bwmon.c
===================================================================
--- bwmon-1.3.orig/src/bwmon.c
+++ bwmon-1.3/src/bwmon.c
@@ -408,7 +408,7 @@ bool_t
 print_uptime(float * uptime) 
 {
 	unsigned int tmp = 0, hour = 0, min = 0, sec = 0;
-	char hostname[30];
+	char hostname[50];
 
 	tmp = (uint)(*uptime);
 	sec = tmp % 60;
@@ -418,7 +418,7 @@ print_uptime(float * uptime)
 	hour = tmp % 24;
 	tmp = (tmp - hour) / 24;
 
-	if (gethostname(hostname, strlen(hostname)) != 0)
+	if (gethostname(hostname, sizeof(hostname)) != 0)
 		strcpy(hostname, "System");
 
 	printw("\n%s uptime: %u day%c %u hour%c %u minutes and %u seconds\n", 



1.1                  net-analyzer/bwmon/files/bwmon-1.3-build.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/bwmon/files/bwmon-1.3-build.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/bwmon/files/bwmon-1.3-build.patch?rev=1.1&content-type=text/plain

Index: bwmon-1.3-build.patch
===================================================================
Index: bwmon-1.3/src/Makefile
===================================================================
--- bwmon-1.3.orig/src/Makefile
+++ bwmon-1.3/src/Makefile
@@ -10,8 +10,8 @@ CC = gcc
 RM = /bin/rm
 INSTALL = install
 
-CFLAGS = -I../include -Wall -D__THREADS
-LDFLAGS = -lpthread -lncurses 
+CFLAGS += -I../include -Wall -D__THREADS
+LIBS = -lpthread -lncurses 
 
 SRC = bwmon.c
 OBJS = $(SRC:.c=.o)
@@ -19,7 +19,7 @@ OBJS = $(SRC:.c=.o)
 all: bwmon
 
 bwmon: $(OBJS)
-	$(CC) $(LDFLAGS) -o ../$@ $(OBJS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o ../$@ $(OBJS) $(LIBS)
 
 clean:
 	@for i in $(OBJS) *~ core bwmon; do \





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-05  2:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-05  2:58 [gentoo-commits] gentoo-x86 commit in net-analyzer/bwmon/files: bwmon-1.3-overflow.patch bwmon-1.3-build.patch Diego Petteno (flameeyes)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox