Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
openwrt-bot opened this issue Sep 19, 2020 · 1 comment
Open
Labels
core packages pull request/issue for core (in-tree) packages flyspray

Comments

@openwrt-bot
Copy link

MartB:

See: https://git.openwrt.org/?p=project/ubox.git;a=blob;f=kmodloader.c;h=6f06ee3939f2f3e151357d33cfd165603cb40e4d;hb=HEAD#l699

Prints:
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

@openwrt-bot
Copy link
Author

MartB:

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

@aparcar aparcar added the core packages pull request/issue for core (in-tree) packages label Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core packages pull request/issue for core (in-tree) packages flyspray
Projects
None yet
Development

No branches or pull requests

2 participants