403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.217.33
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/www/varnish4/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/www/varnish4/files/patch-lib_libvmod__std_vmod__std__conversions.c
--- lib/libvmod_std/vmod_std_conversions.c.orig	2019-02-11 14:06:27 UTC
+++ lib/libvmod_std/vmod_std_conversions.c
@@ -45,6 +45,21 @@
 #include "vtim.h"
 #include "vcc_if.h"
 
+/*
+ * technically, as our VCL_INT is int64_t, its limits are INT64_MIN/INT64_MAX.
+ *
+ * Yet, for conversions, we use VNUMpfx with a double intermediate, so above
+ * 2^53 we see rounding errors. In order to catch a potential floor rounding
+ * error, we make our limit 2^53-1
+ *
+ * Ref: https://stackoverflow.com/a/1848762
+ */
+#define VCL_INT_MAX ((INT64_C(1)<<53)-1)
+#define VCL_INT_MIN (-VCL_INT_MAX)
+
+#define VCL_BYTES_MAX VCL_INT_MAX
+#define VCL_BYTES_MIN 0
+
 VCL_DURATION __match_proto__(td_std_duration)
 vmod_duration(VRT_CTX, VCL_STRING p, VCL_DURATION d)
 {
@@ -195,7 +210,7 @@ vmod_real2integer(VRT_CTX, VCL_REAL r, VCL_INT i)
 	if (!isfinite(r))
 		return (i);
 	r = round(r);
-	if (r > LONG_MAX || r < LONG_MIN)
+	if (r > VCL_INT_MAX || r < VCL_INT_MIN)
 		return(i);
 	return ((long)r);
 }
@@ -219,7 +234,7 @@ vmod_time2integer(VRT_CTX, VCL_TIME t, VCL_INT i)
 	if (!isfinite(t))
 		return (i);
 	t = round(t);
-	if (t > LONG_MAX || t < LONG_MIN)
+	if (t > VCL_INT_MAX || t < VCL_INT_MIN)
 		return(i);
 	return ((long)t);
 }

Youez - 2016 - github.com/yon3zu
LinuXploit