VOGONS

Common searches


First post, by ntfshard

User metadata
Rank Newbie
Rank
Newbie

Hello

I found some flaws in the source code; So I made this patch. Could you please review it 😊

Fixes:
you can free/delete/delete[] NULL
strstr returns ptr; checking retval against > 0
some logging for midi oss & alsa
some logging in dos_mscdex.cpp
placed several va_end
new doesn't returns NULL by default (exception will be raised) (driver_fat.cpp, hardware.cpp:483, memory.cpp:562, zmbv_vfw.cpp:255,369)
fields initialization should be same with class definition
removed some useless ',' and ';'
tab/spaces in code align corrected

shell_cmds.cpp:109 strcat with NULL => segfaul
cpu.cpp:592 ternary operator has a lower priority that +
class DEBUG (debug.cpp:2077) strncat can overrun buffer args
debug_disasm.cpp:581 some corner case fixed
cdrom_image.cpp:133 struct as a field of struct initialization
dos_files.cpp:81 we should check length before read
dos_files.cpp:917 using bit AND with logic values can be UB
dos_keyboard_layout.cpp:899 unused variable removed && removed call of 'host_readw'
dos_programs.cpp:78(and some other places) static cast from int to char (warning suppress)
midi.cpp:180 we should call std::erase for std::remove
decoder.h:408 dobule break

'default' case for multiply switches => log msg
various files/memory leaks fixed
________________________________

Sorry for the patch size;
Opensuse; cppcheck; clang-analyzer; g++ with pedantic/style warnings;

Maksim D.
PS The "Patches" forum branch is closed for new posts

Attachments

  • Filename
    dosbox_ntfshard.patch
    File size
    70.55 KiB
    Downloads
    106 downloads
    File comment
    patch
    File license
    Fair use/fair dealing exception

Reply 1 of 2, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Moved to the patches forum. It's closed to new threads to prevent this forum being turned in a help/patch request forum 😉
Posting in threads is allowed though.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 2 of 2, by ntfshard

User metadata
Rank Newbie
Rank
Newbie

Hello

I cut the patch to a primary and a secondary parts. In the primary I fixed more significant issues.

Could you please review and merge at least 1st part of the patch.

--

Attachments