> >    strncat(name, d->d_name, strlen(d->d_name));
> 
> The solution is to add the terminating null after line 355:
> 
>     name[strlen(curr_dir->dirname) + strlen(d->d_name)] = '\0';
> 
> Or to move the memset from line 331 down into the loop.

Or just:

 strncat(name, d->d_name, strlen(d->d_name)+1);

in the first place.  It isn't the access to the final null that is the
problem, after all, it that strcat has some bug that causes it to access
memory _beyond_ the terminating null.

-Tom

Reply via email to