If a filename and a length are passed to ext::mmap, then the actual
length value passed to mmap() comes from an uninitialized stack
variable. The attached patch fixes the problem. Regards,
--
Jerry James
http://www.jamezone.org/
diff --git a/src/c/ffi/mmap.d b/src/c/ffi/mmap.d
index f907fc8..513ac74 100644
--- a/src/c/ffi/mmap.d
+++ b/src/c/ffi/mmap.d
@@ -61,6 +61,8 @@
fd = ecl_to_int(si_file_stream_fd(stream));
if (Null(length))
len = ecl_to_unsigned_integer(ecl_file_length(stream));
+ else
+ len = ecl_to_unsigned_integer(length);
}
output = si_make_vector(element_type, MAKE_FIXNUM(0), Cnil,
Cnil, Cnil, Cnil);
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list