[OpenWrt-Devel] [PATCH] ar71xx: Fix build for dap-1330-a1 board

Hauke Mehrtens hauke at hauke-m.de
Mon May 21 09:22:00 EDT 2018

Using a version number of 16 character causes a buffer overflow in the
version number overwriting the first bit of the signature in the
mkdapimg2 tool.
I am not sure if the version number should be null terminated or not.
This patch reduces the size of the version number by removing the number
of private commits from it.

This was the original version number which caused problems:
Now it uses this version number:

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
 target/linux/ar71xx/image/generic.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index a0f6326145..020e01f85a 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -36,7 +36,7 @@ define Build/mkdapimg2
 	$(STAGING_DIR_HOST)/bin/mkdapimg2 \
 		-i $@ -o $@.new \
 		-s $(DAP_SIGNATURE) \
-		-v $(VERSION_DIST)-$(firstword $(subst -, ,$(REVISION))) \
+		-v $(VERSION_DIST)-$(firstword $(subst +, ,$(firstword $(subst -, ,$(REVISION))))) \
 		-r Default \
 		$(if $(1),-k $(1))
 	mv $@.new $@

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list