tomaspinho / rtl8821ce

Other
1.6k stars 408 forks source link

Fix strlen buffer overrun #334

Closed a1akris closed 1 year ago

a1akris commented 1 year ago

Basically the syntax to declare a flexible array member like this char* regd_name[0] has become so obsolete that it's treated as a zero sized string regardless of its contents, therefore __fortify_stlren was crashing while trying to read the first byte.

This also reverts #332 as it's not needed anymore.

Desour commented 1 year ago

Tested. Works, this fixes the crash at shutdown with the blinking caps lock.

The linux kernel uses gnu C11 since 5.18 (see https://www.kernel.org/doc/html/v5.18/process/programming-language.html) (gnu C90 before). ISO C99 flexible array members should be available at least since then. So you could lower the kernel version in the #ifs.

Spixmaster commented 1 year ago

@tomaspinho Since we have two external tests by @Desour and @dexter2000 which prove the functionality, could you merge this pull request?

leandrocunha526 commented 1 year ago

Issue #335 it was resolved with this.

tomaspinho commented 1 year ago

Thanks for fixing the root cause!