Coverage Report

Created: 2022-02-19 20:29

/src/php-src/Zend/zend_multiply.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
   +----------------------------------------------------------------------+
3
   | Zend Engine                                                          |
4
   +----------------------------------------------------------------------+
5
   | Copyright (c) Zend Technologies Ltd. (http://www.zend.com)           |
6
   +----------------------------------------------------------------------+
7
   | This source file is subject to version 2.00 of the Zend license,     |
8
   | that is bundled with this package in the file LICENSE, and is        |
9
   | available through the world-wide-web at the following url:           |
10
   | http://www.zend.com/license/2_00.txt.                                |
11
   | If you did not receive a copy of the Zend license and are unable to  |
12
   | obtain it through the world-wide-web, please send a note to          |
13
   | license@zend.com so we can mail you a copy immediately.              |
14
   +----------------------------------------------------------------------+
15
   | Authors: Sascha Schumann <sascha@schumann.cx>                        |
16
   |          Ard Biesheuvel <ard.biesheuvel@linaro.org>                  |
17
   +----------------------------------------------------------------------+
18
*/
19
20
#include "zend_portability.h"
21
22
#ifndef ZEND_MULTIPLY_H
23
#define ZEND_MULTIPLY_H
24
25
#if PHP_HAVE_BUILTIN_SMULL_OVERFLOW && SIZEOF_LONG == SIZEOF_ZEND_LONG
26
27
255k
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
28
255k
  long __tmpvar;                          \
29
255k
  if (((usedval) = __builtin_smull_overflow((a), (b), &__tmpvar))) { \
30
6.18k
    (dval) = (double) (a) * (double) (b);           \
31
6.18k
  }                                \
32
248k
  else (lval) = __tmpvar;                     \
33
255k
} while (0)
34
35
#elif PHP_HAVE_BUILTIN_SMULLL_OVERFLOW && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG
36
37
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
38
  long long __tmpvar;                       \
39
  if (((usedval) = __builtin_smulll_overflow((a), (b), &__tmpvar))) { \
40
    (dval) = (double) (a) * (double) (b);           \
41
  }                               \
42
  else (lval) = __tmpvar;                     \
43
} while (0)
44
45
#elif (defined(__i386__) || defined(__x86_64__)) && defined(__GNUC__)
46
47
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
48
  zend_long __tmpvar;                           \
49
  __asm__ ("imul %3,%0\n"                     \
50
    "adc $0,%1"                         \
51
      : "=r"(__tmpvar),"=r"(usedval)              \
52
      : "0"(a), "r"(b), "1"(0));                \
53
  if (usedval) (dval) = (double) (a) * (double) (b);        \
54
  else (lval) = __tmpvar;                     \
55
} while (0)
56
57
#elif defined(__arm__) && defined(__GNUC__)
58
59
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
60
  zend_long __tmpvar;                           \
61
  __asm__("smull %0, %1, %2, %3\n"                \
62
    "sub %1, %1, %0, asr #31"                 \
63
      : "=r"(__tmpvar), "=r"(usedval)             \
64
      : "r"(a), "r"(b));                    \
65
  if (usedval) (dval) = (double) (a) * (double) (b);        \
66
  else (lval) = __tmpvar;                     \
67
} while (0)
68
69
#elif defined(__aarch64__) && defined(__GNUC__)
70
71
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
72
  zend_long __tmpvar;                           \
73
  __asm__("mul %0, %2, %3\n"                    \
74
    "smulh %1, %2, %3\n"                    \
75
    "sub %1, %1, %0, asr #63\n"                 \
76
      : "=&r"(__tmpvar), "=&r"(usedval)           \
77
      : "r"(a), "r"(b));                    \
78
  if (usedval) (dval) = (double) (a) * (double) (b);        \
79
  else (lval) = __tmpvar;                     \
80
} while (0)
81
82
#elif defined(ZEND_WIN32)
83
84
# ifdef _M_X64
85
#  pragma intrinsic(_mul128)
86
#  define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do {       \
87
  __int64 __high; \
88
  __int64 __low = _mul128((a), (b), &__high); \
89
  if ((__low >> 63I64) == __high) { \
90
    (usedval) = 0; \
91
    (lval) = __low; \
92
  } else { \
93
    (usedval) = 1; \
94
    (dval) = (double)(a) * (double)(b); \
95
  } \
96
} while (0)
97
# else
98
#  define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
99
  zend_long   __lres  = (a) * (b);                    \
100
  long double __dres  = (long double)(a) * (long double)(b);    \
101
  long double __delta = (long double) __lres - __dres;      \
102
  if ( ((usedval) = (( __dres + __delta ) != __dres))) {      \
103
    (dval) = __dres;                      \
104
  } else {                            \
105
    (lval) = __lres;                      \
106
  }                               \
107
} while (0)
108
# endif
109
110
#elif defined(__powerpc64__) && defined(__GNUC__)
111
112
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
113
  long __low, __high;           \
114
  __asm__("mulld %0,%2,%3\n\t"          \
115
    "mulhd %1,%2,%3\n"          \
116
    : "=&r"(__low), "=&r"(__high)       \
117
    : "r"(a), "r"(b));          \
118
  if ((__low >> 63) != __high) {          \
119
    (dval) = (double) (a) * (double) (b);     \
120
    (usedval) = 1;            \
121
  } else {              \
122
    (lval) = __low;           \
123
    (usedval) = 0;            \
124
  }               \
125
} while (0)
126
127
#elif SIZEOF_ZEND_LONG == 4
128
129
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
130
  int64_t __result = (int64_t) (a) * (int64_t) (b);       \
131
  if (__result > ZEND_LONG_MAX || __result < ZEND_LONG_MIN) {   \
132
    (dval) = (double) __result;                 \
133
    (usedval) = 1;                        \
134
  } else {                            \
135
    (lval) = (long) __result;                 \
136
    (usedval) = 0;                        \
137
  }                               \
138
} while (0)
139
140
#else
141
142
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
143
  long   __lres  = (a) * (b);                   \
144
  long double __dres  = (long double)(a) * (long double)(b);    \
145
  long double __delta = (long double) __lres - __dres;      \
146
  if ( ((usedval) = (( __dres + __delta ) != __dres))) {      \
147
    (dval) = __dres;                      \
148
  } else {                            \
149
    (lval) = __lres;                      \
150
  }                               \
151
} while (0)
152
153
#endif
154
155
#if defined(__GNUC__) && (defined(__native_client__) || defined(i386))
156
157
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
158
{
159
  size_t res = nmemb;
160
  size_t m_overflow = 0;
161
162
  if (ZEND_CONST_COND(offset == 0, 0)) {
163
    __asm__ ("mull %3\n\tadcl $0,%1"
164
       : "=&a"(res), "=&d" (m_overflow)
165
       : "%0"(res),
166
         "rm"(size));
167
  } else {
168
    __asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
169
       : "=&a"(res), "=&d" (m_overflow)
170
       : "%0"(res),
171
         "rm"(size),
172
         "rm"(offset));
173
  }
174
175
  if (UNEXPECTED(m_overflow)) {
176
    *overflow = 1;
177
    return 0;
178
  }
179
  *overflow = 0;
180
  return res;
