mirror of
https://github.com/tbamud/tbamud.git
synced 2026-04-30 04:41:51 +02:00
Fix fscanf width specifiers in copyover_recover() to prevent buffer overflow
Agent-Logs-Url: https://github.com/tbamud/tbamud/sessions/82069e78-2bd9-4ff9-9053-0d47dfae5193 Co-authored-by: welcor <357770+welcor@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
2eb786ff0d
commit
5d0f3ecfbb
@@ -415,7 +415,7 @@ void copyover_recover()
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
fOld = TRUE;
|
fOld = TRUE;
|
||||||
if (fscanf(fp, "%d %ld %s %s %s\n", &desc, &pref, name, host, guiopt) != 5) {
|
if (fscanf(fp, "%d %ld %511s %1023s %1023s\n", &desc, &pref, name, host, guiopt) != 5) {
|
||||||
if(!feof(fp)) {
|
if(!feof(fp)) {
|
||||||
if(ferror(fp))
|
if(ferror(fp))
|
||||||
log("SYSERR: error reading copyover file %s: %s", COPYOVER_FILE, strerror(errno));
|
log("SYSERR: error reading copyover file %s: %s", COPYOVER_FILE, strerror(errno));
|
||||||
|
|||||||
Reference in New Issue
Block a user