php-internal-docs
8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
gd_compat.c
Go to the documentation of this file.
1
#ifdef HAVE_CONFIG_H
2
#include <config.h>
3
#else
4
#include <php_config.h>
5
#endif
6
7
#include "
gd_compat.h
"
8
#include "
php.h
"
9
10
int
overflow2
(
int
a
,
int
b)
11
{
12
13
if
(
a
<= 0 || b <= 0) {
14
php_error_docref
(
NULL
,
E_WARNING
,
"One parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n"
);
15
return
1;
16
}
17
if
(
a
>
INT_MAX
/ b) {
18
php_error_docref
(
NULL
,
E_WARNING
,
"Product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n"
);
19
return
1;
20
}
21
return
0;
22
}
overflow2
int overflow2(int a, int b)
Definition
gd_compat.c:10
gd_compat.h
NULL
#define NULL
Definition
gdcache.h:45
php_error_docref
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)
Definition
main.c:1173
php.h
INT_MAX
#define INT_MAX
Definition
php.h:237
a
$obj a
Definition
test.php:84
E_WARNING
#define E_WARNING
Definition
zend_errors.h:24
ext
gd
gd_compat.c
Generated on Sat Aug 23 2025 01:46:08 for php-internal-docs by
1.13.2