--- ./desktop/unx/source/file_image_unx.c.orig 2012-05-22 08:48:18.000000000 -0400 +++ ./desktop/unx/source/file_image_unx.c 2012-07-13 15:39:21.000000000 -0400 @@ -68,6 +68,12 @@ goto cleanup_and_leave; } + if (st.st_size == 0) + { + result = EINVAL; + goto cleanup_and_leave; + } + p = mmap (0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); if (p == MAP_FAILED) {