[nc] Initialize range (#710464)

Petr Sabata psabata at fedoraproject.org
Fri Jun 3 13:31:07 UTC 2011


commit 3944df611db626b22fa83634c1d0b61cc6da9f5b
Author: Petr Sabata <contyk at redhat.com>
Date:   Fri Jun 3 15:31:00 2011 +0200

    Initialize range (#710464)

 nc-1.100-initialize-range.patch |   13 +++++++++++++
 nc.spec                         |   11 ++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/nc-1.100-initialize-range.patch b/nc-1.100-initialize-range.patch
new file mode 100644
index 0000000..3b6387d
--- /dev/null
+++ b/nc-1.100-initialize-range.patch
@@ -0,0 +1,13 @@
+diff --git a/netcat.c b/netcat.c
+index b7e4d5e..ad57e4e 100644
+--- a/netcat.c
++++ b/netcat.c
+@@ -762,7 +762,7 @@ build_ports(char *p)
+ {
+ 	const char *errstr;
+ 	char *n, *comma;
+-	int hi, lo, cp;
++	int hi = 0, lo = 0, cp;
+ 	int x = 0;
+ 
+ 	do {
diff --git a/nc.spec b/nc.spec
index 69412c2..2174a53 100644
--- a/nc.spec
+++ b/nc.spec
@@ -1,7 +1,7 @@
 Summary:    Reads and writes data across network connections using TCP or UDP
 Name:       nc
 Version:    1.100
-Release:    2%{?dist}
+Release:    3%{?dist}
 URL:        http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
 License:    BSD ISC
 Group:      Applications/Internet
@@ -16,6 +16,7 @@ Patch4:     nc-1.100-crlf.patch
 Patch5:     nc-1.100-comma.patch
 Patch6:     nc-1.100-libbsd.patch
 Patch7:     nc-1.100-format-size_t.patch
+Patch8:     nc-1.100-initialize-range.patch
 
 BuildRequires: libbsd-devel
 
@@ -42,10 +43,11 @@ capabilities.
 %patch5 -p1 -b .comma
 %patch6 -p1 -b .libbsd
 %patch7 -p1 -b .format-size_t
+%patch8 -p1 -b .initialize-range
 cp -p %{SOURCE1} .
 
 %build
-gcc $RPM_OPT_FLAGS `pkg-config --cflags --libs libbsd` -o nc netcat.c atomicio.c socks.c b64_ntop.c
+gcc %{optflags} `pkg-config --cflags --libs libbsd` -o nc netcat.c atomicio.c socks.c b64_ntop.c
 
 %install
 install -d %{buildroot}%{_bindir}
@@ -54,11 +56,14 @@ install -d %{buildroot}%{_mandir}/man1
 install -m 644 nc.1 %{buildroot}%{_mandir}/man1
 
 %files
-%defattr(-,root,root)
 %{_bindir}/nc
 %{_mandir}/man1/nc.1*
 
 %changelog
+* Fri Jun 03 2011 Petr Sabata <contyk at redhat.com> - 1.100-3
+- Initialize range (#710464)
+- Remove defattr macro
+
 * Mon Apr 11 2011 Petr Sabata <psabata at redhat.com> - 1.100-2
 - Include libbsd stdlib, rhbz#694407
 - Use %zd format for size_t


More information about the scm-commits mailing list