Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
03536 Misc. Minor Have not tried Nov 15, 2009, 14:59 Jul 17, 2010, 19:37
Tester Firewave View Status Public Platform
Assigned To Atari Ace Resolution Fixed OS
Status [?] Resolved Driver
Version 0.135 Fixed in Version 0.138u4 Build
Fixed in Git Commit Github Pull Request #
Summary 03536: PowerPC core: Overlapping data buffers
Description cppcheck reports the following:

[c:\svn\mess\src\emu\cpu\powerpc\ppc_dasm.c:454]: (error) Overlapping data buffer dest
[c:\svn\mess\src\emu\cpu\powerpc\ppc_dasm.c:518]: (error) Overlapping data buffer dest
[c:\svn\mess\src\emu\cpu\powerpc\ppc_dasm.c:1107]: (error) Overlapping data buffer oprs
[c:\svn\mess\src\emu\cpu\powerpc\ppc_dasm.c:1112]: (error) Overlapping data buffer oprs

The code of the first report looks like this:

		default:	sprintf(dest, "%s%d", dest, spr); break;

The destination and source are the same variable, so I guess that's the reason for the warning. It's the same in the other three cases.
Steps To Reproduce
Additional Information
Github Commit
Flags
Regression Version
Affected Sets / Systems PowerPC core
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
1
User avatar
No.05164
Firewave
Senior Tester
Nov 15, 2009, 15:11
FYI: This report just started a small discussion, if cppcheck should actually warn about this case.
It looks suspicious to me as it brings the valgrind warning about memset() with the same or overlapping addresses to mind, which is potentially dangerous and memmove() should be used for.