Skip to content
  • Rob Swindell's avatar
    Fix uninitialized cfg.colors[] element usage caught by Deuce (and Clang?) · 0e5f80aa
    Rob Swindell authored
    Conditional jump or move depends on uninitialised value(s)
       at 0x4AE768D: sbbs_t::backfill(char const*, float, int, int) (con_out.cpp:1445)
       by 0x4AE7855: sbbs_t::progress(char const*, int, int, int) (con_out.cpp:1467)
       by 0x4AE91A9: ProgressLoadingMsgPtrs(void*, int, int) (data_ovl.cpp:27)
       by 0x4C7C577: getmsgptrs (userdat.c:3972)
       by 0x4AE9144: sbbs_t::getmsgptrs() (data_ovl.cpp:39)
       by 0x4BF9237: sbbs_t::logon() (logon.cpp:452)
       by 0x4AC1CE2: sbbs_t::answer() (answer.cpp:636)
       by 0x4C0FD37: node_thread(void*) (main.cpp:4277)
    
    Introduced in commit 48e7520e (when colors was converted from a byte array
    to a uint array), we weren't memsetting the right number of bytes.
    
    Since color is not an array of ints (not bytes), memset (of non-zero values)
    isn't really the right initialization approach anyway. Now using a for-loop.
    0e5f80aa