181
}
182
183
#elif defined(__GNUC__) && defined(__x86_64__)
184
185
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
186
97.1M
{
187
97.1M
  size_t res = nmemb;
188
97.1M
  zend_ulong m_overflow = 0;
189
190
#ifdef __ILP32__ /* x32 */
191
# define LP_SUFF "l"
192
#else /* amd64 */
193
97.1M
# define LP_SUFF "q"
194
97.1M
#endif
195
196
97.1M
  if (ZEND_CONST_COND(offset == 0, 0)) {
197
25
    __asm__ ("mul" LP_SUFF  " %3\n\t"
198
25
      "adc $0,%1"
199
25
      : "=&a"(res), "=&d" (m_overflow)
200
25
      : "%0"(res),
201
25
        "rm"(size));
202
97.1M
  } else {
203
97.1M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
204
97.1M
      "add %4,%0\n\t"
205
97.1M
      "adc $0,%1"
206
97.1M
      : "=&a"(res), "=&d" (m_overflow)
207
97.1M
      : "%0"(res),
208
97.1M
        "rm"(size),
209
97.1M
        "rm"(offset));
210
97.1M
  }
211
97.1M
#undef LP_SUFF
212
97.1M
  if (UNEXPECTED(m_overflow)) {
213
0
    *overflow = 1;
214
0
    return 0;
215
0
  }
216
97.1M
  *overflow = 0;
217
97.1M
  return res;
218
97.1M
}
Unexecuted instantiation: php_date.c:zend_safe_address
Unexecuted instantiation: astro.c:zend_safe_address
Unexecuted instantiation: dow.c:zend_safe_address
Unexecuted instantiation: parse_date.c:zend_safe_address
Unexecuted instantiation: parse_tz.c:zend_safe_address
Unexecuted instantiation: timelib.c:zend_safe_address
Unexecuted instantiation: tm2unixtime.c:zend_safe_address
Unexecuted instantiation: unixtime2tm.c:zend_safe_address
Unexecuted instantiation: parse_iso_intervals.c:zend_safe_address
Unexecuted instantiation: interval.c:zend_safe_address
php_pcre.c:zend_safe_address
Line
Count
Source
186
126k
{
187
126k
  size_t res = nmemb;
188
126k
  zend_ulong m_overflow = 0;
189
190
#ifdef __ILP32__ /* x32 */
191
# define LP_SUFF "l"
192
#else /* amd64 */
193
126k
# define LP_SUFF "q"
194
126k
#endif
195
196
126k
  if (ZEND_CONST_COND(offset == 0, 0)) {
197
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
198
0
      "adc $0,%1"
199
0
      : "=&a"(res), "=&d" (m_overflow)
200
0
      : "%0"(res),
201
0
        "rm"(size));
202
126k
  } else {
203
126k
    __asm__ ("mul" LP_SUFF  " %3\n\t"
204
126k
      "add %4,%0\n\t"
205
126k
      "adc $0,%1"
206
126k
      : "=&a"(res), "=&d" (m_overflow)
207
126k
      : "%0"(res),
208
126k
        "rm"(size),
209
126k
        "rm"(offset));
210
126k
  }
211
126k
#undef LP_SUFF
212
126k
  if (UNEXPECTED(m_overflow)) {
213
0
    *overflow = 1;
214
0
    return 0;
215
0
  }
216
126k
  *overflow = 0;
217
126k
  return res;
218
126k
}
Unexecuted instantiation: exif.c:zend_safe_address
Unexecuted instantiation: hash.c:zend_safe_address
Unexecuted instantiation: hash_md.c:zend_safe_address
Unexecuted instantiation: hash_sha.c:zend_safe_address
Unexecuted instantiation: hash_ripemd.c:zend_safe_address
Unexecuted instantiation: hash_haval.c:zend_safe_address
Unexecuted instantiation: hash_tiger.c:zend_safe_address
Unexecuted instantiation: hash_gost.c:zend_safe_address
Unexecuted instantiation: hash_snefru.c:zend_safe_address
Unexecuted instantiation: hash_whirlpool.c:zend_safe_address
Unexecuted instantiation: hash_adler32.c:zend_safe_address
Unexecuted instantiation: hash_crc32.c:zend_safe_address
Unexecuted instantiation: hash_fnv.c:zend_safe_address
Unexecuted instantiation: hash_joaat.c:zend_safe_address
Unexecuted instantiation: hash_sha3.c:zend_safe_address
Unexecuted instantiation: json.c:zend_safe_address
Unexecuted instantiation: json_encoder.c:zend_safe_address
Unexecuted instantiation: json_parser.tab.c:zend_safe_address
Unexecuted instantiation: json_scanner.c:zend_safe_address
Unexecuted instantiation: mbstring.c:zend_safe_address
Unexecuted instantiation: php_unicode.c:zend_safe_address
Unexecuted instantiation: mb_gpc.c:zend_safe_address
Unexecuted instantiation: php_mbregex.c:zend_safe_address
Unexecuted instantiation: mbfilter.c:zend_safe_address
Unexecuted instantiation: php_reflection.c:zend_safe_address
Unexecuted instantiation: php_spl.c:zend_safe_address
Unexecuted instantiation: spl_functions.c:zend_safe_address
Unexecuted instantiation: spl_engine.c:zend_safe_address
Unexecuted instantiation: spl_iterators.c:zend_safe_address
Unexecuted instantiation: spl_array.c:zend_safe_address
Unexecuted instantiation: spl_directory.c:zend_safe_address
Unexecuted instantiation: spl_exceptions.c:zend_safe_address
Unexecuted instantiation: spl_observer.c:zend_safe_address
Unexecuted instantiation: spl_dllist.c:zend_safe_address
Unexecuted instantiation: spl_heap.c:zend_safe_address
Unexecuted instantiation: spl_fixedarray.c:zend_safe_address
Unexecuted instantiation: crypt_sha512.c:zend_safe_address
Unexecuted instantiation: crypt_sha256.c:zend_safe_address
Unexecuted instantiation: php_crypt_r.c:zend_safe_address
Unexecuted instantiation: array.c:zend_safe_address
Unexecuted instantiation: base64.c:zend_safe_address
Unexecuted instantiation: basic_functions.c:zend_safe_address
Unexecuted instantiation: browscap.c:zend_safe_address
Unexecuted instantiation: crc32.c:zend_safe_address
Unexecuted instantiation: crypt.c:zend_safe_address
Unexecuted instantiation: datetime.c:zend_safe_address
Unexecuted instantiation: dir.c:zend_safe_address
Unexecuted instantiation: dl.c:zend_safe_address
Unexecuted instantiation: dns.c:zend_safe_address
Unexecuted instantiation: exec.c:zend_safe_address
Unexecuted instantiation: file.c:zend_safe_address
Unexecuted instantiation: filestat.c:zend_safe_address
Unexecuted instantiation: flock_compat.c:zend_safe_address
Unexecuted instantiation: formatted_print.c:zend_safe_address
Unexecuted instantiation: fsock.c:zend_safe_address
Unexecuted instantiation: head.c:zend_safe_address
html.c:zend_safe_address
Line
Count
Source
186
25
{
187
25
  size_t res = nmemb;
188
25
  zend_ulong m_overflow = 0;
189
190
#ifdef __ILP32__ /* x32 */
191
# define LP_SUFF "l"
192
#else /* amd64 */
193
25
# define LP_SUFF "q"
194
25
#endif
195
196
25
  if (ZEND_CONST_COND(offset == 0, 0)) {
197
25
    __asm__ ("mul" LP_SUFF  " %3\n\t"
198
25
      "adc $0,%1"
199
25
      : "=&a"(res), "=&d" (m_overflow)
200
25
      : "%0"(res),
201
25
        "rm"(size));
202
0
  } else {
203
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
204
0
      "add %4,%0\n\t"
205
0
      "adc $0,%1"
206
0
      : "=&a"(res), "=&d" (m_overflow)
207
0
      : "%0"(res),
208
0
        "rm"(size),
209
0
        "rm"(offset));
210
0
  }
