OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
  • Task Type Build Failure
  • Category Packages
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by MartB - 19.09.2020

FS#3346 - Ubox invalid memory access (does not build with gcc10)



In function 'main_insmod',
    inlined from 'main' at /home/openwrt/openwrt-lam/build/archer-c7-v2eu/build_dir/target-mips_24kc_musl/ubox-2019-12-31-0e34af14/kmodloader.c:1062:10:
/home/openwrt/openwrt-lam/build/archer-c7-v2eu/build_dir/target-mips_24kc_musl/ubox-2019-12-31-0e34af14/kmodloader.c:734:13: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
  734 |  options[0] = 0;
      |  ~~~~~~~~~~~^~~
/home/openwrt/openwrt-lam/build/archer-c7-v2eu/build_dir/target-mips_24kc_musl/ubox-2019-12-31-0e34af14/kmodloader.c: In function 'main':
/home/openwrt/openwrt-lam/build/archer-c7-v2eu/build_dir/target-mips_24kc_musl/ubox-2019-12-31-0e34af14/kmodloader.c:727:12: note: at offset 0 to an object with size 0 allocated by 'malloc' here
  727 |  options = malloc(len);
      |            ^~~~~~~~~~~

Fix im using for my builds is attached.

Kind regards

MartB commented on 19.09.2020 00:16

Just to clarify a bit more, malloc(0) is actually implementation dependent, so it should better be avoided.


Available keyboard shortcuts


Task Details

Task Editing