From: <fr...@us...> - 2014-12-29 13:04:20
|
Revision: 5104 http://sourceforge.net/p/fuse-emulator/code/5104 Author: fredm Date: 2014-12-29 13:04:11 +0000 (Mon, 29 Dec 2014) Log Message: ----------- Guard against passing a NULL pointer to memcpy in write_if1_chunk() (thanks, clang static analyser). Modified Paths: -------------- trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/szx.c Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2014-12-29 12:40:38 UTC (rev 5103) +++ trunk/libspectrum/hacking/ChangeLog 2014-12-29 13:04:11 UTC (rev 5104) @@ -962,3 +962,5 @@ 20140504 tape.c: ensure that we have an edge at the end of a tape to ensure that the last pulse is terminated - fixes loading of Moon Cresta (thanks, Lee Tonks) (Fred). +20141230 szx.c: guard against passing a NULL pointer to memcpy in + write_if1_chunk() (thanks, clang static analyser) (Fred). Modified: trunk/libspectrum/szx.c =================================================================== --- trunk/libspectrum/szx.c 2014-12-29 12:40:38 UTC (rev 5103) +++ trunk/libspectrum/szx.c 2014-12-29 13:04:11 UTC (rev 5104) @@ -3284,6 +3284,15 @@ return LIBSPECTRUM_ERROR_LOGIC; } rom_data = libspectrum_snap_interface1_rom( snap, 0 ); + if( rom_data == NULL ) { + libspectrum_print_error( LIBSPECTRUM_ERROR_LOGIC, + "Interface 1 custom ROM specified to be %lu " + "bytes but NULL pointer provided", + (unsigned long) + libspectrum_snap_interface1_rom_length( + snap, 0 ) ); + return LIBSPECTRUM_ERROR_LOGIC; + } uncompressed_rom_length = disk_rom_length = libspectrum_snap_interface1_rom_length( snap, 0 ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |