gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r35900 - libmicrohttpd/src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r35900 - libmicrohttpd/src/microhttpd
Date: Tue, 9 Jun 2015 21:34:21 +0200

Author: Karlson2k
Date: 2015-06-09 21:34:21 +0200 (Tue, 09 Jun 2015)
New Revision: 35900

Modified:
   libmicrohttpd/src/microhttpd/response.c
Log:
response.c: file_reader(): reduce read size if buffer is too large

Modified: libmicrohttpd/src/microhttpd/response.c
===================================================================
--- libmicrohttpd/src/microhttpd/response.c     2015-06-09 19:34:14 UTC (rev 
35899)
+++ libmicrohttpd/src/microhttpd/response.c     2015-06-09 19:34:21 UTC (rev 
35900)
@@ -343,7 +343,18 @@
     return MHD_CONTENT_READER_END_WITH_ERROR; /* can't seek to required 
position */
 #endif
 
+#ifndef _WIN32
+  if (max > SSIZE_MAX)
+    max = SSIZE_MAX;
+
   n = read (response->fd, buf, max);
+#else  /* _WIN32 */
+  if (max > INT32_MAX)
+    max = INT32_MAX;
+
+  n = read (response->fd, buf, (unsigned int)max);
+#endif /* _WIN32 */
+
   if (0 == n)
     return MHD_CONTENT_READER_END_OF_STREAM;
   if (n < 0)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]