Patch with various fixes

Here you can discuss the development of patches.

Patch with various fixes

Postby ntfshard » 2016-5-23 @ 00:12

Hello

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

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
You do not have the required permissions to view the files attached to this post.
ntfshard
Newbie
 
Posts: 2
Joined: 2015-11-13 @ 11:05

Re: Patch with various fixes

Postby Dominus » 2016-5-23 @ 01:34

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.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7561
Joined: 2002-10-03 @ 09:54
Location: Vienna or Ludwigsburg

Re: Patch with various fixes

Postby ntfshard » 2016-8-14 @ 17:14

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.

--
You do not have the required permissions to view the files attached to this post.
ntfshard
Newbie
 
Posts: 2
Joined: 2015-11-13 @ 11:05


Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 1 guest