Fixed upload crash when a FILE_ID.DIZ is found but the bbs is not allowed to open for reading

This commit is contained in:
Michiel Broek 2007-06-04 18:37:22 +00:00
parent cb0f313df0
commit b7cffd6710
2 changed files with 8 additions and 3 deletions

View File

@ -6,6 +6,10 @@ v0.91.9 16-May-2007
general: general:
Fixed building on FreeBSD, tested on 5.3 Fixed building on FreeBSD, tested on 5.3
mbsebbs:
Fixed upload crash when a FILE_ID.DIZ is found but the bbs is
not allowed to open for reading.
mbpasswd: mbpasswd:
Added check for FreeBSD > 6.0 and use sysctl for security check. Added check for FreeBSD > 6.0 and use sysctl for security check.

View File

@ -930,8 +930,7 @@ int Addfile(char *File, int AreaNum, int fileid)
lines = 0; lines = 0;
if ((id = fopen(idname, "r")) != NULL) { if ((id = fopen(idname, "r")) != NULL) {
/* /*
* Import FILE_ID.DIZ, format to max. 25 * Import FILE_ID.DIZ, format to max. 25 * lines, 48 chars width.
* lines, 48 chars width.
*/ */
while (((fgets(temp1, PATH_MAX -1, id)) != NULL) && (lines < 25)) { while (((fgets(temp1, PATH_MAX -1, id)) != NULL) && (lines < 25)) {
Striplf(temp1); Striplf(temp1);
@ -966,8 +965,10 @@ int Addfile(char *File, int AreaNum, int fileid)
lines++; lines++;
} }
} }
fclose(id);
} else {
GotId = FALSE;
} }
fclose(id);
unlink(idname); unlink(idname);
if (GotId) { if (GotId) {