211
25
#undef LP_SUFF
212
25
  if (UNEXPECTED(m_overflow)) {
213
0
    *overflow = 1;
214
0
    return 0;
215
0
  }
216
25
  *overflow = 0;
217
25
  return res;
218
25
}
Unexecuted instantiation: image.c:zend_safe_address
Unexecuted instantiation: info.c:zend_safe_address
Unexecuted instantiation: iptc.c:zend_safe_address
Unexecuted instantiation: lcg.c:zend_safe_address
Unexecuted instantiation: link.c:zend_safe_address
Unexecuted instantiation: mail.c:zend_safe_address
Unexecuted instantiation: math.c:zend_safe_address
Unexecuted instantiation: md5.c:zend_safe_address
Unexecuted instantiation: metaphone.c:zend_safe_address
Unexecuted instantiation: microtime.c:zend_safe_address
Unexecuted instantiation: pack.c:zend_safe_address
Unexecuted instantiation: pageinfo.c:zend_safe_address
Unexecuted instantiation: quot_print.c:zend_safe_address
Unexecuted instantiation: rand.c:zend_safe_address
Unexecuted instantiation: mt_rand.c:zend_safe_address
Unexecuted instantiation: soundex.c:zend_safe_address
Unexecuted instantiation: string.c:zend_safe_address
Unexecuted instantiation: scanf.c:zend_safe_address
Unexecuted instantiation: syslog.c:zend_safe_address
Unexecuted instantiation: type.c:zend_safe_address
Unexecuted instantiation: uniqid.c:zend_safe_address
Unexecuted instantiation: url.c:zend_safe_address
Unexecuted instantiation: var.c:zend_safe_address
Unexecuted instantiation: versioning.c:zend_safe_address
Unexecuted instantiation: assert.c:zend_safe_address
Unexecuted instantiation: strnatcmp.c:zend_safe_address
Unexecuted instantiation: levenshtein.c:zend_safe_address
Unexecuted instantiation: incomplete_class.c:zend_safe_address
Unexecuted instantiation: url_scanner_ex.c:zend_safe_address
Unexecuted instantiation: ftp_fopen_wrapper.c:zend_safe_address
Unexecuted instantiation: http_fopen_wrapper.c:zend_safe_address
Unexecuted instantiation: php_fopen_wrapper.c:zend_safe_address
Unexecuted instantiation: credits.c:zend_safe_address
Unexecuted instantiation: css.c:zend_safe_address
Unexecuted instantiation: var_unserializer.c:zend_safe_address
Unexecuted instantiation: ftok.c:zend_safe_address
Unexecuted instantiation: sha1.c:zend_safe_address
Unexecuted instantiation: user_filters.c:zend_safe_address
Unexecuted instantiation: uuencode.c:zend_safe_address
Unexecuted instantiation: filters.c:zend_safe_address
Unexecuted instantiation: proc_open.c:zend_safe_address
Unexecuted instantiation: streamsfuncs.c:zend_safe_address
Unexecuted instantiation: http.c:zend_safe_address
Unexecuted instantiation: password.c:zend_safe_address
Unexecuted instantiation: random.c:zend_safe_address
Unexecuted instantiation: net.c:zend_safe_address
Unexecuted instantiation: hrtime.c:zend_safe_address
Unexecuted instantiation: main.c:zend_safe_address
Unexecuted instantiation: snprintf.c:zend_safe_address
Unexecuted instantiation: spprintf.c:zend_safe_address
Unexecuted instantiation: fopen_wrappers.c:zend_safe_address
Unexecuted instantiation: php_scandir.c:zend_safe_address
Unexecuted instantiation: php_ini.c:zend_safe_address
Unexecuted instantiation: SAPI.c:zend_safe_address
Unexecuted instantiation: rfc1867.c:zend_safe_address
Unexecuted instantiation: php_content_types.c:zend_safe_address
Unexecuted instantiation: strlcpy.c:zend_safe_address
Unexecuted instantiation: strlcat.c:zend_safe_address
Unexecuted instantiation: explicit_bzero.c:zend_safe_address
Unexecuted instantiation: reentrancy.c:zend_safe_address
Unexecuted instantiation: php_variables.c:zend_safe_address
Unexecuted instantiation: php_ticks.c:zend_safe_address
Unexecuted instantiation: network.c:zend_safe_address
Unexecuted instantiation: php_open_temporary_file.c:zend_safe_address
Unexecuted instantiation: output.c:zend_safe_address
Unexecuted instantiation: getopt.c:zend_safe_address
Unexecuted instantiation: php_syslog.c:zend_safe_address
Unexecuted instantiation: streams.c:zend_safe_address
Unexecuted instantiation: cast.c:zend_safe_address
Unexecuted instantiation: memory.c:zend_safe_address
Unexecuted instantiation: filter.c:zend_safe_address
Unexecuted instantiation: plain_wrapper.c:zend_safe_address
Unexecuted instantiation: userspace.c:zend_safe_address
Unexecuted instantiation: transports.c:zend_safe_address
Unexecuted instantiation: xp_socket.c:zend_safe_address
Unexecuted instantiation: mmap.c:zend_safe_address
Unexecuted instantiation: glob_wrapper.c:zend_safe_address
Unexecuted instantiation: zend_language_parser.c:zend_safe_address
Unexecuted instantiation: zend_language_scanner.c:zend_safe_address
Unexecuted instantiation: zend_ini_parser.c:zend_safe_address
Unexecuted instantiation: zend_ini_scanner.c:zend_safe_address
zend_alloc.c:zend_safe_address
Line
Count
Source
186
96.9M
{
187
96.9M
  size_t res = nmemb;
188
96.9M
  zend_ulong m_overflow = 0;
189
190
#ifdef __ILP32__ /* x32 */
191
# define LP_SUFF "l"
192
#else /* amd64 */
193
96.9M
# define LP_SUFF "q"
194
96.9M
#endif
195
196
96.9M
  if (ZEND_CONST_COND(offset == 0, 0)) {
197
0
    __asm__ ("mul" LP_SUFF  " %3\n\t"
198
0
      "adc $0,%1"
199
0
      : "=&a"(res), "=&d" (m_overflow)
200
0
      : "%0"(res),
201
0
        "rm"(size));
202
96.9M
  } else {
203
96.9M
    __asm__ ("mul" LP_SUFF  " %3\n\t"
204
96.9M
      "add %4,%0\n\t"
205
96.9M
      "adc $0,%1"
206
96.9M
      : "=&a"(res), "=&d" (m_overflow)
207
96.9M
      : "%0"(res),
208
96.9M
        "rm"(size),
209
96.9M
        "rm"(offset));
210
96.9M
  }
211
96.9M
#undef LP_SUFF
212
96.9M
  if (UNEXPECTED(m_overflow)) {
213
0
    *overflow = 1;
214
0
    return 0;
215
0
  }
216
96.9M
  *overflow = 0;
217
96.9M
  return res;
218
96.9M
}
Unexecuted instantiation: zend_compile.c:zend_safe_address
Unexecuted instantiation: zend_constants.c:zend_safe_address
Unexecuted instantiation: zend_dtrace.c:zend_safe_address
Unexecuted instantiation: zend_execute_API.c:zend_safe_address
Unexecuted instantiation: zend_highlight.c:zend_safe_address
Unexecuted instantiation: zend_llist.c:zend_safe_address
Unexecuted instantiation: zend_vm_opcodes.c:zend_safe_address
Unexecuted instantiation: zend_opcode.c:zend_safe_address
Unexecuted instantiation: zend_operators.c:zend_safe_address
Unexecuted instantiation: zend_ptr_stack.c:zend_safe_address
Unexecuted instantiation: zend_stack.c:zend_safe_address
Unexecuted instantiation: zend_variables.c:zend_safe_address
Unexecuted instantiation: zend.c:zend_safe_address
Unexecuted instantiation: zend_API.c:zend_safe_address
Unexecuted instantiation: zend_extensions.c:zend_safe_address
Unexecuted instantiation: zend_hash.c:zend_safe_address
Unexecuted instantiation: zend_list.c:zend_safe_address
Unexecuted instantiation: zend_builtin_functions.c:zend_safe_address
Unexecuted instantiation: zend_attributes.c:zend_safe_address
Unexecuted instantiation: zend_execute.c:zend_safe_address
Unexecuted instantiation: zend_ini.c:zend_safe_address
Unexecuted instantiation: zend_sort.c:zend_safe_address
Unexecuted instantiation: zend_multibyte.c:zend_safe_address
Unexecuted instantiation: zend_ts_hash.c:zend_safe_address
Unexecuted instantiation: zend_stream.c:zend_safe_address
Unexecuted instantiation: zend_iterators.c:zend_safe_address
Unexecuted instantiation: zend_interfaces.c:zend_safe_address
Unexecuted instantiation: zend_exceptions.c:zend_safe_address
Unexecuted instantiation: zend_strtod.c:zend_safe_address
Unexecuted instantiation: zend_gc.c:zend_safe_address
Unexecuted instantiation: zend_closures.c:zend_safe_address
Unexecuted instantiation: zend_weakrefs.c:zend_safe_address
Unexecuted instantiation: zend_float.c:zend_safe_address
Unexecuted instantiation: zend_string.c:zend_safe_address
Unexecuted instantiation: zend_signal.c:zend_safe_address
Unexecuted instantiation: zend_generators.c:zend_safe_address
Unexecuted instantiation: zend_virtual_cwd.c:zend_safe_address
Unexecuted instantiation: zend_ast.c:zend_safe_address
Unexecuted instantiation: zend_objects.c:zend_safe_address
Unexecuted instantiation: zend_object_handlers.c:zend_safe_address
Unexecuted instantiation: zend_objects_API.c:zend_safe_address
Unexecuted instantiation: zend_default_classes.c:zend_safe_address
Unexecuted instantiation: zend_inheritance.c:zend_safe_address
Unexecuted instantiation: zend_smart_str.c:zend_safe_address
Unexecuted instantiation: zend_cpuinfo.c:zend_safe_address
Unexecuted instantiation: zend_gdb.c:zend_safe_address
Unexecuted instantiation: internal_functions_cli.c:zend_safe_address
Unexecuted instantiation: fuzzer-execute.c:zend_safe_address
Unexecuted instantiation: fuzzer-sapi.c:zend_safe_address
219
220
#elif defined(__GNUC__) && defined(__arm__)
221
222
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
223
{
224
  size_t res;
225
  zend_ulong m_overflow;
226
227
  __asm__ ("umlal %0,%1,%2,%3"
228
    : "=r"(res), "=r"(m_overflow)
229
    : "r"(nmemb),
230
      "r"(size),
231
      "0"(offset),
232
      "1"(0));
233
234
  if (UNEXPECTED(m_overflow)) {
235
    *overflow = 1;
236
    return 0;
237
  }
238
  *overflow = 0;
239
  return res;
240
}
241
242
#elif defined(__GNUC__) && defined(__aarch64__)
243
244
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
245
{
246
  size_t res;
247
  zend_ulong m_overflow;
248
249
  __asm__ ("mul %0,%2,%3\n\tumulh %1,%2,%3\n\tadds %0,%0,%4\n\tadc %1,%1,xzr"
250
    : "=&r"(res), "=&r"(m_overflow)
251
    : "r"(nmemb),
252
      "r"(size),
253
      "r"(offset));
254
255
  if (UNEXPECTED(m_overflow)) {
256
    *overflow = 1;
257
    return 0;
258
  }
259
  *overflow = 0;
260
  return res;
261
}
262
263
#elif defined(__GNUC__) && defined(__powerpc64__)
264
265
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
266
{
267
        size_t res;
268
        unsigned long m_overflow;
269
270
        __asm__ ("mulld %0,%2,%3\n\t"
271
                 "mulhdu %1,%2,%3\n\t"
272
                 "addc %0,%0,%4\n\t"
273
                 "addze %1,%1\n"
274
             : "=&r"(res), "=&r"(m_overflow)
275
             : "r"(nmemb),
276
               "r"(size),
277
               "r"(offset));
278
279
        if (UNEXPECTED(m_overflow)) {
280
                *overflow = 1;
281
                return 0;
282
        }
283
        *overflow = 0;
284
        return res;
285
}
286
287
#elif SIZEOF_SIZE_T == 4
288
289
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
290
{
291
  uint64_t res = (uint64_t) nmemb * (uint64_t) size + (uint64_t) offset;
292
293
  if (UNEXPECTED(res > UINT64_C(0xFFFFFFFF))) {
294
    *overflow = 1;
295
    return 0;
296
  }
297
  *overflow = 0;
298
  return (size_t) res;
299
}
300
301
#else
302
303
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow)
304
{
305
  size_t res = nmemb * size + offset;
306
  double _d  = (double)nmemb * (double)size + (double)offset;
307
  double _delta = (double)res - _d;
308
309
  if (UNEXPECTED((_d + _delta ) != _d)) {
310
    *overflow = 1;
311
    return 0;
312
  }
313
  *overflow = 0;
314
  return res;
315
}
316
#endif
317
318
static zend_always_inline size_t zend_safe_address_guarded(size_t nmemb, size_t size, size_t offset)
319
97.1M
{
320
97.1M
  bool overflow;
321
97.1M
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
322
323
97.1M
  if (UNEXPECTED(overflow)) {
324
0
    zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
325
0
    return 0;
326
97.1M
  }
327
97.1M
  return ret;
328
97.1M
}
Unexecuted instantiation: php_date.c:zend_safe_address_guarded
Unexecuted instantiation: astro.c:zend_safe_address_guarded
Unexecuted instantiation: dow.c:zend_safe_address_guarded
Unexecuted instantiation: parse_date.c:zend_safe_address_guarded
Unexecuted instantiation: parse_tz.c:zend_safe_address_guarded
Unexecuted instantiation: timelib.c:zend_safe_address_guarded
Unexecuted instantiation: tm2unixtime.c:zend_safe_address_guarded
Unexecuted instantiation: unixtime2tm.c:zend_safe_address_guarded
Unexecuted instantiation: parse_iso_intervals.c:zend_safe_address_guarded
Unexecuted instantiation: interval.c:zend_safe_address_guarded
php_pcre.c:zend_safe_address_guarded
Line
Count
Source
319
126k
{
320
126k
  bool overflow;
321
126k
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
322
323
126k
  if (UNEXPECTED(overflow)) {
324
0
    zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
325
0
    return 0;
326
126k
  }
327
126k
  return ret;
328
126k
}
Unexecuted instantiation: exif.c:zend_safe_address_guarded
Unexecuted instantiation: hash.c:zend_safe_address_guarded
Unexecuted instantiation: hash_md.c:zend_safe_address_guarded
Unexecuted instantiation: hash_sha.c:zend_safe_address_guarded
Unexecuted instantiation: hash_ripemd.c:zend_safe_address_guarded
Unexecuted instantiation: hash_haval.c:zend_safe_address_guarded
Unexecuted instantiation: hash_tiger.c:zend_safe_address_guarded
Unexecuted instantiation: hash_gost.c:zend_safe_address_guarded
Unexecuted instantiation: hash_snefru.c:zend_safe_address_guarded
Unexecuted instantiation: hash_whirlpool.c:zend_safe_address_guarded
Unexecuted instantiation: hash_adler32.c:zend_safe_address_guarded
Unexecuted instantiation: hash_crc32.c:zend_safe_address_guarded
Unexecuted instantiation: hash_fnv.c:zend_safe_address_guarded
Unexecuted instantiation: hash_joaat.c:zend_safe_address_guarded
Unexecuted instantiation: hash_sha3.c:zend_safe_address_guarded
Unexecuted instantiation: json.c:zend_safe_address_guarded
Unexecuted instantiation: json_encoder.c:zend_safe_address_guarded
Unexecuted instantiation: json_parser.tab.c:zend_safe_address_guarded
Unexecuted instantiation: json_scanner.c:zend_safe_address_guarded
Unexecuted instantiation: mbstring.c:zend_safe_address_guarded
Unexecuted instantiation: php_unicode.c:zend_safe_address_guarded
Unexecuted instantiation: mb_gpc.c:zend_safe_address_guarded
Unexecuted instantiation: php_mbregex.c:zend_safe_address_guarded
Unexecuted instantiation: mbfilter.c:zend_safe_address_guarded
Unexecuted instantiation: php_reflection.c:zend_safe_address_guarded
Unexecuted instantiation: php_spl.c:zend_safe_address_guarded
Unexecuted instantiation: spl_functions.c:zend_safe_address_guarded
Unexecuted instantiation: spl_engine.c:zend_safe_address_guarded
Unexecuted instantiation: spl_iterators.c:zend_safe_address_guarded
Unexecuted instantiation: spl_array.c:zend_safe_address_guarded
Unexecuted instantiation: spl_directory.c:zend_safe_address_guarded
Unexecuted instantiation: spl_exceptions.c:zend_safe_address_guarded
Unexecuted instantiation: spl_observer.c:zend_safe_address_guarded
Unexecuted instantiation: spl_dllist.c:zend_safe_address_guarded
Unexecuted instantiation: spl_heap.c:zend_safe_address_guarded
Unexecuted instantiation: spl_fixedarray.c:zend_safe_address_guarded
Unexecuted instantiation: crypt_sha512.c:zend_safe_address_guarded
Unexecuted instantiation: crypt_sha256.c:zend_safe_address_guarded
Unexecuted instantiation: php_crypt_r.c:zend_safe_address_guarded
Unexecuted instantiation: array.c:zend_safe_address_guarded
Unexecuted instantiation: base64.c:zend_safe_address_guarded
Unexecuted instantiation: basic_functions.c:zend_safe_address_guarded
Unexecuted instantiation: browscap.c:zend_safe_address_guarded
Unexecuted instantiation: crc32.c:zend_safe_address_guarded
Unexecuted instantiation: crypt.c:zend_safe_address_guarded
Unexecuted instantiation: datetime.c:zend_safe_address_guarded
Unexecuted instantiation: dir.c:zend_safe_address_guarded
Unexecuted instantiation: dl.c:zend_safe_address_guarded
Unexecuted instantiation: dns.c:zend_safe_address_guarded
Unexecuted instantiation: exec.c:zend_safe_address_guarded
Unexecuted instantiation: file.c:zend_safe_address_guarded
Unexecuted instantiation: filestat.c:zend_safe_address_guarded
Unexecuted instantiation: flock_compat.c:zend_safe_address_guarded
Unexecuted instantiation: formatted_print.c:zend_safe_address_guarded
Unexecuted instantiation: fsock.c:zend_safe_address_guarded
Unexecuted instantiation: head.c:zend_safe_address_guarded
Unexecuted instantiation: html.c:zend_safe_address_guarded
Unexecuted instantiation: image.c:zend_safe_address_guarded
Unexecuted instantiation: info.c:zend_safe_address_guarded
Unexecuted instantiation: iptc.c:zend_safe_address_guarded
Unexecuted instantiation: lcg.c:zend_safe_address_guarded
Unexecuted instantiation: link.c:zend_safe_address_guarded
Unexecuted instantiation: mail.c:zend_safe_address_guarded
Unexecuted instantiation: math.c:zend_safe_address_guarded
Unexecuted instantiation: md5.c:zend_safe_address_guarded
Unexecuted instantiation: metaphone.c:zend_safe_address_guarded
Unexecuted instantiation: microtime.c:zend_safe_address_guarded
Unexecuted instantiation: pack.c:zend_safe_address_guarded
Unexecuted instantiation: pageinfo.c:zend_safe_address_guarded
Unexecuted instantiation: quot_print.c:zend_safe_address_guarded
Unexecuted instantiation: rand.c:zend_safe_address_guarded
Unexecuted instantiation: mt_rand.c:zend_safe_address_guarded
Unexecuted instantiation: soundex.c:zend_safe_address_guarded
Unexecuted instantiation: string.c:zend_safe_address_guarded
Unexecuted instantiation: scanf.c:zend_safe_address_guarded
Unexecuted instantiation: syslog.c:zend_safe_address_guarded
Unexecuted instantiation: type.c:zend_safe_address_guarded
Unexecuted instantiation: uniqid.c:zend_safe_address_guarded
Unexecuted instantiation: url.c:zend_safe_address_guarded
Unexecuted instantiation: var.c:zend_safe_address_guarded
Unexecuted instantiation: versioning.c:zend_safe_address_guarded
Unexecuted instantiation: assert.c:zend_safe_address_guarded
Unexecuted instantiation: strnatcmp.c:zend_safe_address_guarded
Unexecuted instantiation: levenshtein.c:zend_safe_address_guarded
Unexecuted instantiation: incomplete_class.c:zend_safe_address_guarded
Unexecuted instantiation: url_scanner_ex.c:zend_safe_address_guarded
Unexecuted instantiation: ftp_fopen_wrapper.c:zend_safe_address_guarded
Unexecuted instantiation: http_fopen_wrapper.c:zend_safe_address_guarded
Unexecuted instantiation: php_fopen_wrapper.c:zend_safe_address_guarded
Unexecuted instantiation: credits.c:zend_safe_address_guarded
Unexecuted instantiation: css.c:zend_safe_address_guarded
Unexecuted instantiation: var_unserializer.c:zend_safe_address_guarded
Unexecuted instantiation: ftok.c:zend_safe_address_guarded
Unexecuted instantiation: sha1.c:zend_safe_address_guarded
Unexecuted instantiation: user_filters.c:zend_safe_address_guarded
Unexecuted instantiation: uuencode.c:zend_safe_address_guarded
Unexecuted instantiation: filters.c:zend_safe_address_guarded
Unexecuted instantiation: proc_open.c:zend_safe_address_guarded
Unexecuted instantiation: streamsfuncs.c:zend_safe_address_guarded
Unexecuted instantiation: http.c:zend_safe_address_guarded
Unexecuted instantiation: password.c:zend_safe_address_guarded
Unexecuted instantiation: random.c:zend_safe_address_guarded
Unexecuted instantiation: net.c:zend_safe_address_guarded
Unexecuted instantiation: hrtime.c:zend_safe_address_guarded
Unexecuted instantiation: main.c:zend_safe_address_guarded
Unexecuted instantiation: snprintf.c:zend_safe_address_guarded
Unexecuted instantiation: spprintf.c:zend_safe_address_guarded
Unexecuted instantiation: fopen_wrappers.c:zend_safe_address_guarded
Unexecuted instantiation: php_scandir.c:zend_safe_address_guarded
Unexecuted instantiation: php_ini.c:zend_safe_address_guarded
Unexecuted instantiation: SAPI.c:zend_safe_address_guarded
Unexecuted instantiation: rfc1867.c:zend_safe_address_guarded
Unexecuted instantiation: php_content_types.c:zend_safe_address_guarded
Unexecuted instantiation: strlcpy.c:zend_safe_address_guarded
Unexecuted instantiation: strlcat.c:zend_safe_address_guarded
Unexecuted instantiation: explicit_bzero.c:zend_safe_address_guarded
Unexecuted instantiation: reentrancy.c:zend_safe_address_guarded
Unexecuted instantiation: php_variables.c:zend_safe_address_guarded
Unexecuted instantiation: php_ticks.c:zend_safe_address_guarded
Unexecuted instantiation: network.c:zend_safe_address_guarded
Unexecuted instantiation: php_open_temporary_file.c:zend_safe_address_guarded
Unexecuted instantiation: output.c:zend_safe_address_guarded
Unexecuted instantiation: getopt.c:zend_safe_address_guarded
Unexecuted instantiation: php_syslog.c:zend_safe_address_guarded
Unexecuted instantiation: streams.c:zend_safe_address_guarded
Unexecuted instantiation: cast.c:zend_safe_address_guarded
Unexecuted instantiation: memory.c:zend_safe_address_guarded
Unexecuted instantiation: filter.c:zend_safe_address_guarded
Unexecuted instantiation: plain_wrapper.c:zend_safe_address_guarded
Unexecuted instantiation: userspace.c:zend_safe_address_guarded
Unexecuted instantiation: transports.c:zend_safe_address_guarded
Unexecuted instantiation: xp_socket.c:zend_safe_address_guarded
Unexecuted instantiation: mmap.c:zend_safe_address_guarded
Unexecuted instantiation: glob_wrapper.c:zend_safe_address_guarded
Unexecuted instantiation: zend_language_parser.c:zend_safe_address_guarded
Unexecuted instantiation: zend_language_scanner.c:zend_safe_address_guarded
Unexecuted instantiation: zend_ini_parser.c:zend_safe_address_guarded
Unexecuted instantiation: zend_ini_scanner.c:zend_safe_address_guarded
zend_alloc.c:zend_safe_address_guarded
Line
Count
Source
319
96.9M
{
320
96.9M
  bool overflow;
321
96.9M
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
322
323
96.9M
  if (UNEXPECTED(overflow)) {
324
0
    zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
325
0
    return 0;
326
96.9M
  }
327
96.9M
  return ret;
328
96.9M
}
Unexecuted instantiation: zend_compile.c:zend_safe_address_guarded
Unexecuted instantiation: zend_constants.c:zend_safe_address_guarded
Unexecuted instantiation: zend_dtrace.c:zend_safe_address_guarded
Unexecuted instantiation: zend_execute_API.c:zend_safe_address_guarded
Unexecuted instantiation: zend_highlight.c:zend_safe_address_guarded
Unexecuted instantiation: zend_llist.c:zend_safe_address_guarded
Unexecuted instantiation: zend_vm_opcodes.c:zend_safe_address_guarded
Unexecuted instantiation: zend_opcode.c:zend_safe_address_guarded
Unexecuted instantiation: zend_operators.c:zend_safe_address_guarded
Unexecuted instantiation: zend_ptr_stack.c:zend_safe_address_guarded
Unexecuted instantiation: zend_stack.c:zend_safe_address_guarded
Unexecuted instantiation: zend_variables.c:zend_safe_address_guarded
Unexecuted instantiation: zend.c:zend_safe_address_guarded
Unexecuted instantiation: zend_API.c:zend_safe_address_guarded
Unexecuted instantiation: zend_extensions.c:zend_safe_address_guarded
Unexecuted instantiation: zend_hash.c:zend_safe_address_guarded
Unexecuted instantiation: zend_list.c:zend_safe_address_guarded
Unexecuted instantiation: zend_builtin_functions.c:zend_safe_address_guarded
Unexecuted instantiation: zend_attributes.c:zend_safe_address_guarded
Unexecuted instantiation: zend_execute.c:zend_safe_address_guarded
Unexecuted instantiation: zend_ini.c:zend_safe_address_guarded
Unexecuted instantiation: zend_sort.c:zend_safe_address_guarded
Unexecuted instantiation: zend_multibyte.c:zend_safe_address_guarded
Unexecuted instantiation: zend_ts_hash.c:zend_safe_address_guarded
Unexecuted instantiation: zend_stream.c:zend_safe_address_guarded
Unexecuted instantiation: zend_iterators.c:zend_safe_address_guarded
Unexecuted instantiation: zend_interfaces.c:zend_safe_address_guarded
Unexecuted instantiation: zend_exceptions.c:zend_safe_address_guarded
Unexecuted instantiation: zend_strtod.c:zend_safe_address_guarded
Unexecuted instantiation: zend_gc.c:zend_safe_address_guarded
Unexecuted instantiation: zend_closures.c:zend_safe_address_guarded
Unexecuted instantiation: zend_weakrefs.c:zend_safe_address_guarded
Unexecuted instantiation: zend_float.c:zend_safe_address_guarded
Unexecuted instantiation: zend_string.c:zend_safe_address_guarded
Unexecuted instantiation: zend_signal.c:zend_safe_address_guarded
Unexecuted instantiation: zend_generators.c:zend_safe_address_guarded
Unexecuted instantiation: zend_virtual_cwd.c:zend_safe_address_guarded
Unexecuted instantiation: zend_ast.c:zend_safe_address_guarded
Unexecuted instantiation: zend_objects.c:zend_safe_address_guarded
Unexecuted instantiation: zend_object_handlers.c:zend_safe_address_guarded
Unexecuted instantiation: zend_objects_API.c:zend_safe_address_guarded
Unexecuted instantiation: zend_default_classes.c:zend_safe_address_guarded
Unexecuted instantiation: zend_inheritance.c:zend_safe_address_guarded
Unexecuted instantiation: zend_smart_str.c:zend_safe_address_guarded
Unexecuted instantiation: zend_cpuinfo.c:zend_safe_address_guarded
Unexecuted instantiation: zend_gdb.c:zend_safe_address_guarded
Unexecuted instantiation: internal_functions_cli.c:zend_safe_address_guarded
Unexecuted instantiation: fuzzer-execute.c:zend_safe_address_guarded
Unexecuted instantiation: fuzzer-sapi.c:zend_safe_address_guarded
329
330
/* A bit more generic version of the same */
331
static zend_always_inline size_t zend_safe_addmult(size_t nmemb, size_t size, size_t offset, const char *message)
332
25
{
333
25
  bool overflow;
334
25
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
335
336
25
  if (UNEXPECTED(overflow)) {
337
0
    zend_error_noreturn(E_ERROR, "Possible integer overflow in %s (%zu * %zu + %zu)", message, nmemb, size, offset);
338
0
    return 0;
339
25
  }
340
25
  return ret;
341
25
}
Unexecuted instantiation: php_date.c:zend_safe_addmult
Unexecuted instantiation: astro.c:zend_safe_addmult
Unexecuted instantiation: dow.c:zend_safe_addmult
Unexecuted instantiation: parse_date.c:zend_safe_addmult
Unexecuted instantiation: parse_tz.c:zend_safe_addmult
Unexecuted instantiation: timelib.c:zend_safe_addmult
Unexecuted instantiation: tm2unixtime.c:zend_safe_addmult
Unexecuted instantiation: unixtime2tm.c:zend_safe_addmult
Unexecuted instantiation: parse_iso_intervals.c:zend_safe_addmult
Unexecuted instantiation: interval.c:zend_safe_addmult
Unexecuted instantiation: php_pcre.c:zend_safe_addmult
Unexecuted instantiation: exif.c:zend_safe_addmult
Unexecuted instantiation: hash.c:zend_safe_addmult
Unexecuted instantiation: hash_md.c:zend_safe_addmult
Unexecuted instantiation: hash_sha.c:zend_safe_addmult
Unexecuted instantiation: hash_ripemd.c:zend_safe_addmult
Unexecuted instantiation: hash_haval.c:zend_safe_addmult
Unexecuted instantiation: hash_tiger.c:zend_safe_addmult
Unexecuted instantiation: hash_gost.c:zend_safe_addmult
Unexecuted instantiation: hash_snefru.c:zend_safe_addmult
Unexecuted instantiation: hash_whirlpool.c:zend_safe_addmult
Unexecuted instantiation: hash_adler32.c:zend_safe_addmult
Unexecuted instantiation: hash_crc32.c:zend_safe_addmult
Unexecuted instantiation: hash_fnv.c:zend_safe_addmult
Unexecuted instantiation: hash_joaat.c:zend_safe_addmult
Unexecuted instantiation: hash_sha3.c:zend_safe_addmult
Unexecuted instantiation: json.c:zend_safe_addmult
Unexecuted instantiation: json_encoder.c:zend_safe_addmult
Unexecuted instantiation: json_parser.tab.c:zend_safe_addmult
Unexecuted instantiation: json_scanner.c:zend_safe_addmult
Unexecuted instantiation: mbstring.c:zend_safe_addmult
Unexecuted instantiation: php_unicode.c:zend_safe_addmult
Unexecuted instantiation: mb_gpc.c:zend_safe_addmult
Unexecuted instantiation: php_mbregex.c:zend_safe_addmult
Unexecuted instantiation: mbfilter.c:zend_safe_addmult
Unexecuted instantiation: php_reflection.c:zend_safe_addmult
Unexecuted instantiation: php_spl.c:zend_safe_addmult
Unexecuted instantiation: spl_functions.c:zend_safe_addmult
Unexecuted instantiation: spl_engine.c:zend_safe_addmult
Unexecuted instantiation: spl_iterators.c:zend_safe_addmult
Unexecuted instantiation: spl_array.c:zend_safe_addmult
Unexecuted instantiation: spl_directory.c:zend_safe_addmult
Unexecuted instantiation: spl_exceptions.c:zend_safe_addmult
Unexecuted instantiation: spl_observer.c:zend_safe_addmult
Unexecuted instantiation: spl_dllist.c:zend_safe_addmult
Unexecuted instantiation: spl_heap.c:zend_safe_addmult
Unexecuted instantiation: spl_fixedarray.c:zend_safe_addmult
Unexecuted instantiation: crypt_sha512.c:zend_safe_addmult
Unexecuted instantiation: crypt_sha256.c:zend_safe_addmult
Unexecuted instantiation: php_crypt_r.c:zend_safe_addmult
Unexecuted instantiation: array.c:zend_safe_addmult
Unexecuted instantiation: base64.c:zend_safe_addmult
Unexecuted instantiation: basic_functions.c:zend_safe_addmult
Unexecuted instantiation: browscap.c:zend_safe_addmult
Unexecuted instantiation: crc32.c:zend_safe_addmult
Unexecuted instantiation: crypt.c:zend_safe_addmult
Unexecuted instantiation: datetime.c:zend_safe_addmult
Unexecuted instantiation: dir.c:zend_safe_addmult
Unexecuted instantiation: dl.c:zend_safe_addmult
Unexecuted instantiation: dns.c:zend_safe_addmult
Unexecuted instantiation: exec.c:zend_safe_addmult
Unexecuted instantiation: file.c:zend_safe_addmult
Unexecuted instantiation: filestat.c:zend_safe_addmult
Unexecuted instantiation: flock_compat.c:zend_safe_addmult
Unexecuted instantiation: formatted_print.c:zend_safe_addmult
Unexecuted instantiation: fsock.c:zend_safe_addmult
Unexecuted instantiation: head.c:zend_safe_addmult
html.c:zend_safe_addmult
Line
Count
Source
332
25
{
333
25
  bool overflow;
334
25
  size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
335
336
25
  if (UNEXPECTED(overflow)) {
337
0
    zend_error_noreturn(E_ERROR, "Possible integer overflow in %s (%zu * %zu + %zu)", message, nmemb, size, offset);
338
0
    return 0;
339
25
  }
340
25
  return ret;
341
25
}
Unexecuted instantiation: image.c:zend_safe_addmult
Unexecuted instantiation: info.c:zend_safe_addmult
Unexecuted instantiation: iptc.c:zend_safe_addmult
Unexecuted instantiation: lcg.c:zend_safe_addmult
Unexecuted instantiation: link.c:zend_safe_addmult
Unexecuted instantiation: mail.c:zend_safe_addmult
Unexecuted instantiation: math.c:zend_safe_addmult
Unexecuted instantiation: md5.c:zend_safe_addmult
Unexecuted instantiation: metaphone.c:zend_safe_addmult
Unexecuted instantiation: microtime.c:zend_safe_addmult
Unexecuted instantiation: pack.c:zend_safe_addmult
Unexecuted instantiation: pageinfo.c:zend_safe_addmult
Unexecuted instantiation: quot_print.c:zend_safe_addmult
Unexecuted instantiation: rand.c:zend_safe_addmult
Unexecuted instantiation: mt_rand.c:zend_safe_addmult
Unexecuted instantiation: soundex.c:zend_safe_addmult
Unexecuted instantiation: string.c:zend_safe_addmult
Unexecuted instantiation: scanf.c:zend_safe_addmult
Unexecuted instantiation: syslog.c:zend_safe_addmult
Unexecuted instantiation: type.c:zend_safe_addmult
Unexecuted instantiation: uniqid.c:zend_safe_addmult
Unexecuted instantiation: url.c:zend_safe_addmult
Unexecuted instantiation: var.c:zend_safe_addmult
Unexecuted instantiation: versioning.c:zend_safe_addmult
Unexecuted instantiation: assert.c:zend_safe_addmult
Unexecuted instantiation: strnatcmp.c:zend_safe_addmult
Unexecuted instantiation: levenshtein.c:zend_safe_addmult
Unexecuted instantiation: incomplete_class.c:zend_safe_addmult
Unexecuted instantiation: url_scanner_ex.c:zend_safe_addmult
Unexecuted instantiation: ftp_fopen_wrapper.c:zend_safe_addmult
Unexecuted instantiation: http_fopen_wrapper.c:zend_safe_addmult
Unexecuted instantiation: php_fopen_wrapper.c:zend_safe_addmult
Unexecuted instantiation: credits.c:zend_safe_addmult
Unexecuted instantiation: css.c:zend_safe_addmult
Unexecuted instantiation: var_unserializer.c:zend_safe_addmult
Unexecuted instantiation: ftok.c:zend_safe_addmult
Unexecuted instantiation: sha1.c:zend_safe_addmult
Unexecuted instantiation: user_filters.c:zend_safe_addmult
Unexecuted instantiation: uuencode.c:zend_safe_addmult
Unexecuted instantiation: filters.c:zend_safe_addmult
Unexecuted instantiation: proc_open.c:zend_safe_addmult
Unexecuted instantiation: streamsfuncs.c:zend_safe_addmult
Unexecuted instantiation: http.c:zend_safe_addmult
Unexecuted instantiation: password.c:zend_safe_addmult
Unexecuted instantiation: random.c:zend_safe_addmult
Unexecuted instantiation: net.c:zend_safe_addmult
Unexecuted instantiation: hrtime.c:zend_safe_addmult
Unexecuted instantiation: main.c:zend_safe_addmult
Unexecuted instantiation: snprintf.c:zend_safe_addmult
Unexecuted instantiation: spprintf.c:zend_safe_addmult
Unexecuted instantiation: fopen_wrappers.c:zend_safe_addmult
Unexecuted instantiation: php_scandir.c:zend_safe_addmult
Unexecuted instantiation: php_ini.c:zend_safe_addmult
Unexecuted instantiation: SAPI.c:zend_safe_addmult
Unexecuted instantiation: rfc1867.c:zend_safe_addmult
Unexecuted instantiation: php_content_types.c:zend_safe_addmult
Unexecuted instantiation: strlcpy.c:zend_safe_addmult
Unexecuted instantiation: strlcat.c:zend_safe_addmult
Unexecuted instantiation: explicit_bzero.c:zend_safe_addmult
Unexecuted instantiation: reentrancy.c:zend_safe_addmult
Unexecuted instantiation: php_variables.c:zend_safe_addmult
Unexecuted instantiation: php_ticks.c:zend_safe_addmult
Unexecuted instantiation: network.c:zend_safe_addmult
Unexecuted instantiation: php_open_temporary_file.c:zend_safe_addmult
Unexecuted instantiation: output.c:zend_safe_addmult
Unexecuted instantiation: getopt.c:zend_safe_addmult
Unexecuted instantiation: php_syslog.c:zend_safe_addmult
Unexecuted instantiation: streams.c:zend_safe_addmult
Unexecuted instantiation: cast.c:zend_safe_addmult
Unexecuted instantiation: memory.c:zend_safe_addmult
Unexecuted instantiation: filter.c:zend_safe_addmult
Unexecuted instantiation: plain_wrapper.c:zend_safe_addmult
Unexecuted instantiation: userspace.c:zend_safe_addmult
Unexecuted instantiation: transports.c:zend_safe_addmult
Unexecuted instantiation: xp_socket.c:zend_safe_addmult
Unexecuted instantiation: mmap.c:zend_safe_addmult
Unexecuted instantiation: glob_wrapper.c:zend_safe_addmult
Unexecuted instantiation: zend_language_parser.c:zend_safe_addmult
Unexecuted instantiation: zend_language_scanner.c:zend_safe_addmult
Unexecuted instantiation: zend_ini_parser.c:zend_safe_addmult
Unexecuted instantiation: zend_ini_scanner.c:zend_safe_addmult
Unexecuted instantiation: zend_alloc.c:zend_safe_addmult
Unexecuted instantiation: zend_compile.c:zend_safe_addmult
Unexecuted instantiation: zend_constants.c:zend_safe_addmult
Unexecuted instantiation: zend_dtrace.c:zend_safe_addmult
Unexecuted instantiation: zend_execute_API.c:zend_safe_addmult
Unexecuted instantiation: zend_highlight.c:zend_safe_addmult
Unexecuted instantiation: zend_llist.c:zend_safe_addmult
Unexecuted instantiation: zend_vm_opcodes.c:zend_safe_addmult
Unexecuted instantiation: zend_opcode.c:zend_safe_addmult
Unexecuted instantiation: zend_operators.c:zend_safe_addmult
Unexecuted instantiation: zend_ptr_stack.c:zend_safe_addmult
Unexecuted instantiation: zend_stack.c:zend_safe_addmult
Unexecuted instantiation: zend_variables.c:zend_safe_addmult
Unexecuted instantiation: zend.c:zend_safe_addmult
Unexecuted instantiation: zend_API.c:zend_safe_addmult
Unexecuted instantiation: zend_extensions.c:zend_safe_addmult
Unexecuted instantiation: zend_hash.c:zend_safe_addmult
Unexecuted instantiation: zend_list.c:zend_safe_addmult
Unexecuted instantiation: zend_builtin_functions.c:zend_safe_addmult
Unexecuted instantiation: zend_attributes.c:zend_safe_addmult
Unexecuted instantiation: zend_execute.c:zend_safe_addmult
Unexecuted instantiation: zend_ini.c:zend_safe_addmult
Unexecuted instantiation: zend_sort.c:zend_safe_addmult
Unexecuted instantiation: zend_multibyte.c:zend_safe_addmult
Unexecuted instantiation: zend_ts_hash.c:zend_safe_addmult
Unexecuted instantiation: zend_stream.c:zend_safe_addmult
Unexecuted instantiation: zend_iterators.c:zend_safe_addmult
Unexecuted instantiation: zend_interfaces.c:zend_safe_addmult
Unexecuted instantiation: zend_exceptions.c:zend_safe_addmult
Unexecuted instantiation: zend_strtod.c:zend_safe_addmult
Unexecuted instantiation: zend_gc.c:zend_safe_addmult
Unexecuted instantiation: zend_closures.c:zend_safe_addmult
Unexecuted instantiation: zend_weakrefs.c:zend_safe_addmult
Unexecuted instantiation: zend_float.c:zend_safe_addmult
Unexecuted instantiation: zend_string.c:zend_safe_addmult
Unexecuted instantiation: zend_signal.c:zend_safe_addmult
Unexecuted instantiation: zend_generators.c:zend_safe_addmult
Unexecuted instantiation: zend_virtual_cwd.c:zend_safe_addmult
Unexecuted instantiation: zend_ast.c:zend_safe_addmult
Unexecuted instantiation: zend_objects.c:zend_safe_addmult
Unexecuted instantiation: zend_object_handlers.c:zend_safe_addmult
Unexecuted instantiation: zend_objects_API.c:zend_safe_addmult
Unexecuted instantiation: zend_default_classes.c:zend_safe_addmult
Unexecuted instantiation: zend_inheritance.c:zend_safe_addmult
Unexecuted instantiation: zend_smart_str.c:zend_safe_addmult
Unexecuted instantiation: zend_cpuinfo.c:zend_safe_addmult
Unexecuted instantiation: zend_gdb.c:zend_safe_addmult
Unexecuted instantiation: internal_functions_cli.c:zend_safe_addmult
Unexecuted instantiation: fuzzer-execute.c:zend_safe_addmult
Unexecuted instantiation: fuzzer-sapi.c:zend_safe_addmult
342
343
#endif /* ZEND_MULTIPLY_H */