coova / coova-chilli

CoovaChilli is an open-source software access controller for captive portal hotspots.
Other
514 stars 257 forks source link

Fix macro expansion bug #485

Closed nathanel23 closed 5 years ago

nathanel23 commented 5 years ago

The macro redir_memcopy expands to multiple statements. However, one of if-blocks where it is used lacks braces for the code block. This results in parts of the macro being executed even if not intended and triggers a compiler warning on modern GCC versions.

neheb commented 4 years ago

An alternative fix is here: https://github.com/openwrt/packages/blob/master/net/coova-chilli/patches/500-redir.patch

Discussion: https://github.com/openwrt/packages/pull/9336#discussion_r298287514

I am not sure which is better.