busybox
The integer variable k_crcs is undeclared when BusyBox is compiled with !FEATURE_INSMOD_VERSION_CHECKING
Bug fixed by commit 5275b1e49f6
Type | UndeclaredIdentifier |
Config | !FEATURE_INSMOD_VERSION_CHECKING (1st degree) |
Fix-in | code |
Location | modutils/ |
#include <stdio.h> #include <stdlib.h> int main(int argc, char** argv) { int r = rand() % 2; int m_has_modinfo; int exit_status = -1; int someInt = 1; #ifdef CONFIG_FEATURE_INSMOD_VERSION_CHECKING int k_crcs; #endif if (r) m_has_modinfo = 0; else m_has_modinfo = 1; #ifdef CONFIG_FEATURE_INSMOD_VERSION_CHECKING k_crcs = 0; #endif if (r) { k_crcs = someInt; } else { printf("Not configured to support old kernels"); goto out; } out: return(exit_status); return 0; }
diff --git a/simple/5275b1e.c b/simple/5275b1e.c --- a/simple/5275b1e.c +++ b/simple/5275b1e.c @@ -8,9 +8,7 @@ int exit_status = -1; int someInt = 1; -#ifdef CONFIG_FEATURE_INSMOD_VERSION_CHECKING int k_crcs; -#endif if (r) m_has_modinfo = 0;
#include <stdio.h> #include <stdlib.h> int main(int argc, char** argv) { int r = rand() % 2; int m_has_modinfo; int exit_status = -1; int someInt = 1; #ifdef CONFIG_FEATURE_INSMOD_VERSION_CHECKING int k_crcs; #endif if (r) m_has_modinfo = 0; else m_has_modinfo = 1; #ifdef CONFIG_FEATURE_INSMOD_VERSION_CHECKING k_crcs = 0; #endif if (r) { k_crcs = someInt; } else { printf("Not configured to support old kernels"); goto out; } out: return(exit_status); return 0; }
. call modutils/insmod.c:3606:insmod_main(); . [FEATURE_INSMOD_VERSION_CHECKING] 3622:int k_crcs; . ERROR 3833:k_crcs = new_is_kernel_checksummed();