mirror of
https://github.com/antirez/linenoise.git
synced 2025-11-16 12:34:48 +00:00
Fix CVE-2025-9810
This commit is contained in:
committed by
GitHub
parent
d895173d67
commit
f2558e1e58
@@ -1318,7 +1318,7 @@ int linenoiseHistorySave(const char *filename) {
|
||||
fp = fopen(filename,"w");
|
||||
umask(old_umask);
|
||||
if (fp == NULL) return -1;
|
||||
chmod(filename,S_IRUSR|S_IWUSR);
|
||||
fchmod(fileno(fp),S_IRUSR|S_IWUSR);
|
||||
for (j = 0; j < history_len; j++)
|
||||
fprintf(fp,"%s\n",history[j]);
|
||||
fclose(fp);
|
||||
|
||||
Reference in New Issue
Block a user