ufairiya / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

crash in send_directory on vs2008 #129

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
1. listing the c:\ directory

What is the expected output? What do you see instead?
a directory listing, it crashes

What version of the product are you using? On what operating system?

mongoose 2.8, windows 7, vs2008

Please provide any additional information below.

Calling mg_stat on a system file which is locked by the OS, causes struct 
mgstat *stp not be filled in.

when print_dir_entry is called with this struct it causes this line
(void) strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M",
        localtime(&de->st.mtime)); 
to throw as st.mtime can be negative, which crashes the server

solution, always fill in the mgstat struct even if GetFileAttributesExW 
fails 

Original issue reported on code.google.com by Steve.M....@googlemail.com on 14 Mar 2010 at 12:38

GoogleCodeExporter commented 9 years ago

Original comment by valenok on 7 Sep 2010 at 8:50