aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKoen Vandeputte <koen.vandeputte@ncentric.com>2018-11-06 15:10:17 +0100
committerKoen Vandeputte <koen.vandeputte@ncentric.com>2018-11-06 15:29:51 +0100
commitc5bf408ed6bddfcfbafaf8e69d26104d80a244e9 (patch)
treeae2083b136c297bcffed7886d46210d4dab65c01 /tools
parent74738c4b8057cbc155c3c67a1b372b1eec2e7ecc (diff)
downloadupstream-c5bf408ed6bddfcfbafaf8e69d26104d80a244e9.tar.gz
upstream-c5bf408ed6bddfcfbafaf8e69d26104d80a244e9.tar.bz2
upstream-c5bf408ed6bddfcfbafaf8e69d26104d80a244e9.zip
ramips: fix image generation for mt76x8
Buildbot fails to generate images for targets also generating a Sercomm binary with following error: Opening file: /mnt/ramdisk/koen/firmware/builds/owrt_mt76x8/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/tmp/openwrt-ramips-mt76x8-netgear_r6120-squashfs-factory.img.rootfs.zip Filesize: 3648606 . mksercommfw: malloc.c:2427: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed. Makefile:287: recipe for target '/mnt/ramdisk/koen/firmware/builds/owrt_mt76x8/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/tmp/openwrt-ramips-mt76x8-netgear_r6120-squashfs-factory.img' failed Debugging using valgrind shows stack corruption due to a buffer overflow. The author of the generator assumes the filename ends with "root", while it should be "rootfs". Fix this by accounting for the 2 missing characters which solves the build issues. More work is required to cleanup this source, which will be done later on. Reported-by: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/firmware-utils/src/mksercommfw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/firmware-utils/src/mksercommfw.c b/tools/firmware-utils/src/mksercommfw.c
index 7f31d4f4c7..ccd5d67a87 100644
--- a/tools/firmware-utils/src/mksercommfw.c
+++ b/tools/firmware-utils/src/mksercommfw.c
@@ -208,7 +208,7 @@ int main(int argc, char *argv[])
#endif
/* now that we got the rootfs, repeat the whole thing again(sorta):
* 1. zip the rootfs */
- char *zipper = malloc(5 + 2*strlen(rootfs.file_name) + 4);
+ char *zipper = malloc(5 + 2*strlen(rootfs.file_name) + 6);
sprintf(zipper, "%s %s %s", "zip ", zipfsname, rootfs.file_name);
int ret = system(zipper);