e2fsprogs: Fix CVE-2019-5094 in libsupport
[openwrt/openwrt.git] / package / Makefile
index abbf5f91f2e1177bcc5e189558a825bc0922abe5..58c1ba2bbf655c76c214c59c68652665c5b3666f 100644 (file)
@@ -84,8 +84,12 @@ $(curdir)/index: FORCE
                mkdir -p $$d; \
                cd $$d || continue; \
                $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages.manifest; \
-               grep -vE '^(Maintainer|LicenseFiles|Source|SourceName|Require)' Packages.manifest > Packages && \
-                       gzip -9nc Packages > Packages.gz; \
+               grep -vE '^(Maintainer|LicenseFiles|Source|SourceName|Require)' Packages.manifest > Packages; \
+               case "$$(((64 + $$(stat -L -c%s Packages)) % 128))" in 110|111) \
+                       $(call ERROR_MESSAGE,WARNING: Applying padding in $$d/Packages to workaround usign SHA-512 bug!); \
+                       { echo ""; echo ""; } >> Packages;; \
+               esac; \
+               gzip -9nc Packages > Packages.gz; \
        ); done
 ifdef CONFIG_SIGNED_PACKAGES
        @echo Signing package index...