stack memory read


with following square code:



typedef struct
{
bake filename[ 1024];
time_t deletetime;
} file_item_t;

....
....

setentry(char *filename)
{
file_item_t file;

memset( &file, 0x00, sizeof( file_item_t ));

memcpy( file.filename,
filename,
sizeof( file.filename ) - 1 );
...
...


when duty called, runs ok sparc accessory nonetheless segfaults an i386 both controlling solaris 10.
filename nul-terminated twine 30 chars let's say.
it appears an try review over operation filename controlling memcpy() triggers segmentation error systems.



it's leave formula simply correctable. nonetheless i know underlying characteristics outcome unwell not.
is associated review defilement stack? range crossing?
it associated memory segmentation only box luck (depending memory segmentation/paging finished memory supervision os.) destroy not.



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?