From 055a455d54c759d3067404780f6cc6dbeda10032 Mon Sep 17 00:00:00 2001 From: William Yang Date: Wed, 11 Oct 2023 13:58:55 +0200 Subject: [PATCH] fix: msquic 2.2 memleak patch: https://github.com/microsoft/msquic/commit/73a11d7bdc724432964a2d4bdc4211ed29823380.patch --- get-msquic.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/get-msquic.sh b/get-msquic.sh index 63c38c00..e13a32c3 100755 --- a/get-msquic.sh +++ b/get-msquic.sh @@ -4,6 +4,30 @@ set -euo pipefail VERSION="$1" +patch_dir="patches" + +do_patch() +{ + patch_source="$1" + patch_file="${patch_dir}/$(basename ${patch_source})" + curl -f -L -o "${patch_file}" "$patch_source" + + if [ ! patch -R --dry-run -p1 --silent < "${patch_file}" 2>/dev/null ]; then + patch -p1 < "${patch_file}" + else + echo "Patch ${patch_file} already applied" + fi +} + +patch_2_2_3() +{ + local patch_1="https://github.com/microsoft/msquic/commit/73a11d7bdc724432964a2d4bdc4211ed29823380.patch" + mkdir -p "$patch_dir" + echo "Patching Msquic 2.2.3" + do_patch "$patch_1" +} + + if [ ! -d msquic ]; then git clone https://github.com/microsoft/msquic.git -b "$VERSION" --recursive --depth 1 --shallow-submodules msquic fi @@ -20,3 +44,9 @@ if [ "$CURRENT_VSN" != "$VERSION" ]; then echo "undesired_msquic_version, required=$VERSION, got=$CURRENT_VSN" exit 1 fi + +## Patching +case $VERSION in + v2.2.3) + patch_2_2_3 +esac