PDP10, PDP11, VAX: Fix buffer overrun in dmc_attach

This commit is contained in:
Mark Pizzolato 2016-01-05 15:37:06 -08:00
parent 6501503897
commit b4e604aae4

View file

@ -3823,7 +3823,7 @@ sprintf (attach_string, "Line=%d,Connect=%s,%s", dmc, peer, cptr);
ans = tmxr_open_master (mp, attach_string); /* open master socket */
if (ans != SCPE_OK)
return ans;
strncpy (port, cptr, CBUFSIZE-1);
strncpy (port, cptr, sizeof(dmc_port[0]));
uptr->filename = (char *)malloc (strlen(port)+1);
strcpy (uptr->filename, port);
uptr->flags |= UNIT_ATT;