wainstead / waverous

Waverous LambdaMOO is a C++ port of the original LambdaMOO server
4 stars 0 forks source link

Patch bugs in File I/O #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Todd Sundsted found and patched some bugs in release 1.5p1 of File I/O. These 
need to be applied to the project.

https://gist.github.com/1126787

He lists the problems:

 I just found and corrected four
problems in the version I use (1.5p1), one of which results in a
server crash.

1) Mismatched mymalloc/free, exacerbated by the fact that M_STRING is
used in mymalloc which results in an attempt to free at a memory
location inside the block that was allocated.  This crashes my
server.  I'm surprised it hasn't been a problem for anyone else -- my
guess is everyone uses FUP or no one uses file_readlines().
2) Removed the silly restriction that the final line in text mode must
be terminated with a newline.
3) Reset errno before each call so that messages on EOF aren't
misleading.
4) Removed the vestigial file_send (not really a problem).

 - Added return value check on calls to binary_to_raw_bytes (via
out_filter).  This can be a db crasher.
 - Replaced use of fgets to better handle files with null bytes.
 - No longer accept the tab character as valid clean input data.

original thread:

https://groups.google.com/d/topic/moo-talk/uXaY2MGDgfQ/discussion

Original issue reported on code.google.com by wainst...@gmail.com on 13 Aug 2011 at 9:58