1
0
mirror of https://github.com/php/php-src.git synced 2026-04-30 03:33:17 +02:00

Mitigation for ssize_t issue in 22a5f554a8

and some more
This commit is contained in:
Anatol Belski
2017-07-22 22:33:18 +02:00
parent 934cfa35f8
commit e0825ec60f
4 changed files with 14 additions and 5 deletions
+1 -1
View File
@@ -823,7 +823,7 @@ size_t
mbfl_strpos(
mbfl_string *haystack,
mbfl_string *needle,
long offset,
ssize_t offset,
int reverse)
{
size_t result;
+10 -1
View File
@@ -98,6 +98,15 @@
#include "mbfl_convert.h"
#include "mbfl_ident.h"
/* Prefer local fix, otherwise need to include too much. */
#ifndef ssize_t
#if defined(_WIN64)
#define ssize_t __int64
#elif defined(_WIN32)
#define ssize_t __int32
#endif
#endif
/*
* version information
*/
@@ -191,7 +200,7 @@ mbfl_oddlen(mbfl_string *string);
* strpos
*/
MBFLAPI extern size_t
mbfl_strpos(mbfl_string *haystack, mbfl_string *needle, long offset, int reverse);
mbfl_strpos(mbfl_string *haystack, mbfl_string *needle, ssize_t offset, int reverse);
/*
+2 -2
View File
@@ -2435,7 +2435,7 @@ PHP_FUNCTION(mb_strrpos)
char *enc_name = NULL;
size_t enc_name_len;
zval *zoffset = NULL;
long offset = 0, str_flg, n;
zend_long offset = 0, str_flg, n;
char *enc_name2 = NULL;
int enc_name_len2;
@@ -4811,7 +4811,7 @@ static inline mbfl_buffer_converter *php_mb_init_convd(const mbfl_encoding *enco
static inline int php_mb_check_encoding_impl(mbfl_buffer_converter *convd, const char *input, size_t length, const mbfl_encoding *encoding) {
mbfl_string string, result, *ret = NULL;
long illegalchars = 0;
size_t illegalchars = 0;
/* initialize string */
mbfl_string_init_set(&string, mbfl_no_language_neutral, encoding);
+1 -1
View File
@@ -186,7 +186,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mbstring)
long func_overload;
zend_bool encoding_translation;
long strict_detection;
long illegalchars;
size_t illegalchars;
mbfl_buffer_converter *outconv;
void *http_output_conv_mimetypes;
#if HAVE_MBREGEX