Open cptnmidnight opened 3 years ago
I have run into the same problem. Something must have changed. This code appears to have come from https://github.com/wahern/dns/blob/master/src/dns.c and has not been touched for 4 years.
Thanks for opening this.
We've made a fix in https://github.com/MinimSecure/unum-sdk/commit/8ad9b8b0fc967f4e5ef83e28bb467511d84c2f7d related to this. Could you please try pulling the latest master and see if the error persists?
edited to add: You will need to modify the unum Makefile line 22 in the minim-openwrt-feed to reference the commit 8ad9b8b0fc967f4e5ef83e28bb467511d84c2f7d
Following up on this. I tried building this myself but it seems that because we've removed support for openwrt_generic, there is no way to produce a properly functioning build using the minim-openwrt-feed.
It seems that going forward, the instructions for lede_generic
should be used which involves cloning our fork of the openwrt sources called violetatrium/lede and creating a specific hardware kind for your device. There's additional info about doing that in the README.txt in the lede project repo.
Sorry about the confusion on this one. I'm going to archive the minim-openwrt-feed project and update the README there with this guidance. Please reach out if you have any questions. Thanks again!
Now getting these errors:
util/dns.c:6523:2: error: array subscript 4294967294 is above array bounds of 'unsigned char[1]' [-Werror=array-bounds]
(so->query->data - 2) = 0xff & (so->query->end >> 8);
^~~~~~
util/dns.c:6524:2: error: array subscript 4294967295 is above array bounds of 'unsigned char[1]' [-Werror=array-bounds]
(so->query->data - 1) = 0xff & (so->query->end >> 0);
^~~~~~
util/dns.c:6563:18: error: array subscript 4294967294 is above array bounds of 'unsigned char[1]' [-Werror=array-bounds]
alen = ((0xff & *(so->answer->data - 2)) << 8)
util/dns.c:6564:45: error: array subscript 4294967295 is above array bounds of 'unsigned char[1]' [-Werror=array-bounds]
| ((0xff & *(so->answer->data - 1)) << 0);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
Bummer, I was hoping just removing subscripts would be enough. Unfortunately it's hard to chase this down without spinning up the environment where this error can be reproduced. You can try to fix it yourself and submit PR or diff for us to pull in. IMO it should be resolvable by making the compiler treat "data" as a plain pointer (maybe just casting the "...->data" to "unsigned char *" before trying to offset it).
System: Linux mint 19.1 Ubuntu bionic make 4.1 gcc 7.5.0 openwrt git master unum git https://github.com/MinimSecure/minim-openwrt-feed.git
Compile stops with:
`util/dns.c: In function 'dns_so_check.part.57': util/dns.c:6528:17: error: array subscript -2 is below array bounds of 'unsigned char[1]' [-Werror=array-bounds] so->query->data[-2] = 0xff & (so->query->end >> 8);