aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt
diff options
context:
space:
mode:
authorthierry <thierry@FreeBSD.org>2007-02-05 04:48:04 +0800
committerthierry <thierry@FreeBSD.org>2007-02-05 04:48:04 +0800
commitcef458e0762c468fdede3b282e0b1154fadb3412 (patch)
tree4260654ab2692f0c89ec6e73bc7869cd5413162d /net-mgmt
parent36dec95b1e820d27cd8943a89358fa8d93409b09 (diff)
downloadfreebsd-ports-graphics-cef458e0762c468fdede3b282e0b1154fadb3412.tar.gz
freebsd-ports-graphics-cef458e0762c468fdede3b282e0b1154fadb3412.tar.zst
freebsd-ports-graphics-cef458e0762c468fdede3b282e0b1154fadb3412.zip
Add a patch to to eliminate segfaults.
PR: ports/108693 Submitted by: Kevin Oberman <oberman (at) es.net> (maintainer)
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/irrtoolset/Makefile1
-rw-r--r--net-mgmt/irrtoolset/files/patch-src-irr-rawhoisc.cc69
2 files changed, 70 insertions, 0 deletions
diff --git a/net-mgmt/irrtoolset/Makefile b/net-mgmt/irrtoolset/Makefile
index 74b31203869..5431d7c330f 100644
--- a/net-mgmt/irrtoolset/Makefile
+++ b/net-mgmt/irrtoolset/Makefile
@@ -7,6 +7,7 @@
PORTNAME= irrtoolset
PORTVERSION= 4.8.4
+PORTREVISION= 1
CATEGORIES= net-mgmt
MASTER_SITES= ${MASTER_SITE_ISC} \
ftp://ftp.ripe.net/tools/
diff --git a/net-mgmt/irrtoolset/files/patch-src-irr-rawhoisc.cc b/net-mgmt/irrtoolset/files/patch-src-irr-rawhoisc.cc
new file mode 100644
index 00000000000..0da4d79d783
--- /dev/null
+++ b/net-mgmt/irrtoolset/files/patch-src-irr-rawhoisc.cc
@@ -0,0 +1,69 @@
+
+Add the following file as files/patch-src-irr-rawhoisc.cc and bump
+PORTREVISION (to 1).
+
+--- src/irr/rawhoisc.cc.orig Thu Jun 8 08:16:26 2006
++++ src/irr/rawhoisc.cc Tue Jan 23 15:14:24 2007
+@@ -1,4 +1,4 @@
+-// $Id: rawhoisc.cc,v 4.11 2006/06/08 15:16:26 shane Exp $
++// $Id: rawhoisc.cc,v 4.11.10.1 2006/12/08 08:33:52 shane Exp $
+ // Copyright (c) 2001,2002 RIPE NCC
+ //
+ // All Rights Reserved
+@@ -187,7 +187,7 @@
+ }
+
+ void RAWhoisClient::GetVersion() {
+- char *buffer = (char *) calloc (80,1);
++ char *buffer;
+ char *start;
+
+ if (! _is_open)
+@@ -199,7 +199,7 @@
+ start = start + 8; //jump
+ version = atoi(start)*10 + atoi(start+2); // x.x... format
+ Trace(TR_WHOIS_RESPONSE) << "Whois: Response " << buffer << endl;
+- free(buffer);
++ delete [] buffer;
+ }
+
+ void RAWhoisClient::SetSources(const char *_sources) {
+@@ -298,9 +298,11 @@
+ return 0;
+ }
+ if (is_rpslng()) {
+- response = strdup("");
+- char *prev;
++ response = new char[1];
++ response[0] = '\0';
++ char *prev = NULL;
+ do {
++ free(prev);
+ prev = strdup(buffer);
+ Trace(TR_WHOIS_RESPONSE) << "Whois: Response <<\n" << buffer <<">>"<< endl;
+ if (strstr (buffer, "route") || strstr(buffer, "route6")) {
+@@ -315,18 +317,20 @@
+ // save response
+ tmp = strdup (response);
+ // allocate new string
++ delete [] response;
+ response = new char [strlen(tmp) + strlen(end_prefix) + 2];
+- memset(response, 0, strlen(response));
+ // copy old and new response
+- strncat (response, tmp, strlen(tmp));
+- strncat (response, " ", 1);
+- strncat (response, end_prefix, strlen(end_prefix));
++ strcpy(response, tmp);
++ strcat(response, " ");
++ strcat(response, end_prefix);
+ free(tmp);
+ }
+ } while (fgets(buffer, sizeof(buffer), in) &&
+ // this condition should work with irrd version >= 2.2b19
+ // until then, ripe-style queries won't work with persistent connections
+ !((*prev == '\n') && (*buffer == '\n')));
++
++ free(prev);
+
+ // The WHOIS protocol and RPSL give no indication of
+ // end of a protocol data unit, so we need to keep