lua-5.4.7-1.fc42

List of Findings

Error: CPPCHECK_WARNING (CWE-758): [#def1]
lua-5.4.7-build/lua-5.4.7/src/ldump.c:55: warning[objectIndex]: The address of variable 'x' might be accessed at non-zero index.
#   53|   static void dumpByte (DumpState *D, int y) {
#   54|     lu_byte x = (lu_byte)y;
#   55|->   dumpVar(D, x);
#   56|   }
#   57|   

Error: CPPCHECK_WARNING (CWE-758): [#def2]
lua-5.4.7-build/lua-5.4.7/src/ldump.c:83: warning[objectIndex]: The address of variable 'x' might be accessed at non-zero index.
#   81|   
#   82|   static void dumpNumber (DumpState *D, lua_Number x) {
#   83|->   dumpVar(D, x);
#   84|   }
#   85|   

Error: CPPCHECK_WARNING (CWE-758): [#def3]
lua-5.4.7-build/lua-5.4.7/src/ldump.c:88: warning[objectIndex]: The address of variable 'x' might be accessed at non-zero index.
#   86|   
#   87|   static void dumpInteger (DumpState *D, lua_Integer x) {
#   88|->   dumpVar(D, x);
#   89|   }
#   90|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
lua-5.4.7-build/lua-5.4.7/src/lgc.c:150:10: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
lua-5.4.7-build/lua-5.4.7/src/lgc.c: scope_hint: In function 'genlink'
lua-5.4.7-build/lua-5.4.7/src/lgc.c:433:5: note: in expansion of macro 'linkobjgclist'
lua-5.4.7-build/lua-5.4.7/src/lgc.c:433:5: note: in expansion of macro 'linkobjgclist'
lua-5.4.7-build/lua-5.4.7/src/lgc.c:433:5: note: in expansion of macro 'linkobjgclist'
lua-5.4.7-build/lua-5.4.7/src/lgc.c:433:5: note: in expansion of macro 'linkobjgclist'
#  148|   static void linkgclist_ (GCObject *o, GCObject **pnext, GCObject **list) {
#  149|     lua_assert(!isgray(o));  /* cannot be in a gray list */
#  150|->   *pnext = *list;
#  151|     *list = o;
#  152|     set2gray(o);  /* now it is */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def5]
lua-5.4.7-build/lua-5.4.7/src/lgc.c: scope_hint: In function 'propagatemark'
lua-5.4.7-build/lua-5.4.7/src/lgc.c:663:13: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  661|     GCObject *o = g->gray;
#  662|     nw2black(o);
#  663|->   g->gray = *getgclist(o);  /* remove from 'gray' list */
#  664|     switch (o->tt) {
#  665|       case LUA_VTABLE: return traversetable(g, gco2t(o));

Error: CPPCHECK_WARNING (CWE-457): [#def6]
lua-5.4.7-build/lua-5.4.7/src/lgc.c:1082: error[uninitvar]: Uninitialized variable: *p
# 1080|     GCObject *curr;
# 1081|     global_State *g = G(L);
# 1082|->   while ((curr = *p) != NULL) {
# 1083|       if (iswhite(curr)) {  /* is 'curr' dead? */
# 1084|         lua_assert(isdead(g, curr));

Error: CPPCHECK_WARNING (CWE-457): [#def7]
lua-5.4.7-build/lua-5.4.7/src/lgc.c:1128: error[uninitvar]: Uninitialized variable: *p
# 1126|     int white = luaC_white(g);
# 1127|     GCObject *curr;
# 1128|->   while ((curr = *p) != limit) {
# 1129|       if (iswhite(curr)) {  /* is 'curr' dead? */
# 1130|         lua_assert(!isold(curr) && isdead(g, curr));

Error: CPPCHECK_WARNING (CWE-758): [#def8]
lua-5.4.7-build/lua-5.4.7/src/lundump.c:95: warning[objectIndex]: The address of variable 'x' might be accessed at non-zero index.
#   93|   static lua_Number loadNumber (LoadState *S) {
#   94|     lua_Number x;
#   95|->   loadVar(S, x);
#   96|     return x;
#   97|   }

Error: CPPCHECK_WARNING (CWE-758): [#def9]
lua-5.4.7-build/lua-5.4.7/src/lundump.c:102: warning[objectIndex]: The address of variable 'x' might be accessed at non-zero index.
#  100|   static lua_Integer loadInteger (LoadState *S) {
#  101|     lua_Integer x;
#  102|->   loadVar(S, x);
#  103|     return x;
#  104|   }

Error: GCC_ANALYZER_WARNING (CWE-126): [#def10]
lua-5.4.7-build/lua-5.4.7/src/lundump.c: scope_hint: In function 'checkliteral'
lua-5.4.7-build/lua-5.4.7/src/lundump.c:277:16: warning[-Wanalyzer-out-of-bounds]: buffer over-read
lua-5.4.7-build/lua-5.4.7/src/lundump.c:277:16: note: read of 1 byte from after the end of '"\033Lua"'
lua-5.4.7-build/lua-5.4.7/src/lundump.c:277:16: note: valid subscripts for '"\033Lua"' are '[0]' to '[4]'
lua-5.4.7-build/lua-5.4.7/src/lundump.c:14: included_from: Included from here.
/usr/include/string.h:407:15: note: argument 1 of 'strlen' must be a pointer to a null-terminated string
#  275|   static void checkliteral (LoadState *S, const char *s, const char *msg) {
#  276|     char buff[sizeof(LUA_SIGNATURE) + sizeof(LUAC_DATA)]; /* larger than both */
#  277|->   size_t len = strlen(s);
#  278|     loadVector(S, buff, len);
#  279|     if (memcmp(s, buff, len) != 0)

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-205.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namelua-5.4.7-1.fc42
store-results-to/tmp/tmpcqrzfut7/lua-5.4.7-1.fc42.tar.xz
time-created2024-11-13 01:54:28
time-finished2024-11-13 01:56:13
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpcqrzfut7/lua-5.4.7-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpcqrzfut7/lua-5.4.7-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9