From b06c6b3fcb37a883cc80de2a08705e0ec42cda49 Mon Sep 17 00:00:00 2001 From: PMheart <17109513+PMheart@users.noreply.github.com> Date: Tue, 12 Jul 2022 10:08:49 +0200 Subject: [PATCH] OcAppleKernelLib: Fix kext bundle version copying, thanks @mhaeuser --- Library/OcAppleKernelLib/CachelessContext.c | 2 +- Library/OcAppleKernelLib/MkextContext.c | 2 +- Library/OcAppleKernelLib/PrelinkedContext.c | 2 +- Utilities/TestKextInject/KextInject.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Library/OcAppleKernelLib/CachelessContext.c b/Library/OcAppleKernelLib/CachelessContext.c index 5c8ae027..ebb66a4a 100644 --- a/Library/OcAppleKernelLib/CachelessContext.c +++ b/Library/OcAppleKernelLib/CachelessContext.c @@ -960,7 +960,7 @@ CachelessContextAddKext ( } BundleVerStr = XmlNodeContent (InfoPlistValue); - AsciiStrnCpyS (BundleVersion, MAX_INFO_BUNDLE_VERSION_KEY_SIZE, BundleVerStr, AsciiStrLen (BundleVerStr)); + AsciiStrCpyS (BundleVersion, MAX_INFO_BUNDLE_VERSION_KEY_SIZE, BundleVerStr); } DEBUG_CODE_END (); diff --git a/Library/OcAppleKernelLib/MkextContext.c b/Library/OcAppleKernelLib/MkextContext.c index 01d7c29a..6e65473d 100644 --- a/Library/OcAppleKernelLib/MkextContext.c +++ b/Library/OcAppleKernelLib/MkextContext.c @@ -1285,7 +1285,7 @@ MkextInjectKext ( } BundleVerStr = XmlNodeContent (KextPlistValue); - AsciiStrnCpyS (BundleVersion, MAX_INFO_BUNDLE_VERSION_KEY_SIZE, BundleVerStr, AsciiStrLen (BundleVerStr)); + AsciiStrCpyS (BundleVersion, MAX_INFO_BUNDLE_VERSION_KEY_SIZE, BundleVerStr); break; } } diff --git a/Library/OcAppleKernelLib/PrelinkedContext.c b/Library/OcAppleKernelLib/PrelinkedContext.c index deea1535..2a9b01f2 100644 --- a/Library/OcAppleKernelLib/PrelinkedContext.c +++ b/Library/OcAppleKernelLib/PrelinkedContext.c @@ -1099,7 +1099,7 @@ PrelinkedInjectKext ( } BundleVerStr = XmlNodeContent (KextPlistValue); - AsciiStrnCpyS (BundleVersion, MAX_INFO_BUNDLE_VERSION_KEY_SIZE, BundleVerStr, AsciiStrLen (BundleVerStr)); + AsciiStrCpyS (BundleVersion, MAX_INFO_BUNDLE_VERSION_KEY_SIZE, BundleVerStr); break; } } diff --git a/Utilities/TestKextInject/KextInject.c b/Utilities/TestKextInject/KextInject.c index 615bd173..fd9de530 100644 --- a/Utilities/TestKextInject/KextInject.c +++ b/Utilities/TestKextInject/KextInject.c @@ -724,7 +724,7 @@ WrapMain ( // Assume no bundle version from the beginning. // 'v' will be printed in the message, and hence is omitted here. // - AsciiStrCpyS (BundleVersion, MAX_INFO_BUNDLE_VERSION_KEY_SIZE, "ersion available"); + AsciiStrCpyS (BundleVersion, MAX_INFO_BUNDLE_VERSION_KEY_SIZE, "ersion unavailable"); Status = PrelinkedInjectKext ( &Context, NULL, @@ -786,7 +786,7 @@ WrapMain ( // Assume no bundle version from the beginning. // 'v' will be printed in the message, and hence is omitted here. // - AsciiStrCpyS (BundleVersion, MAX_INFO_BUNDLE_VERSION_KEY_SIZE, "ersion available"); + AsciiStrCpyS (BundleVersion, MAX_INFO_BUNDLE_VERSION_KEY_SIZE, "ersion unavailable"); Status = PrelinkedInjectKext ( &Context, NULL,