Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

You work very hard. Don't try to think as well.


dovenet / Synchronet Programming / src/sbbs3/load_cfg.c

SubjectAuthor
o src/sbbs3/load_cfg.cRob Swindell (on Windows 11)

1
src/sbbs3/load_cfg.c

<65B01EE1.48489.syncprog@vert.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=2508&group=DOVE-Net.Synchronet_Programming#2508

  copy link   Newsgroups: DOVE-Net.Synchronet_Programming
From: rob.swindell.(on.windows.11)@VERT (Rob Swindell (on Windows 11))
To: Git commit to main/sbbs/master
Subject: src/sbbs3/load_cfg.c
Message-ID: <65B01EE1.48489.syncprog@vert.synchro.net>
Date: Tue, 23 Jan 2024 12:17:37 -0800
X-Comment-To: Git commit to main/sbbs/master
Path: rocksolidbbs.com!not-for-mail
Organization: Vertrauen
Newsgroups: DOVE-Net.Synchronet_Programming
X-FTN-PID: Synchronet 3.20a-Linux master/b8d0ef979 Jan 21 2024 GCC 12.2.0
X-FTN-MSGID: 48489.syncprog@1:103/705 2a16124a
X-FTN-CHRS: CP437 2
WhenImported: 20240123121737-0800 41e0
WhenExported: 20240123201333-0800 41e0
ExportedFrom: VERT syncprog 48489
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Rob Swindell (on Win - Tue, 23 Jan 2024 20:17 UTC

https://gitlab.synchro.net/main/sbbs/-/commit/0503c2900a17ddd91986b312
Modified Files:
src/sbbs3/load_cfg.c
Log Message:
Fix uninitialized cfg.colors[] element usage caught by Deuce (and Clang?)

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.

---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor