Index: server/buildpkgs/tls/build.sh ================================================================== --- server/buildpkgs/tls/build.sh +++ server/buildpkgs/tls/build.sh @@ -15,13 +15,14 @@ VERS=1.6 SRC="src/tls${VERS}-src.tar.gz" SRCURL="http://sourceforge.net/projects/tls/files/tls/${VERS}/tls${VERS}-src.tar.gz/download" BUILDDIR="tls${VERS}" WORKDIR="${TMPDIR:-/tmp}/tls-$$${RANDOM}${RANDOM}${RANDOM}" +PATCHDIR="$(pwd)/patches" PLATDIR="$(pwd)/out/${PLATFORM}" -export VERS SRC SRCURL BUILDDIR WORKDIR PLATDIR +export VERS SRC SRCURL BUILDDIR WORKDIR PATCHDIR PLATDIR if [ ! -f "${SRC}" ]; then mkdir src >/dev/null 2>/dev/null wget -O "${SRC}" "${SRCURL}" || exit 1 @@ -32,10 +33,19 @@ mkdir build cd build/ || exit 1 gzip -dc "../${SRC}" | tar -xf - cd "${BUILDDIR}" || exit 1 + + # Apply patches + for patchfile in "${PATCHDIR}"/all/*.diff "${PATCHDIR}/${VERS}"/*.diff; do + if [ ! -f "${patchfile}" ]; then + continue + fi + + patch -p1 < "${patchfile}" + done for chkssldir in $(pkg-config openssl --cflags | sed 's@ *-I *@|@g' | tr '|' "\n" | grep '^/'); do if [ -f "${chkssldir}/openssl/opensslv.h" -o -f "${chkssldir}/opensslv.h" ]; then SSLDIR=$(echo "${chkssldir}" | sed 's@/[^/]*/*$@@') fi ADDED server/buildpkgs/tls/patches/1.6/tls-1.6-fixmemleak-bugid3041925.diff Index: server/buildpkgs/tls/patches/1.6/tls-1.6-fixmemleak-bugid3041925.diff ================================================================== --- /dev/null +++ server/buildpkgs/tls/patches/1.6/tls-1.6-fixmemleak-bugid3041925.diff @@ -0,0 +1,12 @@ +diff -uNr tls1.6.orig/tls.c tls1.6-fixmemleak-bugid3041925/tls.c +--- tls1.6.orig/tls.c 2008-03-19 17:06:13.000000000 -0500 ++++ tls1.6-fixmemleak-bugid3041925/tls.c 2010-10-08 13:03:39.000000000 -0500 +@@ -1156,6 +1156,8 @@ + peer = SSL_get_certificate(statePtr->ssl); + if (peer) { + objPtr = Tls_NewX509Obj(interp, peer); ++ ++ if (objc == 2) X509_free(peer); + } else { + objPtr = Tcl_NewListObj(0, NULL); + }