mirror of
https://github.com/simh/simh.git
synced 2026-02-06 08:25:53 +00:00
VAX: fix CID: 1415411, 1415414-1415417, 1415535 "Buffer not null terminated"
Pass buffer size minus one to strncpy()
This commit is contained in:
committed by
Mark Pizzolato
parent
2e2df8fc2d
commit
b40e63de4e
@@ -371,7 +371,7 @@ if (r != SCPE_OK) { /* error? */
|
|||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
strncpy (cpu_boot_cmd, ptr, CBUFSIZE); /* save for reboot */
|
strncpy (cpu_boot_cmd, ptr, CBUFSIZE-1); /* save for reboot */
|
||||||
return run_cmd (flag, "CPU");
|
return run_cmd (flag, "CPU");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -478,7 +478,7 @@ if (r != SCPE_OK) { /* error? */
|
|||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
strncpy (cpu_boot_cmd, ptr, CBUFSIZE); /* save for reboot */
|
strncpy (cpu_boot_cmd, ptr, CBUFSIZE-1); /* save for reboot */
|
||||||
return run_cmd (flag, "CPU");
|
return run_cmd (flag, "CPU");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -617,7 +617,7 @@ if (r != SCPE_OK) { /* error? */
|
|||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
strncpy (cpu_boot_cmd, ptr, CBUFSIZE); /* save for reboot */
|
strncpy (cpu_boot_cmd, ptr, CBUFSIZE-1); /* save for reboot */
|
||||||
return run_cmd (flag, "CPU");
|
return run_cmd (flag, "CPU");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -630,7 +630,7 @@ if (r != SCPE_OK) { /* error? */
|
|||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
strncpy (cpu_boot_cmd, ptr, CBUFSIZE); /* save for reboot */
|
strncpy (cpu_boot_cmd, ptr, CBUFSIZE-1); /* save for reboot */
|
||||||
return run_cmd (flag, "CPU");
|
return run_cmd (flag, "CPU");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -693,7 +693,7 @@ if (r != SCPE_OK) { /* error? */
|
|||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
strncpy (cpu_boot_cmd, ptr, CBUFSIZE); /* save for reboot */
|
strncpy (cpu_boot_cmd, ptr, CBUFSIZE-1); /* save for reboot */
|
||||||
return run_cmd (flag, "CPU");
|
return run_cmd (flag, "CPU");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user