php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #61566
Patch 61566.diff revision 2012-04-02 15:07 UTC by ab@php.net
revision 2012-04-02 12:58 UTC by ab@php.net
revision 2012-03-31 10:02 UTC by ab@php.net

Patch 61566.diff for *Directory/Filesystem functions Bug #61566

Patch version 2012-03-31 10:02 UTC

Return to Bug #61566 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: ab@php.net

diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c
index 1f0f63b..849375e 100644
--- a/ext/fileinfo/libmagic/cdf.c
+++ b/ext/fileinfo/libmagic/cdf.c
@@ -298,7 +298,14 @@ cdf_read(const cdf_info_t *info, off_t off, void *buf, size_t len)
 		return -1;
 	}
 
+#if PHP_API_VERSION < 20100412 && defined PHP_WIN32
+	if (info->i_buf != NULL) {
+		if (info->i_len < siz) {
+			len = info->i_len;
+		}
+#else
 	if (info->i_buf != NULL && info->i_len >= siz) {
+#endif
 		(void)memcpy(buf, &info->i_buf[off], len);
 		return (ssize_t)len;
 	}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 11:01:28 2024 UTC