Skip to content
Snippets Groups Projects
Commit 41ace72c authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix filebase corruption caused by FileBase.renew()

echicken reported this problem: pretty severe filebase corruption as a result
of calling FileBase.renew(). The problem seemed pretty obvious (only loading
the file's index record), but I do think the underlying SMBLIB functions
should be more resilient to misuse and not corrupt the base. So, that's still
a TODO.

No existing scripts were using FileBase.renew(), so this problem has gone
unnoticed since SBBS v3.19.
parent 98e60c4f
No related branches found
No related tags found
No related merge requests found
Pipeline #5093 passed
......@@ -1355,7 +1355,7 @@ js_renew_file(JSContext *cx, uintN argc, jsval *arglist)
rc=JS_SUSPENDREQUEST(cx);
file_t file;
if((p->smb_result = smb_loadfile(&p->smb, fname, &file, file_detail_index)) == SMB_SUCCESS) {
if((p->smb_result = smb_loadfile(&p->smb, fname, &file, file_detail_metadata)) == SMB_SUCCESS) {
char path[MAX_PATH + 1];
p->smb_result = smb_renewfile(&p->smb, &file, SMB_SELFPACK, getfilepath(scfg, &file, path));
smb_freefilemem(&file);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment