(MESS) avoid usage of uninitialized memory in nc.c (MT05130) [Oliver Stöneberg]

This commit is contained in:
Oliver Stöneberg 2013-01-28 01:28:45 +00:00
parent 0f2c9098ba
commit 06bed52397

View File

@ -429,7 +429,8 @@ static void nc_common_restore_memory_from_stream(running_machine &machine)
LOG(("restoring nc memory\n"));
/* get size of memory data stored */
state->m_file->read(&stored_size, sizeof(unsigned long));
if (state->m_file->read(&stored_size, sizeof(unsigned long)) != sizeof(unsigned long))
stored_size = 0;
if (stored_size > machine.device<ram_device>(RAM_TAG)->size())
restore_size = machine.device<ram_device>(RAM_TAG)->size();