aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroam <roam@FreeBSD.org>2002-06-25 00:03:00 +0800
committerroam <roam@FreeBSD.org>2002-06-25 00:03:00 +0800
commitaf41e90ee4c15a32136d0a200a62322f58bc1664 (patch)
tree20d7be06cb2b5e5bd94bce1a05b77df39870c104
parentfc44b9c1b141373040aaf36cca997a690ef161f8 (diff)
downloadfreebsd-ports-gnome-af41e90ee4c15a32136d0a200a62322f58bc1664.tar.gz
freebsd-ports-gnome-af41e90ee4c15a32136d0a200a62322f58bc1664.tar.zst
freebsd-ports-gnome-af41e90ee4c15a32136d0a200a62322f58bc1664.zip
Fix a segfault in an IPv4-only case - realloc() may really, well,
"reallocate" memory even when the programmer only asks for a resizing of the region. Reported by: Steve Ames <steve@energistic.com> While I'm here, change the way SSL header and library paths are handled to avoid specifically referencing /usr/lib and /usr/include; while -STABLE's GCC shrugs this off, GCC 3.1 whines loudly about an explicit -I/usr/include (and rightly so, IMHO).
-rw-r--r--ftp/curl/Makefile2
-rw-r--r--ftp/curl/files/patch-configure13
-rw-r--r--ftp/curl/files/patch-lib::hostip.c33
3 files changed, 47 insertions, 1 deletions
diff --git a/ftp/curl/Makefile b/ftp/curl/Makefile
index 4787bef3e1e6..34d982a5ab17 100644
--- a/ftp/curl/Makefile
+++ b/ftp/curl/Makefile
@@ -7,7 +7,7 @@
PORTNAME= curl
PORTVERSION= 7.9.7
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= ftp ipv6 www
MASTER_SITES= http://curl.haxx.se/download/ \
http://download.sourceforge.net/curl/ \
diff --git a/ftp/curl/files/patch-configure b/ftp/curl/files/patch-configure
new file mode 100644
index 000000000000..47ebc57b8ef6
--- /dev/null
+++ b/ftp/curl/files/patch-configure
@@ -0,0 +1,13 @@
+--- configure.curl Mon Jun 24 17:23:46 2002
++++ configure Mon Jun 24 17:24:10 2002
+@@ -9868,8 +9868,10 @@
+ EXTRA_SSL= ;;
+ *)
+ EXTRA_SSL=$OPT_SSL
++ if [ ! "$EXTRA_SSL" = "/usr" ]; then
+ LDFLAGS="$LDFLAGS -L$EXTRA_SSL/lib"
+ CPPFLAGS="$CPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
++ fi
+ ;;
+ esac
+
diff --git a/ftp/curl/files/patch-lib::hostip.c b/ftp/curl/files/patch-lib::hostip.c
new file mode 100644
index 000000000000..739718bae9ce
--- /dev/null
+++ b/ftp/curl/files/patch-lib::hostip.c
@@ -0,0 +1,33 @@
+--- lib/hostip.c.orig Mon Jun 24 17:05:50 2002
++++ lib/hostip.c Mon Jun 24 17:05:54 2002
+@@ -360,7 +360,7 @@
+ *
+ * Keith McGuigan
+ * 10/3/2001 */
+-static struct hostent* pack_hostent(char** buf, struct hostent* orig)
++static struct hostent* pack_hostent(char** buf, struct hostent* orig, int pass)
+ {
+ char* bufptr;
+ struct hostent* copy;
+@@ -427,8 +427,9 @@
+ }
+ copy->h_addr_list[i] = NULL;
+
+- *buf=(char *)realloc(*buf, (int)bufptr-(int)(*buf));
+- return copy;
++ if (pass == 0)
++ *buf=(char *)realloc(*buf, (int)bufptr-(int)(*buf));
++ return *buf;
+ }
+ #endif
+
+@@ -623,7 +624,8 @@
+ /* we make a copy of the hostent right now, right here, as the
+ static one we got a pointer to might get removed when we don't
+ want/expect that */
+- h = pack_hostent(&buf, h);
++ pack_hostent(&buf, h, 0);
++ h = pack_hostent(&buf, h, 1);
+ *bufp=(char *)buf;
+ }
+ #endif