rkd77 / elinks

Fork of elinks
Other
349 stars 38 forks source link

[ win64 ] crash with secure save #162

Closed mtatton closed 2 years ago

mtatton commented 2 years ago

Hello rkd77,

I'm unsure about the cause and solution for this. But the problem is as follows. When elinks on win64 has set: infofiles.secure_save = 1 and that's the default. Then elinks crashes with following: ?2004h00000000018988c8:42 overflow detected free() @ secsave.c:296, alloc'd at string.c:160 on every bookmarks, setting etc. save try. The problematic function is in the file: ./src/util/secsave.c and it's: mem_free_if(ssi->tmp_file_name); The tmp_file_name is set to: tmp_file_name = randname; in the secure_open_umask(char *file_name) function.

My first guess there could be problem with the backslashes in the name and dir of the file on win64 because it contains '\' and that could be considered as escape character in C and probably the string is allocated shorted on it's declaration.

I'll explore some more. Any idea would be apprecitated.

Thank You & have a nice day

mtatton commented 2 years ago

Can't reproduce on win64 on commit 7993135. Closing this.