gnunet-svn
[Top][All Lists]
Advanced

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

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


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

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

Modified:
   libmicrohttpd/src/microhttpd/response.c
Log:
response.c: MHD_create_response_from_fd_at_offset64(): don't create response if 
requested offset or size is not supported

Modified: libmicrohttpd/src/microhttpd/response.c
===================================================================
--- libmicrohttpd/src/microhttpd/response.c     2015-06-09 19:34:21 UTC (rev 
35900)
+++ libmicrohttpd/src/microhttpd/response.c     2015-06-09 19:34:27 UTC (rev 
35901)
@@ -427,7 +427,15 @@
 {
   struct MHD_Response *response;
 
-  response = MHD_create_response_from_callback (size,
+#if !defined(HAVE___LSEEKI64) && !defined(HAVE_LSEEK64)
+  if (sizeof(uint64_t) > sizeof(off_t) &&
+      (size > (uint64_t)INT32_MAX || offset > (uint64_t)INT32_MAX || (size + 
offset) >= (uint64_t)INT32_MAX))
+    return NULL;
+#endif
+  if ((int64_t)size < 0 || (int64_t)offset < 0 || (int64_t)(size + offset) < 0)
+    return NULL;
+
+  response = MHD_create_response_from_callback(size,
                                                4 * 1024,
                                                &file_reader,
                                                NULL,




reply via email to

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