a failing read(4) crashes pike
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=831
Reported by Mirar , Idonex Heavy Industries mirar@roxen.com
After some research, this is the workaround patch (committed):
--- file.c 2000/10/08 19:11:03 1.201
+++ file.c 2000/11/29 11:38:29
@@ -376,7 +376,14 @@
{
struct pike_string *str;
- str=begin_shared_string(r);
+
+/* WORKAROUND! FIXME! FIXME!
+ short string threshold is 16
+ /Mirar */
+
+ if (r>16)
+ str=begin_shared_string(r);
+ else
+ str=begin_shared_string(17);
SET_ONERROR(ebuf, call_free, str);
since begin_shared_string returns something that can't be freed if the string is less then SHORT_STRING_THRESHOLD, 16.
/Mirar