idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
41,800 | PHPAPI PHP_FUNCTION(fgetc)
{
zval *arg1;
char buf[2];
int result;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
PHP_STREAM_TO_ZVAL(stream, &arg1);
result = php_stream_getc(stream);
if (result == EOF) {
RETVAL_FALSE;
} else {
buf[0]... | DoS Overflow | 0 | PHPAPI PHP_FUNCTION(fgetc)
{
zval *arg1;
char buf[2];
int result;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
PHP_STREAM_TO_ZVAL(stream, &arg1);
result = php_stream_getc(stream);
if (result == EOF) {
RETVAL_FALSE;
} else {
buf[0]... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,801 | PHPAPI PHP_FUNCTION(fgetss)
{
zval *fd;
long bytes = 0;
size_t len = 0;
size_t actual_len, retval_len;
char *buf = NULL, *retval;
php_stream *stream;
char *allowed_tags=NULL;
int allowed_tags_len=0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ls", &fd, &bytes, &allowed_tags, &allowed_tags_len) == ... | DoS Overflow | 0 | PHPAPI PHP_FUNCTION(fgetss)
{
zval *fd;
long bytes = 0;
size_t len = 0;
size_t actual_len, retval_len;
char *buf = NULL, *retval;
php_stream *stream;
char *allowed_tags=NULL;
int allowed_tags_len=0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ls", &fd, &bytes, &allowed_tags, &allowed_tags_len) == ... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,802 | PHP_FUNCTION(fscanf)
{
int result, format_len, type, argc = 0;
zval ***args = NULL;
zval *file_handle;
char *buf, *format;
size_t len;
void *what;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs*", &file_handle, &format, &format_len, &args, &argc) == FAILURE) {
return;
}
what = zend_fetch_resource... | DoS Overflow | 0 | PHP_FUNCTION(fscanf)
{
int result, format_len, type, argc = 0;
zval ***args = NULL;
zval *file_handle;
char *buf, *format;
size_t len;
void *what;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs*", &file_handle, &format, &format_len, &args, &argc) == FAILURE) {
return;
}
what = zend_fetch_resource... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,803 | PHPAPI PHP_FUNCTION(fwrite)
{
zval *arg1;
char *arg2;
int arg2len;
int ret;
int num_bytes;
long arg3 = 0;
char *buffer = NULL;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &arg2, &arg2len, &arg3) == FAILURE) {
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() == 2) {
num_by... | DoS Overflow | 0 | PHPAPI PHP_FUNCTION(fwrite)
{
zval *arg1;
char *arg2;
int arg2len;
int ret;
int num_bytes;
long arg3 = 0;
char *buffer = NULL;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &arg2, &arg2len, &arg3) == FAILURE) {
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() == 2) {
num_by... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,804 | PHPAPI PHP_FUNCTION(fflush)
{
zval *arg1;
int ret;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
PHP_STREAM_TO_ZVAL(stream, &arg1);
ret = php_stream_flush(stream);
if (ret) {
RETURN_FALSE;
}
RETURN_TRUE;
}
| DoS Overflow | 0 | PHPAPI PHP_FUNCTION(fflush)
{
zval *arg1;
int ret;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
PHP_STREAM_TO_ZVAL(stream, &arg1);
ret = php_stream_flush(stream);
if (ret) {
RETURN_FALSE;
}
RETURN_TRUE;
}
| @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,805 | PHPAPI PHP_FUNCTION(rewind)
{
zval *arg1;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
PHP_STREAM_TO_ZVAL(stream, &arg1);
if (-1 == php_stream_rewind(stream)) {
RETURN_FALSE;
}
RETURN_TRUE;
}
| DoS Overflow | 0 | PHPAPI PHP_FUNCTION(rewind)
{
zval *arg1;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
PHP_STREAM_TO_ZVAL(stream, &arg1);
if (-1 == php_stream_rewind(stream)) {
RETURN_FALSE;
}
RETURN_TRUE;
}
| @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,806 | PHPAPI PHP_FUNCTION(ftell)
{
zval *arg1;
long ret;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
PHP_STREAM_TO_ZVAL(stream, &arg1);
ret = php_stream_tell(stream);
if (ret == -1) {
RETURN_FALSE;
}
RETURN_LONG(ret);
}
| DoS Overflow | 0 | PHPAPI PHP_FUNCTION(ftell)
{
zval *arg1;
long ret;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
PHP_STREAM_TO_ZVAL(stream, &arg1);
ret = php_stream_tell(stream);
if (ret == -1) {
RETURN_FALSE;
}
RETURN_LONG(ret);
}
| @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,807 | PHP_FUNCTION(readfile)
{
char *filename;
int filename_len;
int size = 0;
zend_bool use_include_path = 0;
zval *zcontext = NULL;
php_stream *stream;
php_stream_context *context = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILUR... | DoS Overflow | 0 | PHP_FUNCTION(readfile)
{
char *filename;
int filename_len;
int size = 0;
zend_bool use_include_path = 0;
zval *zcontext = NULL;
php_stream *stream;
php_stream_context *context = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILUR... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,808 | PHP_FUNCTION(umask)
{
long arg1 = 0;
int oldumask;
oldumask = umask(077);
if (BG(umask) == -1) {
BG(umask) = oldumask;
}
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() == 0) {
umask(oldumask);
} else {
umask(arg1);
}
RETURN_LON... | DoS Overflow | 0 | PHP_FUNCTION(umask)
{
long arg1 = 0;
int oldumask;
oldumask = umask(077);
if (BG(umask) == -1) {
BG(umask) = oldumask;
}
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() == 0) {
umask(oldumask);
} else {
umask(arg1);
}
RETURN_LON... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,809 | PHP_FUNCTION(rename)
{
char *old_name, *new_name;
int old_name_len, new_name_len;
zval *zcontext = NULL;
php_stream_wrapper *wrapper;
php_stream_context *context;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|r", &old_name, &old_name_len, &new_name, &new_name_len, &zcontext) == FAILURE) {
RETURN_FAL... | DoS Overflow | 0 | PHP_FUNCTION(rename)
{
char *old_name, *new_name;
int old_name_len, new_name_len;
zval *zcontext = NULL;
php_stream_wrapper *wrapper;
php_stream_context *context;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|r", &old_name, &old_name_len, &new_name, &new_name_len, &zcontext) == FAILURE) {
RETURN_FAL... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,810 | PHP_FUNCTION(unlink)
{
char *filename;
int filename_len;
php_stream_wrapper *wrapper;
zval *zcontext = NULL;
php_stream_context *context = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|r", &filename, &filename_len, &zcontext) == FAILURE) {
RETURN_FALSE;
}
context = php_stream_context_from_zv... | DoS Overflow | 0 | PHP_FUNCTION(unlink)
{
char *filename;
int filename_len;
php_stream_wrapper *wrapper;
zval *zcontext = NULL;
php_stream_context *context = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|r", &filename, &filename_len, &zcontext) == FAILURE) {
RETURN_FALSE;
}
context = php_stream_context_from_zv... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,811 | PHP_FUNCTION(copy)
{
char *source, *target;
int source_len, target_len;
zval *zcontext = NULL;
php_stream_context *context;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|r", &source, &source_len, &target, &target_len, &zcontext) == FAILURE) {
return;
}
if (php_check_open_basedir(source TSRMLS_CC))... | DoS Overflow | 0 | PHP_FUNCTION(copy)
{
char *source, *target;
int source_len, target_len;
zval *zcontext = NULL;
php_stream_context *context;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|r", &source, &source_len, &target, &target_len, &zcontext) == FAILURE) {
return;
}
if (php_check_open_basedir(source TSRMLS_CC))... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,812 | PHP_FUNCTION(fputcsv)
{
char delimiter = ','; /* allow this to be set as parameter */
char enclosure = '"'; /* allow this to be set as parameter */
char escape_char = '\\'; /* allow this to be set as parameter */
php_stream *stream;
zval *fp = NULL, *fields = NULL;
int ret;
char *delimiter_str = NULL, *enclosu... | DoS Overflow | 0 | PHP_FUNCTION(fputcsv)
{
char delimiter = ','; /* allow this to be set as parameter */
char enclosure = '"'; /* allow this to be set as parameter */
char escape_char = '\\'; /* allow this to be set as parameter */
php_stream *stream;
zval *fp = NULL, *fields = NULL;
int ret;
char *delimiter_str = NULL, *enclosu... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,813 | PHP_FUNCTION(fgetcsv)
{
char delimiter = ','; /* allow this to be set as parameter */
char enclosure = '"'; /* allow this to be set as parameter */
char escape = '\\';
/* first section exactly as php_fgetss */
long len = 0;
size_t buf_len;
char *buf;
php_stream *stream;
{
zval *fd, **len_zv = NULL;
char... | DoS Overflow | 0 | PHP_FUNCTION(fgetcsv)
{
char delimiter = ','; /* allow this to be set as parameter */
char enclosure = '"'; /* allow this to be set as parameter */
char escape = '\\';
/* first section exactly as php_fgetss */
long len = 0;
size_t buf_len;
char *buf;
php_stream *stream;
{
zval *fd, **len_zv = NULL;
char... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,814 | PHP_FUNCTION(realpath)
{
char *filename;
int filename_len;
char resolved_path_buff[MAXPATHLEN];
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
return;
}
if (VCWD_REALPATH(filename, resolved_path_buff)) {
if (php_check_open_basedir(resolved_path_buff TSRMLS_... | DoS Overflow | 0 | PHP_FUNCTION(realpath)
{
char *filename;
int filename_len;
char resolved_path_buff[MAXPATHLEN];
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
return;
}
if (VCWD_REALPATH(filename, resolved_path_buff)) {
if (php_check_open_basedir(resolved_path_buff TSRMLS_... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,815 | PHP_FUNCTION(fnmatch)
{
char *pattern, *filename;
int pattern_len, filename_len;
long flags = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|l", &pattern, &pattern_len, &filename, &filename_len, &flags) == FAILURE) {
return;
}
if (filename_len >= MAXPATHLEN) {
php_error_docref(NULL TSRMLS_CC, E... | DoS Overflow | 0 | PHP_FUNCTION(fnmatch)
{
char *pattern, *filename;
int pattern_len, filename_len;
long flags = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|l", &pattern, &pattern_len, &filename, &filename_len, &flags) == FAILURE) {
return;
}
if (filename_len >= MAXPATHLEN) {
php_error_docref(NULL TSRMLS_CC, E... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,816 | PHP_FUNCTION(sys_get_temp_dir)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_STRING((char *)php_get_temporary_directory(TSRMLS_C), 1);
}
| DoS Overflow | 0 | PHP_FUNCTION(sys_get_temp_dir)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_STRING((char *)php_get_temporary_directory(TSRMLS_C), 1);
}
| @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,817 | PHP_MINIT_FUNCTION(file)
{
le_stream_context = zend_register_list_destructors_ex(file_context_dtor, NULL, "stream-context", module_number);
#ifdef ZTS
ts_allocate_id(&file_globals_id, sizeof(php_file_globals), (ts_allocate_ctor) file_globals_ctor, (ts_allocate_dtor) file_globals_dtor);
#else
file_globals_ctor(&file... | DoS Overflow | 0 | PHP_MINIT_FUNCTION(file)
{
le_stream_context = zend_register_list_destructors_ex(file_context_dtor, NULL, "stream-context", module_number);
#ifdef ZTS
ts_allocate_id(&file_globals_id, sizeof(php_file_globals), (ts_allocate_ctor) file_globals_ctor, (ts_allocate_dtor) file_globals_dtor);
#else
file_globals_ctor(&file... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,818 | PHP_NAMED_FUNCTION(php_if_tmpfile)
{
php_stream *stream;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
stream = php_stream_fopen_tmpfile();
if (stream) {
php_stream_to_zval(stream, return_value);
} else {
RETURN_FALSE;
}
}
| DoS Overflow | 0 | PHP_NAMED_FUNCTION(php_if_tmpfile)
{
php_stream *stream;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
stream = php_stream_fopen_tmpfile();
if (stream) {
php_stream_to_zval(stream, return_value);
} else {
RETURN_FALSE;
}
}
| @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,819 | PHP_NAMED_FUNCTION(php_if_fopen)
{
char *filename, *mode;
int filename_len, mode_len;
zend_bool use_include_path = 0;
zval *zcontext = NULL;
php_stream *stream;
php_stream_context *context = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps|br", &filename, &filename_len, &mode, &mode_len, &use_incl... | DoS Overflow | 0 | PHP_NAMED_FUNCTION(php_if_fopen)
{
char *filename, *mode;
int filename_len, mode_len;
zend_bool use_include_path = 0;
zval *zcontext = NULL;
php_stream *stream;
php_stream_context *context = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps|br", &filename, &filename_len, &mode, &mode_len, &use_incl... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,820 | static ZEND_RSRC_DTOR_FUNC(file_context_dtor)
{
php_stream_context *context = (php_stream_context*)rsrc->ptr;
if (context->options) {
zval_ptr_dtor(&context->options);
context->options = NULL;
}
php_stream_context_free(context);
}
| DoS Overflow | 0 | static ZEND_RSRC_DTOR_FUNC(file_context_dtor)
{
php_stream_context *context = (php_stream_context*)rsrc->ptr;
if (context->options) {
zval_ptr_dtor(&context->options);
context->options = NULL;
}
php_stream_context_free(context);
}
| @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,821 | static void file_globals_ctor(php_file_globals *file_globals_p TSRMLS_DC)
{
FG(pclose_ret) = 0;
FG(pclose_wait) = 0;
FG(user_stream_current_filename) = NULL;
FG(def_chunk_size) = PHP_SOCK_CHUNK_SIZE;
FG(wrapper_errors) = NULL;
}
| DoS Overflow | 0 | static void file_globals_ctor(php_file_globals *file_globals_p TSRMLS_DC)
{
FG(pclose_ret) = 0;
FG(pclose_wait) = 0;
FG(user_stream_current_filename) = NULL;
FG(def_chunk_size) = PHP_SOCK_CHUNK_SIZE;
FG(wrapper_errors) = NULL;
}
| @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,822 | static void file_globals_dtor(php_file_globals *file_globals_p TSRMLS_DC)
{
}
| DoS Overflow | 0 | static void file_globals_dtor(php_file_globals *file_globals_p TSRMLS_DC)
{
}
| @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,823 | PHPAPI int php_copy_file_ctx(char *src, char *dest, int src_flg, php_stream_context *ctx TSRMLS_DC)
{
php_stream *srcstream = NULL, *deststream = NULL;
int ret = FAILURE;
php_stream_statbuf src_s, dest_s;
switch (php_stream_stat_path_ex(src, 0, &src_s, ctx)) {
case -1:
/* non-statable stream */
goto safe_t... | DoS Overflow | 0 | PHPAPI int php_copy_file_ctx(char *src, char *dest, int src_flg, php_stream_context *ctx TSRMLS_DC)
{
php_stream *srcstream = NULL, *deststream = NULL;
int ret = FAILURE;
php_stream_statbuf src_s, dest_s;
switch (php_stream_stat_path_ex(src, 0, &src_s, ctx)) {
case -1:
/* non-statable stream */
goto safe_t... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,824 | PHPAPI int php_copy_file_ex(char *src, char *dest, int src_flg TSRMLS_DC)
{
return php_copy_file_ctx(src, dest, 0, NULL TSRMLS_CC);
}
| DoS Overflow | 0 | PHPAPI int php_copy_file_ex(char *src, char *dest, int src_flg TSRMLS_DC)
{
return php_copy_file_ctx(src, dest, 0, NULL TSRMLS_CC);
}
| @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,825 | PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value TSRMLS_DC) /* {{{ */
{
char *temp, *tptr, *bptr, *line_end, *limit;
size_t temp_len, line_end_len;
int inc_len;
zend_bool first_field = 1;
/* initialize internal state */
ph... | DoS Overflow | 0 | PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value TSRMLS_DC) /* {{{ */
{
char *temp, *tptr, *bptr, *line_end, *limit;
size_t temp_len, line_end_len;
int inc_len;
zend_bool first_field = 1;
/* initialize internal state */
ph... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,826 | static const char *php_fgetcsv_lookup_trailing_spaces(const char *ptr, size_t len, const char delimiter TSRMLS_DC) /* {{{ */
{
int inc_len;
unsigned char last_chars[2] = { 0, 0 };
while (len > 0) {
inc_len = (*ptr == '\0' ? 1: php_mblen(ptr, len));
switch (inc_len) {
case -2:
case -1:
inc_len = 1;
... | DoS Overflow | 0 | static const char *php_fgetcsv_lookup_trailing_spaces(const char *ptr, size_t len, const char delimiter TSRMLS_DC) /* {{{ */
{
int inc_len;
unsigned char last_chars[2] = { 0, 0 };
while (len > 0) {
inc_len = (*ptr == '\0' ? 1: php_mblen(ptr, len));
switch (inc_len) {
case -2:
case -1:
inc_len = 1;
... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,827 | PHPAPI int php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC)
{
int count, i = 0, ret;
zval **field_tmp = NULL, field;
smart_str csvline = {0};
HashPosition pos;
count = zend_hash_num_elements(Z_ARRVAL_P(fields));
zend_hash_internal_pointer_reset_ex(Z_ARRVAL... | DoS Overflow | 0 | PHPAPI int php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC)
{
int count, i = 0, ret;
zval **field_tmp = NULL, field;
smart_str csvline = {0};
HashPosition pos;
count = zend_hash_num_elements(Z_ARRVAL_P(fields));
zend_hash_internal_pointer_reset_ex(Z_ARRVAL... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,828 | PHPAPI int php_le_stream_context(TSRMLS_D)
{
return le_stream_context;
}
| DoS Overflow | 0 | PHPAPI int php_le_stream_context(TSRMLS_D)
{
return le_stream_context;
}
| @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,829 | PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC)
{
return php_mkdir_ex(dir, mode, REPORT_ERRORS TSRMLS_CC);
}
| DoS Overflow | 0 | PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC)
{
return php_mkdir_ex(dir, mode, REPORT_ERRORS TSRMLS_CC);
}
| @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,830 | PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC)
{
int ret;
if (php_check_open_basedir(dir TSRMLS_CC)) {
return -1;
}
if ((ret = VCWD_MKDIR(dir, (mode_t)mode)) < 0 && (options & REPORT_ERRORS)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
}
return ret;
}
| DoS Overflow | 0 | PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC)
{
int ret;
if (php_check_open_basedir(dir TSRMLS_CC)) {
return -1;
}
if ((ret = VCWD_MKDIR(dir, (mode_t)mode)) < 0 && (options & REPORT_ERRORS)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
}
return ret;
}
| @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,831 | php_meta_tags_token php_next_meta_token(php_meta_tags_data *md TSRMLS_DC)
{
int ch = 0, compliment;
char buff[META_DEF_BUFSIZE + 1];
memset((void *)buff, 0, META_DEF_BUFSIZE + 1);
while (md->ulc || (!php_stream_eof(md->stream) && (ch = php_stream_getc(md->stream)))) {
if (php_stream_eof(md->stream)) {
break;... | DoS Overflow | 0 | php_meta_tags_token php_next_meta_token(php_meta_tags_data *md TSRMLS_DC)
{
int ch = 0, compliment;
char buff[META_DEF_BUFSIZE + 1];
memset((void *)buff, 0, META_DEF_BUFSIZE + 1);
while (md->ulc || (!php_stream_eof(md->stream) && (ch = php_stream_getc(md->stream)))) {
if (php_stream_eof(md->stream)) {
break;... | @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread)
RETURN_FALSE;
}
+ if (len > INT_MAX) {
+ /* string length is int in 5.x so we can not read more than int */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX);
+ RETURN_FALSE;
+ }
+
Z_STRVAL_P(return_value) = e... | CWE-190 | null | null |
41,832 | PHP_FUNCTION(htmlspecialchars_decode)
{
char *str;
int str_len;
size_t new_len = 0;
long quote_style = ENT_COMPAT;
char *replaced;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, "e_style) == FAILURE) {
return;
}
replaced = php_unescape_html_entities(str, str_len, &new_len, 0... | DoS Overflow | 0 | PHP_FUNCTION(htmlspecialchars_decode)
{
char *str;
int str_len;
size_t new_len = 0;
long quote_style = ENT_COMPAT;
char *replaced;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, "e_style) == FAILURE) {
return;
}
replaced = php_unescape_html_entities(str, str_len, &new_len, 0... | @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,833 | PHP_FUNCTION(html_entity_decode)
{
char *str, *hint_charset = NULL;
int str_len, hint_charset_len = 0;
size_t new_len = 0;
long quote_style = ENT_COMPAT;
char *replaced;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &str, &str_len,
"e_style, &hint_charset, &hint_charset_len) == FAILUR... | DoS Overflow | 0 | PHP_FUNCTION(html_entity_decode)
{
char *str, *hint_charset = NULL;
int str_len, hint_charset_len = 0;
size_t new_len = 0;
long quote_style = ENT_COMPAT;
char *replaced;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &str, &str_len,
"e_style, &hint_charset, &hint_charset_len) == FAILUR... | @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,834 | PHP_FUNCTION(htmlentities)
{
php_html_entities(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
| DoS Overflow | 0 | PHP_FUNCTION(htmlentities)
{
php_html_entities(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
| @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,835 | static inline void find_entity_for_char_basic(
unsigned int k,
const entity_stage3_row *table,
const unsigned char **entity,
size_t *entity_len)
{
if (k >= 64U) {
*entity = NULL;
*entity_len = 0;
return;
}
*entity = table[k].data.ent.entity;
*entity_len = table[k].data.ent.entity_len;
}
| DoS Overflow | 0 | static inline void find_entity_for_char_basic(
unsigned int k,
const entity_stage3_row *table,
const unsigned char **entity,
size_t *entity_len)
{
if (k >= 64U) {
*entity = NULL;
*entity_len = 0;
return;
}
*entity = table[k].data.ent.entity;
*entity_len = table[k].data.ent.entity_len;
}
| @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,836 | static inline void map_to_unicode(unsigned code, const enc_to_uni *table, unsigned *res)
{
/* only single byte encodings are currently supported; assumed code <= 0xFF */
*res = table->inner[ENT_ENC_TO_UNI_STAGE1(code)]->uni_cp[ENT_ENC_TO_UNI_STAGE2(code)];
}
| DoS Overflow | 0 | static inline void map_to_unicode(unsigned code, const enc_to_uni *table, unsigned *res)
{
/* only single byte encodings are currently supported; assumed code <= 0xFF */
*res = table->inner[ENT_ENC_TO_UNI_STAGE1(code)]->uni_cp[ENT_ENC_TO_UNI_STAGE2(code)];
}
| @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,837 | static inline int numeric_entity_is_allowed(unsigned uni_cp, int document_type)
{
/* less restrictive than unicode_cp_is_allowed */
switch (document_type) {
case ENT_HTML_DOC_HTML401:
/* all non-SGML characters (those marked with UNUSED in DESCSET) should be
* representable with numeric entities */
return uni... | DoS Overflow | 0 | static inline int numeric_entity_is_allowed(unsigned uni_cp, int document_type)
{
/* less restrictive than unicode_cp_is_allowed */
switch (document_type) {
case ENT_HTML_DOC_HTML401:
/* all non-SGML characters (those marked with UNUSED in DESCSET) should be
* representable with numeric entities */
return uni... | @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,838 | PHPAPI char *php_escape_html_entities(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset TSRMLS_DC)
{
return php_escape_html_entities_ex(old, oldlen, newlen, all, flags, hint_charset, 1 TSRMLS_CC);
}
| DoS Overflow | 0 | PHPAPI char *php_escape_html_entities(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset TSRMLS_DC)
{
return php_escape_html_entities_ex(old, oldlen, newlen, all, flags, hint_charset, 1 TSRMLS_CC);
}
| @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,839 | static inline size_t php_mb2_int_to_char(unsigned char *buf, unsigned k)
{
assert(k <= 0xFFFFU);
/* one or two bytes */
if (k <= 0xFFU) { /* 1 */
buf[0] = k;
return 1U;
} else { /* 2 */
buf[0] = k >> 8;
buf[1] = k & 0xFFU;
return 2U;
}
}
| DoS Overflow | 0 | static inline size_t php_mb2_int_to_char(unsigned char *buf, unsigned k)
{
assert(k <= 0xFFFFU);
/* one or two bytes */
if (k <= 0xFFU) { /* 1 */
buf[0] = k;
return 1U;
} else { /* 2 */
buf[0] = k >> 8;
buf[1] = k & 0xFFU;
return 2U;
}
}
| @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,840 | static inline size_t php_mb3_int_to_char(unsigned char *buf, unsigned k)
{
assert(k <= 0xFFFFFFU);
/* one to three bytes */
if (k <= 0xFFU) { /* 1 */
buf[0] = k;
return 1U;
} else if (k <= 0xFFFFU) { /* 2 */
buf[0] = k >> 8;
buf[1] = k & 0xFFU;
return 2U;
} else {
buf[0] = k >> 16;
buf[1] = (k >> 8) ... | DoS Overflow | 0 | static inline size_t php_mb3_int_to_char(unsigned char *buf, unsigned k)
{
assert(k <= 0xFFFFFFU);
/* one to three bytes */
if (k <= 0xFFU) { /* 1 */
buf[0] = k;
return 1U;
} else if (k <= 0xFFFFU) { /* 2 */
buf[0] = k >> 8;
buf[1] = k & 0xFFU;
return 2U;
} else {
buf[0] = k >> 16;
buf[1] = (k >> 8) ... | @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,841 | PHPAPI unsigned int php_next_utf8_char(
const unsigned char *str,
size_t str_len,
size_t *cursor,
int *status)
{
return get_next_char(cs_utf_8, str, str_len, cursor, status);
}
| DoS Overflow | 0 | PHPAPI unsigned int php_next_utf8_char(
const unsigned char *str,
size_t str_len,
size_t *cursor,
int *status)
{
return get_next_char(cs_utf_8, str, str_len, cursor, status);
}
| @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,842 | static inline size_t php_utf32_utf8(unsigned char *buf, unsigned k)
{
size_t retval = 0;
/* assert(0x0 <= k <= 0x10FFFF); */
if (k < 0x80) {
buf[0] = k;
retval = 1;
} else if (k < 0x800) {
buf[0] = 0xc0 | (k >> 6);
buf[1] = 0x80 | (k & 0x3f);
retval = 2;
} else if (k < 0x10000) {
buf[0] = 0xe0 | (k >... | DoS Overflow | 0 | static inline size_t php_utf32_utf8(unsigned char *buf, unsigned k)
{
size_t retval = 0;
/* assert(0x0 <= k <= 0x10FFFF); */
if (k < 0x80) {
buf[0] = k;
retval = 1;
} else if (k < 0x800) {
buf[0] = 0xc0 | (k >> 6);
buf[1] = 0x80 | (k & 0x3f);
retval = 2;
} else if (k < 0x10000) {
buf[0] = 0xe0 | (k >... | @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,843 | static inline int process_named_entity_html(const char **buf, const char **start, size_t *length)
{
*start = *buf;
/* "&" is represented by a 0x26 in all supported encodings. That means
* the byte after represents a character or is the leading byte of an
* sequence of 8-bit code units. If in the ranges below, it... | DoS Overflow | 0 | static inline int process_named_entity_html(const char **buf, const char **start, size_t *length)
{
*start = *buf;
/* "&" is represented by a 0x26 in all supported encodings. That means
* the byte after represents a character or is the leading byte of an
* sequence of 8-bit code units. If in the ranges below, it... | @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,844 | static inline int resolve_named_entity_html(const char *start, size_t length, const entity_ht *ht, unsigned *uni_cp1, unsigned *uni_cp2)
{
const entity_cp_map *s;
ulong hash = zend_inline_hash_func(start, length);
s = ht->buckets[hash % ht->num_elems];
while (s->entity) {
if (s->entity_len == length) {
if (me... | DoS Overflow | 0 | static inline int resolve_named_entity_html(const char *start, size_t length, const entity_ht *ht, unsigned *uni_cp1, unsigned *uni_cp2)
{
const entity_cp_map *s;
ulong hash = zend_inline_hash_func(start, length);
s = ht->buckets[hash % ht->num_elems];
while (s->entity) {
if (s->entity_len == length) {
if (me... | @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,845 | static inline size_t write_octet_sequence(unsigned char *buf, enum entity_charset charset, unsigned code) {
/* code is not necessarily a unicode code point */
switch (charset) {
case cs_utf_8:
return php_utf32_utf8(buf, code);
case cs_8859_1:
case cs_cp1252:
case cs_8859_15:
case cs_koi8r:
case cs_cp1251:
c... | DoS Overflow | 0 | static inline size_t write_octet_sequence(unsigned char *buf, enum entity_charset charset, unsigned code) {
/* code is not necessarily a unicode code point */
switch (charset) {
case cs_utf_8:
return php_utf32_utf8(buf, code);
case cs_8859_1:
case cs_cp1252:
case cs_8859_15:
case cs_koi8r:
case cs_cp1251:
c... | @@ -163,7 +163,7 @@ static inline unsigned int get_next_char(
else
MB_FAILURE(pos, 4);
}
-
+
this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f);
if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or o... | CWE-190 | null | null |
41,846 | PHP_FUNCTION(locale_canonicalize)
{
get_icu_value_src_php( LOC_CANONICALIZE_TAG , INTERNAL_FUNCTION_PARAM_PASSTHRU );
}
| DoS | 0 | PHP_FUNCTION(locale_canonicalize)
{
get_icu_value_src_php( LOC_CANONICALIZE_TAG , INTERNAL_FUNCTION_PARAM_PASSTHRU );
}
| @@ -65,26 +65,26 @@ ZEND_EXTERN_MODULE_GLOBALS( intl )
*/
static const char * const LOC_GRANDFATHERED[] = {
"art-lojban", "i-klingon", "i-lux", "i-navajo", "no-bok", "no-nyn",
- "cel-gaulish", "en-GB-oed", "i-ami",
- "i-bnn", "i-default", "i-enochian",
- "i-mingo", "i-pwn", "i-tao",
+ "cel-gaulish... | CWE-125 | null | null |
41,847 | PHP_FUNCTION(locale_parse)
{
const char* loc_name = NULL;
int loc_name_len = 0;
int grOffset = 0;
intl_error_reset( NULL TSRMLS_CC );
if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
&loc_name, &loc_name_len ) == FAILURE)
{
intl_error_set... | DoS | 0 | PHP_FUNCTION(locale_parse)
{
const char* loc_name = NULL;
int loc_name_len = 0;
int grOffset = 0;
intl_error_reset( NULL TSRMLS_CC );
if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
&loc_name, &loc_name_len ) == FAILURE)
{
intl_error_set... | @@ -65,26 +65,26 @@ ZEND_EXTERN_MODULE_GLOBALS( intl )
*/
static const char * const LOC_GRANDFATHERED[] = {
"art-lojban", "i-klingon", "i-lux", "i-navajo", "no-bok", "no-nyn",
- "cel-gaulish", "en-GB-oed", "i-ami",
- "i-bnn", "i-default", "i-enochian",
- "i-mingo", "i-pwn", "i-tao",
+ "cel-gaulish... | CWE-125 | null | null |
41,848 | static void add_prefix(smart_str* loc_name, char* key_name)
{
if( strncmp(key_name , LOC_PRIVATE_TAG , 7) == 0 ){
smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1);
smart_str_appendl(loc_name, PRIVATE_PREFIX , sizeof(PRIVATE_PREFIX)-1);
}
}
| DoS | 0 | static void add_prefix(smart_str* loc_name, char* key_name)
{
if( strncmp(key_name , LOC_PRIVATE_TAG , 7) == 0 ){
smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1);
smart_str_appendl(loc_name, PRIVATE_PREFIX , sizeof(PRIVATE_PREFIX)-1);
}
}
| @@ -65,26 +65,26 @@ ZEND_EXTERN_MODULE_GLOBALS( intl )
*/
static const char * const LOC_GRANDFATHERED[] = {
"art-lojban", "i-klingon", "i-lux", "i-navajo", "no-bok", "no-nyn",
- "cel-gaulish", "en-GB-oed", "i-ami",
- "i-bnn", "i-default", "i-enochian",
- "i-mingo", "i-pwn", "i-tao",
+ "cel-gaulish... | CWE-125 | null | null |
41,849 | static int strToMatch(const char* str ,char *retstr)
{
char* anchor = NULL;
const char* anchor1 = NULL;
int result = 0;
if( (!str) || str[0] == '\0'){
return result;
} else {
anchor = retstr;
anchor1 = str;
while( (*str)!='\0' ){
if( *str == '-' ){
*retstr = '_';
} else {
*... | DoS | 0 | static int strToMatch(const char* str ,char *retstr)
{
char* anchor = NULL;
const char* anchor1 = NULL;
int result = 0;
if( (!str) || str[0] == '\0'){
return result;
} else {
anchor = retstr;
anchor1 = str;
while( (*str)!='\0' ){
if( *str == '-' ){
*retstr = '_';
} else {
*... | @@ -65,26 +65,26 @@ ZEND_EXTERN_MODULE_GLOBALS( intl )
*/
static const char * const LOC_GRANDFATHERED[] = {
"art-lojban", "i-klingon", "i-lux", "i-navajo", "no-bok", "no-nyn",
- "cel-gaulish", "en-GB-oed", "i-ami",
- "i-bnn", "i-default", "i-enochian",
- "i-mingo", "i-pwn", "i-tao",
+ "cel-gaulish... | CWE-125 | null | null |
41,850 | static void __arpt_unregister_table(struct xt_table *table)
{
struct xt_table_info *private;
void *loc_cpu_entry;
struct module *table_owner = table->me;
struct arpt_entry *iter;
private = xt_unregister_table(table);
/* Decrease module usage counts and free resources */
loc_cpu_entry = private->entries;
xt_en... | DoS Overflow +Info | 0 | static void __arpt_unregister_table(struct xt_table *table)
{
struct xt_table_info *private;
void *loc_cpu_entry;
struct module *table_owner = table->me;
struct arpt_entry *iter;
private = xt_unregister_table(table);
/* Decrease module usage counts and free resources */
loc_cpu_entry = private->entries;
xt_en... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,851 | static inline int arp_checkentry(const struct arpt_arp *arp)
{
if (arp->flags & ~ARPT_F_MASK) {
duprintf("Unknown flag bits set: %08X\n",
arp->flags & ~ARPT_F_MASK);
return 0;
}
if (arp->invflags & ~ARPT_INV_MASK) {
duprintf("Unknown invflag bits set: %08X\n",
arp->invflags & ~ARPT_INV_MASK);
return ... | DoS Overflow +Info | 0 | static inline int arp_checkentry(const struct arpt_arp *arp)
{
if (arp->flags & ~ARPT_F_MASK) {
duprintf("Unknown flag bits set: %08X\n",
arp->flags & ~ARPT_F_MASK);
return 0;
}
if (arp->invflags & ~ARPT_INV_MASK) {
duprintf("Unknown invflag bits set: %08X\n",
arp->invflags & ~ARPT_INV_MASK);
return ... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,852 | static inline int arp_devaddr_compare(const struct arpt_devaddr_info *ap,
const char *hdr_addr, int len)
{
int i, ret;
if (len > ARPT_DEV_ADDR_LEN_MAX)
len = ARPT_DEV_ADDR_LEN_MAX;
ret = 0;
for (i = 0; i < len; i++)
ret |= (hdr_addr[i] ^ ap->addr[i]) & ap->mask[i];
return ret != 0;
}
| DoS Overflow +Info | 0 | static inline int arp_devaddr_compare(const struct arpt_devaddr_info *ap,
const char *hdr_addr, int len)
{
int i, ret;
if (len > ARPT_DEV_ADDR_LEN_MAX)
len = ARPT_DEV_ADDR_LEN_MAX;
ret = 0;
for (i = 0; i < len; i++)
ret |= (hdr_addr[i] ^ ap->addr[i]) & ap->mask[i];
return ret != 0;
}
| @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,853 | static void __exit arp_tables_fini(void)
{
nf_unregister_sockopt(&arpt_sockopts);
xt_unregister_targets(arpt_builtin_tg, ARRAY_SIZE(arpt_builtin_tg));
unregister_pernet_subsys(&arp_tables_net_ops);
}
| DoS Overflow +Info | 0 | static void __exit arp_tables_fini(void)
{
nf_unregister_sockopt(&arpt_sockopts);
xt_unregister_targets(arpt_builtin_tg, ARRAY_SIZE(arpt_builtin_tg));
unregister_pernet_subsys(&arp_tables_net_ops);
}
| @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,854 | static int __init arp_tables_init(void)
{
int ret;
ret = register_pernet_subsys(&arp_tables_net_ops);
if (ret < 0)
goto err1;
/* No one else will be downing sem now, so we won't sleep */
ret = xt_register_targets(arpt_builtin_tg, ARRAY_SIZE(arpt_builtin_tg));
if (ret < 0)
goto err2;
/* Register setsockopt... | DoS Overflow +Info | 0 | static int __init arp_tables_init(void)
{
int ret;
ret = register_pernet_subsys(&arp_tables_net_ops);
if (ret < 0)
goto err1;
/* No one else will be downing sem now, so we won't sleep */
ret = xt_register_targets(arpt_builtin_tg, ARRAY_SIZE(arpt_builtin_tg));
if (ret < 0)
goto err2;
/* Register setsockopt... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,855 | static int __net_init arp_tables_net_init(struct net *net)
{
return xt_proto_init(net, NFPROTO_ARP);
}
| DoS Overflow +Info | 0 | static int __net_init arp_tables_net_init(struct net *net)
{
return xt_proto_init(net, NFPROTO_ARP);
}
| @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,856 | void *arpt_alloc_initial_table(const struct xt_table *info)
{
return xt_alloc_initial_table(arpt, ARPT);
}
| DoS Overflow +Info | 0 | void *arpt_alloc_initial_table(const struct xt_table *info)
{
return xt_alloc_initial_table(arpt, ARPT);
}
| @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,857 | unsigned int arpt_do_table(struct sk_buff *skb,
const struct nf_hook_state *state,
struct xt_table *table)
{
unsigned int hook = state->hook;
static const char nulldevname[IFNAMSIZ] __attribute__((aligned(sizeof(long))));
unsigned int verdict = NF_DROP;
const struct arphdr *arp;
struct arpt_entry *e, *... | DoS Overflow +Info | 0 | unsigned int arpt_do_table(struct sk_buff *skb,
const struct nf_hook_state *state,
struct xt_table *table)
{
unsigned int hook = state->hook;
static const char nulldevname[IFNAMSIZ] __attribute__((aligned(sizeof(long))));
unsigned int verdict = NF_DROP;
const struct arphdr *arp;
struct arpt_entry *e, *... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,858 | arpt_error(struct sk_buff *skb, const struct xt_action_param *par)
{
net_err_ratelimited("arp_tables: error: '%s'\n",
(const char *)par->targinfo);
return NF_DROP;
}
| DoS Overflow +Info | 0 | arpt_error(struct sk_buff *skb, const struct xt_action_param *par)
{
net_err_ratelimited("arp_tables: error: '%s'\n",
(const char *)par->targinfo);
return NF_DROP;
}
| @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,859 | arpt_get_target_c(const struct arpt_entry *e)
{
return arpt_get_target((struct arpt_entry *)e);
}
| DoS Overflow +Info | 0 | arpt_get_target_c(const struct arpt_entry *e)
{
return arpt_get_target((struct arpt_entry *)e);
}
| @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,860 | struct arpt_entry *arpt_next_entry(const struct arpt_entry *entry)
{
return (void *)entry + entry->next_offset;
}
| DoS Overflow +Info | 0 | struct arpt_entry *arpt_next_entry(const struct arpt_entry *entry)
{
return (void *)entry + entry->next_offset;
}
| @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,861 | int arpt_register_table(struct net *net,
const struct xt_table *table,
const struct arpt_replace *repl,
const struct nf_hook_ops *ops,
struct xt_table **res)
{
int ret;
struct xt_table_info *newinfo;
struct xt_table_info bootstrap = {0};
void *loc_cpu_entry;
struct xt_table *new_table;
newinfo = xt_a... | DoS Overflow +Info | 0 | int arpt_register_table(struct net *net,
const struct xt_table *table,
const struct arpt_replace *repl,
const struct nf_hook_ops *ops,
struct xt_table **res)
{
int ret;
struct xt_table_info *newinfo;
struct xt_table_info bootstrap = {0};
void *loc_cpu_entry;
struct xt_table *new_table;
newinfo = xt_a... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,862 | void arpt_unregister_table(struct net *net, struct xt_table *table,
const struct nf_hook_ops *ops)
{
nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks));
__arpt_unregister_table(table);
}
| DoS Overflow +Info | 0 | void arpt_unregister_table(struct net *net, struct xt_table *table,
const struct nf_hook_ops *ops)
{
nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks));
__arpt_unregister_table(table);
}
| @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,863 | static inline int check_target(struct arpt_entry *e, const char *name)
{
struct xt_entry_target *t = arpt_get_target(e);
int ret;
struct xt_tgchk_param par = {
.table = name,
.entryinfo = e,
.target = t->u.kernel.target,
.targinfo = t->data,
.hook_mask = e->comefrom,
.family = NFPROTO_ARP,
};... | DoS Overflow +Info | 0 | static inline int check_target(struct arpt_entry *e, const char *name)
{
struct xt_entry_target *t = arpt_get_target(e);
int ret;
struct xt_tgchk_param par = {
.table = name,
.entryinfo = e,
.target = t->u.kernel.target,
.targinfo = t->data,
.hook_mask = e->comefrom,
.family = NFPROTO_ARP,
};... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,864 | static bool check_underflow(const struct arpt_entry *e)
{
const struct xt_entry_target *t;
unsigned int verdict;
if (!unconditional(&e->arp))
return false;
t = arpt_get_target_c(e);
if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)
return false;
verdict = ((struct xt_standard_target *)t)->verdict;
verdic... | DoS Overflow +Info | 0 | static bool check_underflow(const struct arpt_entry *e)
{
const struct xt_entry_target *t;
unsigned int verdict;
if (!unconditional(&e->arp))
return false;
t = arpt_get_target_c(e);
if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)
return false;
verdict = ((struct xt_standard_target *)t)->verdict;
verdic... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,865 | static inline void cleanup_entry(struct arpt_entry *e)
{
struct xt_tgdtor_param par;
struct xt_entry_target *t;
t = arpt_get_target(e);
par.target = t->u.kernel.target;
par.targinfo = t->data;
par.family = NFPROTO_ARP;
if (par.target->destroy != NULL)
par.target->destroy(&par);
module_put(par.target->me)... | DoS Overflow +Info | 0 | static inline void cleanup_entry(struct arpt_entry *e)
{
struct xt_tgdtor_param par;
struct xt_entry_target *t;
t = arpt_get_target(e);
par.target = t->u.kernel.target;
par.targinfo = t->data;
par.family = NFPROTO_ARP;
if (par.target->destroy != NULL)
par.target->destroy(&par);
module_put(par.target->me)... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,866 | static int compat_copy_entries_to_user(unsigned int total_size,
struct xt_table *table,
void __user *userptr)
{
struct xt_counters *counters;
const struct xt_table_info *private = table->private;
void __user *pos;
unsigned int size;
int ret = 0;
unsigned int i = 0;
struct arpt_entry *iter;
... | DoS Overflow +Info | 0 | static int compat_copy_entries_to_user(unsigned int total_size,
struct xt_table *table,
void __user *userptr)
{
struct xt_counters *counters;
const struct xt_table_info *private = table->private;
void __user *pos;
unsigned int size;
int ret = 0;
unsigned int i = 0;
struct arpt_entry *iter;
... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,867 | compat_copy_entry_from_user(struct compat_arpt_entry *e, void **dstptr,
unsigned int *size, const char *name,
struct xt_table_info *newinfo, unsigned char *base)
{
struct xt_entry_target *t;
struct xt_target *target;
struct arpt_entry *de;
unsigned int origsize;
int ret, h;
ret = 0;
origsize = *si... | DoS Overflow +Info | 0 | compat_copy_entry_from_user(struct compat_arpt_entry *e, void **dstptr,
unsigned int *size, const char *name,
struct xt_table_info *newinfo, unsigned char *base)
{
struct xt_entry_target *t;
struct xt_target *target;
struct arpt_entry *de;
unsigned int origsize;
int ret, h;
ret = 0;
origsize = *si... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,868 | static int compat_do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user,
int *len)
{
int ret;
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
return -EPERM;
switch (cmd) {
case ARPT_SO_GET_INFO:
ret = get_info(sock_net(sk), user, len, 1);
break;
case ARPT_SO_GET_ENTRIES:
ret = compat_g... | DoS Overflow +Info | 0 | static int compat_do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user,
int *len)
{
int ret;
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
return -EPERM;
switch (cmd) {
case ARPT_SO_GET_INFO:
ret = get_info(sock_net(sk), user, len, 1);
break;
case ARPT_SO_GET_ENTRIES:
ret = compat_g... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,869 | static int compat_do_arpt_set_ctl(struct sock *sk, int cmd, void __user *user,
unsigned int len)
{
int ret;
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
return -EPERM;
switch (cmd) {
case ARPT_SO_SET_REPLACE:
ret = compat_do_replace(sock_net(sk), user, len);
break;
case ARPT_SO_SET_ADD_COU... | DoS Overflow +Info | 0 | static int compat_do_arpt_set_ctl(struct sock *sk, int cmd, void __user *user,
unsigned int len)
{
int ret;
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
return -EPERM;
switch (cmd) {
case ARPT_SO_SET_REPLACE:
ret = compat_do_replace(sock_net(sk), user, len);
break;
case ARPT_SO_SET_ADD_COU... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,870 | static int compat_do_replace(struct net *net, void __user *user,
unsigned int len)
{
int ret;
struct compat_arpt_replace tmp;
struct xt_table_info *newinfo;
void *loc_cpu_entry;
struct arpt_entry *iter;
if (copy_from_user(&tmp, user, sizeof(tmp)) != 0)
return -EFAULT;
/* overflow check */
if (tmp.si... | DoS Overflow +Info | 0 | static int compat_do_replace(struct net *net, void __user *user,
unsigned int len)
{
int ret;
struct compat_arpt_replace tmp;
struct xt_table_info *newinfo;
void *loc_cpu_entry;
struct arpt_entry *iter;
if (copy_from_user(&tmp, user, sizeof(tmp)) != 0)
return -EFAULT;
/* overflow check */
if (tmp.si... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,871 | static int compat_get_entries(struct net *net,
struct compat_arpt_get_entries __user *uptr,
int *len)
{
int ret;
struct compat_arpt_get_entries get;
struct xt_table *t;
if (*len < sizeof(get)) {
duprintf("compat_get_entries: %u < %zu\n", *len, sizeof(get));
return -EINVAL;
}
if (copy_from_u... | DoS Overflow +Info | 0 | static int compat_get_entries(struct net *net,
struct compat_arpt_get_entries __user *uptr,
int *len)
{
int ret;
struct compat_arpt_get_entries get;
struct xt_table *t;
if (*len < sizeof(get)) {
duprintf("compat_get_entries: %u < %zu\n", *len, sizeof(get));
return -EINVAL;
}
if (copy_from_u... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,872 | static inline void compat_release_entry(struct compat_arpt_entry *e)
{
struct xt_entry_target *t;
t = compat_arpt_get_target(e);
module_put(t->u.kernel.target->me);
}
| DoS Overflow +Info | 0 | static inline void compat_release_entry(struct compat_arpt_entry *e)
{
struct xt_entry_target *t;
t = compat_arpt_get_target(e);
module_put(t->u.kernel.target->me);
}
| @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,873 | static void compat_standard_from_user(void *dst, const void *src)
{
int v = *(compat_int_t *)src;
if (v > 0)
v += xt_compat_calc_jump(NFPROTO_ARP, v);
memcpy(dst, &v, sizeof(v));
}
| DoS Overflow +Info | 0 | static void compat_standard_from_user(void *dst, const void *src)
{
int v = *(compat_int_t *)src;
if (v > 0)
v += xt_compat_calc_jump(NFPROTO_ARP, v);
memcpy(dst, &v, sizeof(v));
}
| @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,874 | static int compat_table_info(const struct xt_table_info *info,
struct xt_table_info *newinfo)
{
struct arpt_entry *iter;
const void *loc_cpu_entry;
int ret;
if (!newinfo || !info)
return -EINVAL;
/* we dont care about newinfo->entries */
memcpy(newinfo, info, offsetof(struct xt_table_info, entries));
... | DoS Overflow +Info | 0 | static int compat_table_info(const struct xt_table_info *info,
struct xt_table_info *newinfo)
{
struct arpt_entry *iter;
const void *loc_cpu_entry;
int ret;
if (!newinfo || !info)
return -EINVAL;
/* we dont care about newinfo->entries */
memcpy(newinfo, info, offsetof(struct xt_table_info, entries));
... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,875 | static int copy_entries_to_user(unsigned int total_size,
const struct xt_table *table,
void __user *userptr)
{
unsigned int off, num;
const struct arpt_entry *e;
struct xt_counters *counters;
struct xt_table_info *private = table->private;
int ret = 0;
void *loc_cpu_entry;
counters = alloc_counters(tabl... | DoS Overflow +Info | 0 | static int copy_entries_to_user(unsigned int total_size,
const struct xt_table *table,
void __user *userptr)
{
unsigned int off, num;
const struct arpt_entry *e;
struct xt_counters *counters;
struct xt_table_info *private = table->private;
int ret = 0;
void *loc_cpu_entry;
counters = alloc_counters(tabl... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,876 | static int do_add_counters(struct net *net, const void __user *user,
unsigned int len, int compat)
{
unsigned int i;
struct xt_counters_info tmp;
struct xt_counters *paddc;
unsigned int num_counters;
const char *name;
int size;
void *ptmp;
struct xt_table *t;
const struct xt_table_info *private;
int ret... | DoS Overflow +Info | 0 | static int do_add_counters(struct net *net, const void __user *user,
unsigned int len, int compat)
{
unsigned int i;
struct xt_counters_info tmp;
struct xt_counters *paddc;
unsigned int num_counters;
const char *name;
int size;
void *ptmp;
struct xt_table *t;
const struct xt_table_info *private;
int ret... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,877 | static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
{
int ret;
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
return -EPERM;
switch (cmd) {
case ARPT_SO_GET_INFO:
ret = get_info(sock_net(sk), user, len, 0);
break;
case ARPT_SO_GET_ENTRIES:
ret = get_entries(sock_net... | DoS Overflow +Info | 0 | static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
{
int ret;
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
return -EPERM;
switch (cmd) {
case ARPT_SO_GET_INFO:
ret = get_info(sock_net(sk), user, len, 0);
break;
case ARPT_SO_GET_ENTRIES:
ret = get_entries(sock_net... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,878 | find_check_entry(struct arpt_entry *e, const char *name, unsigned int size)
{
struct xt_entry_target *t;
struct xt_target *target;
int ret;
e->counters.pcnt = xt_percpu_counter_alloc();
if (IS_ERR_VALUE(e->counters.pcnt))
return -ENOMEM;
t = arpt_get_target(e);
target = xt_request_find_target(NFPROTO_ARP, t-... | DoS Overflow +Info | 0 | find_check_entry(struct arpt_entry *e, const char *name, unsigned int size)
{
struct xt_entry_target *t;
struct xt_target *target;
int ret;
e->counters.pcnt = xt_percpu_counter_alloc();
if (IS_ERR_VALUE(e->counters.pcnt))
return -ENOMEM;
t = arpt_get_target(e);
target = xt_request_find_target(NFPROTO_ARP, t-... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,879 | static void get_counters(const struct xt_table_info *t,
struct xt_counters counters[])
{
struct arpt_entry *iter;
unsigned int cpu;
unsigned int i;
for_each_possible_cpu(cpu) {
seqcount_t *s = &per_cpu(xt_recseq, cpu);
i = 0;
xt_entry_foreach(iter, t->entries, t->size) {
struct xt_counters *tmp;
u... | DoS Overflow +Info | 0 | static void get_counters(const struct xt_table_info *t,
struct xt_counters counters[])
{
struct arpt_entry *iter;
unsigned int cpu;
unsigned int i;
for_each_possible_cpu(cpu) {
seqcount_t *s = &per_cpu(xt_recseq, cpu);
i = 0;
xt_entry_foreach(iter, t->entries, t->size) {
struct xt_counters *tmp;
u... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,880 | static int get_entries(struct net *net, struct arpt_get_entries __user *uptr,
const int *len)
{
int ret;
struct arpt_get_entries get;
struct xt_table *t;
if (*len < sizeof(get)) {
duprintf("get_entries: %u < %Zu\n", *len, sizeof(get));
return -EINVAL;
}
if (copy_from_user(&get, uptr, sizeof(get)) !=... | DoS Overflow +Info | 0 | static int get_entries(struct net *net, struct arpt_get_entries __user *uptr,
const int *len)
{
int ret;
struct arpt_get_entries get;
struct xt_table *t;
if (*len < sizeof(get)) {
duprintf("get_entries: %u < %Zu\n", *len, sizeof(get));
return -EINVAL;
}
if (copy_from_user(&get, uptr, sizeof(get)) !=... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,881 | get_entry(const void *base, unsigned int offset)
{
return (struct arpt_entry *)(base + offset);
}
| DoS Overflow +Info | 0 | get_entry(const void *base, unsigned int offset)
{
return (struct arpt_entry *)(base + offset);
}
| @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,882 | static int get_info(struct net *net, void __user *user,
const int *len, int compat)
{
char name[XT_TABLE_MAXNAMELEN];
struct xt_table *t;
int ret;
if (*len != sizeof(struct arpt_getinfo)) {
duprintf("length %u != %Zu\n", *len,
sizeof(struct arpt_getinfo));
return -EINVAL;
}
if (copy_from_user(name... | DoS Overflow +Info | 0 | static int get_info(struct net *net, void __user *user,
const int *len, int compat)
{
char name[XT_TABLE_MAXNAMELEN];
struct xt_table *t;
int ret;
if (*len != sizeof(struct arpt_getinfo)) {
duprintf("length %u != %Zu\n", *len,
sizeof(struct arpt_getinfo));
return -EINVAL;
}
if (copy_from_user(name... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,883 | static unsigned long ifname_compare(const char *_a, const char *_b, const char *_mask)
{
#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
unsigned long ret = ifname_compare_aligned(_a, _b, _mask);
#else
unsigned long ret = 0;
const u16 *a = (const u16 *)_a;
const u16 *b = (const u16 *)_b;
const u16 *mask = (const u16... | DoS Overflow +Info | 0 | static unsigned long ifname_compare(const char *_a, const char *_b, const char *_mask)
{
#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
unsigned long ret = ifname_compare_aligned(_a, _b, _mask);
#else
unsigned long ret = 0;
const u16 *a = (const u16 *)_a;
const u16 *b = (const u16 *)_b;
const u16 *mask = (const u16... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,884 | static int mark_source_chains(const struct xt_table_info *newinfo,
unsigned int valid_hooks, void *entry0)
{
unsigned int hook;
/* No recursion; use packet counter to save back ptrs (reset
* to 0 as we leave), and comefrom to save source hook bitmask.
*/
for (hook = 0; hook < NF_ARP_NUMHOOKS; hook++) {... | DoS Overflow +Info | 0 | static int mark_source_chains(const struct xt_table_info *newinfo,
unsigned int valid_hooks, void *entry0)
{
unsigned int hook;
/* No recursion; use packet counter to save back ptrs (reset
* to 0 as we leave), and comefrom to save source hook bitmask.
*/
for (hook = 0; hook < NF_ARP_NUMHOOKS; hook++) {... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,885 | static int translate_compat_table(const char *name,
unsigned int valid_hooks,
struct xt_table_info **pinfo,
void **pentry0,
unsigned int total_size,
unsigned int number,
unsigned int *hook_entries,
unsigned int *underflows)
{
unsigned int i, j;
struct xt_table_info *newinfo, ... | DoS Overflow +Info | 0 | static int translate_compat_table(const char *name,
unsigned int valid_hooks,
struct xt_table_info **pinfo,
void **pentry0,
unsigned int total_size,
unsigned int number,
unsigned int *hook_entries,
unsigned int *underflows)
{
unsigned int i, j;
struct xt_table_info *newinfo, ... | @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,886 | static inline bool unconditional(const struct arpt_arp *arp)
{
static const struct arpt_arp uncond;
return memcmp(arp, &uncond, sizeof(uncond)) == 0;
}
| DoS Overflow +Info | 0 | static inline bool unconditional(const struct arpt_arp *arp)
{
static const struct arpt_arp uncond;
return memcmp(arp, &uncond, sizeof(uncond)) == 0;
}
| @@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
+ (unsigned char *)e +... | CWE-119 | null | null |
41,887 | __do_replace(struct net *net, const char *name, unsigned int valid_hooks,
struct xt_table_info *newinfo, unsigned int num_counters,
void __user *counters_ptr)
{
int ret;
struct xt_table *t;
struct xt_table_info *oldinfo;
struct xt_counters *counters;
struct ipt_entry *iter;
ret = 0;
counters = vzall... | DoS Overflow +Info | 0 | __do_replace(struct net *net, const char *name, unsigned int valid_hooks,
struct xt_table_info *newinfo, unsigned int num_counters,
void __user *counters_ptr)
{
int ret;
struct xt_table *t;
struct xt_table_info *oldinfo;
struct xt_counters *counters;
struct ipt_entry *iter;
ret = 0;
counters = vzall... | @@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
+ (unsigned char *)e + e->next_offset > limi... | CWE-119 | null | null |
41,888 | static void __ipt_unregister_table(struct net *net, struct xt_table *table)
{
struct xt_table_info *private;
void *loc_cpu_entry;
struct module *table_owner = table->me;
struct ipt_entry *iter;
private = xt_unregister_table(table);
/* Decrease module usage counts and free resources */
loc_cpu_entry = private->... | DoS Overflow +Info | 0 | static void __ipt_unregister_table(struct net *net, struct xt_table *table)
{
struct xt_table_info *private;
void *loc_cpu_entry;
struct module *table_owner = table->me;
struct ipt_entry *iter;
private = xt_unregister_table(table);
/* Decrease module usage counts and free resources */
loc_cpu_entry = private->... | @@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
+ (unsigned char *)e + e->next_offset > limi... | CWE-119 | null | null |
41,889 | static struct xt_counters *alloc_counters(const struct xt_table *table)
{
unsigned int countersize;
struct xt_counters *counters;
const struct xt_table_info *private = table->private;
/* We need atomic snapshot of counters: rest doesn't change
(other than comefrom, which userspace doesn't care
about). */
... | DoS Overflow +Info | 0 | static struct xt_counters *alloc_counters(const struct xt_table *table)
{
unsigned int countersize;
struct xt_counters *counters;
const struct xt_table_info *private = table->private;
/* We need atomic snapshot of counters: rest doesn't change
(other than comefrom, which userspace doesn't care
about). */
... | @@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
+ (unsigned char *)e + e->next_offset > limi... | CWE-119 | null | null |
41,890 | check_entry(const struct ipt_entry *e)
{
const struct xt_entry_target *t;
if (!ip_checkentry(&e->ip))
return -EINVAL;
if (e->target_offset + sizeof(struct xt_entry_target) >
e->next_offset)
return -EINVAL;
t = ipt_get_target_c(e);
if (e->target_offset + t->u.target_size > e->next_offset)
return -EINV... | DoS Overflow +Info | 0 | check_entry(const struct ipt_entry *e)
{
const struct xt_entry_target *t;
if (!ip_checkentry(&e->ip))
return -EINVAL;
if (e->target_offset + sizeof(struct xt_entry_target) >
e->next_offset)
return -EINVAL;
t = ipt_get_target_c(e);
if (e->target_offset + t->u.target_size > e->next_offset)
return -EINV... | @@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
+ (unsigned char *)e + e->next_offset > limi... | CWE-119 | null | null |
41,891 | static int check_target(struct ipt_entry *e, struct net *net, const char *name)
{
struct xt_entry_target *t = ipt_get_target(e);
struct xt_tgchk_param par = {
.net = net,
.table = name,
.entryinfo = e,
.target = t->u.kernel.target,
.targinfo = t->data,
.hook_mask = e->comefrom,
.family ... | DoS Overflow +Info | 0 | static int check_target(struct ipt_entry *e, struct net *net, const char *name)
{
struct xt_entry_target *t = ipt_get_target(e);
struct xt_tgchk_param par = {
.net = net,
.table = name,
.entryinfo = e,
.target = t->u.kernel.target,
.targinfo = t->data,
.hook_mask = e->comefrom,
.family ... | @@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
+ (unsigned char *)e + e->next_offset > limi... | CWE-119 | null | null |
41,892 | static bool check_underflow(const struct ipt_entry *e)
{
const struct xt_entry_target *t;
unsigned int verdict;
if (!unconditional(&e->ip))
return false;
t = ipt_get_target_c(e);
if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)
return false;
verdict = ((struct xt_standard_target *)t)->verdict;
verdict =... | DoS Overflow +Info | 0 | static bool check_underflow(const struct ipt_entry *e)
{
const struct xt_entry_target *t;
unsigned int verdict;
if (!unconditional(&e->ip))
return false;
t = ipt_get_target_c(e);
if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)
return false;
verdict = ((struct xt_standard_target *)t)->verdict;
verdict =... | @@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
+ (unsigned char *)e + e->next_offset > limi... | CWE-119 | null | null |
41,893 | cleanup_entry(struct ipt_entry *e, struct net *net)
{
struct xt_tgdtor_param par;
struct xt_entry_target *t;
struct xt_entry_match *ematch;
/* Cleanup all matches */
xt_ematch_foreach(ematch, e)
cleanup_match(ematch, net);
t = ipt_get_target(e);
par.net = net;
par.target = t->u.kernel.target;
par.ta... | DoS Overflow +Info | 0 | cleanup_entry(struct ipt_entry *e, struct net *net)
{
struct xt_tgdtor_param par;
struct xt_entry_target *t;
struct xt_entry_match *ematch;
/* Cleanup all matches */
xt_ematch_foreach(ematch, e)
cleanup_match(ematch, net);
t = ipt_get_target(e);
par.net = net;
par.target = t->u.kernel.target;
par.ta... | @@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
+ (unsigned char *)e + e->next_offset > limi... | CWE-119 | null | null |
41,894 | static int compat_calc_entry(const struct ipt_entry *e,
const struct xt_table_info *info,
const void *base, struct xt_table_info *newinfo)
{
const struct xt_entry_match *ematch;
const struct xt_entry_target *t;
unsigned int entry_offset;
int off, i, ret;
off = sizeof(struct ipt_entry) - sizeof(str... | DoS Overflow +Info | 0 | static int compat_calc_entry(const struct ipt_entry *e,
const struct xt_table_info *info,
const void *base, struct xt_table_info *newinfo)
{
const struct xt_entry_match *ematch;
const struct xt_entry_target *t;
unsigned int entry_offset;
int off, i, ret;
off = sizeof(struct ipt_entry) - sizeof(str... | @@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
+ (unsigned char *)e + e->next_offset > limi... | CWE-119 | null | null |
41,895 | compat_check_entry(struct ipt_entry *e, struct net *net, const char *name)
{
struct xt_entry_match *ematch;
struct xt_mtchk_param mtpar;
unsigned int j;
int ret = 0;
e->counters.pcnt = xt_percpu_counter_alloc();
if (IS_ERR_VALUE(e->counters.pcnt))
return -ENOMEM;
j = 0;
mtpar.net = net;
mtpar.table = n... | DoS Overflow +Info | 0 | compat_check_entry(struct ipt_entry *e, struct net *net, const char *name)
{
struct xt_entry_match *ematch;
struct xt_mtchk_param mtpar;
unsigned int j;
int ret = 0;
e->counters.pcnt = xt_percpu_counter_alloc();
if (IS_ERR_VALUE(e->counters.pcnt))
return -ENOMEM;
j = 0;
mtpar.net = net;
mtpar.table = n... | @@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
+ (unsigned char *)e + e->next_offset > limi... | CWE-119 | null | null |
41,896 | compat_copy_entries_to_user(unsigned int total_size, struct xt_table *table,
void __user *userptr)
{
struct xt_counters *counters;
const struct xt_table_info *private = table->private;
void __user *pos;
unsigned int size;
int ret = 0;
unsigned int i = 0;
struct ipt_entry *iter;
counters = alloc_counters... | DoS Overflow +Info | 0 | compat_copy_entries_to_user(unsigned int total_size, struct xt_table *table,
void __user *userptr)
{
struct xt_counters *counters;
const struct xt_table_info *private = table->private;
void __user *pos;
unsigned int size;
int ret = 0;
unsigned int i = 0;
struct ipt_entry *iter;
counters = alloc_counters... | @@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
+ (unsigned char *)e + e->next_offset > limi... | CWE-119 | null | null |
41,897 | compat_copy_entry_from_user(struct compat_ipt_entry *e, void **dstptr,
unsigned int *size, const char *name,
struct xt_table_info *newinfo, unsigned char *base)
{
struct xt_entry_target *t;
struct xt_target *target;
struct ipt_entry *de;
unsigned int origsize;
int ret, h;
struct xt_entry_match *emat... | DoS Overflow +Info | 0 | compat_copy_entry_from_user(struct compat_ipt_entry *e, void **dstptr,
unsigned int *size, const char *name,
struct xt_table_info *newinfo, unsigned char *base)
{
struct xt_entry_target *t;
struct xt_target *target;
struct ipt_entry *de;
unsigned int origsize;
int ret, h;
struct xt_entry_match *emat... | @@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
+ (unsigned char *)e + e->next_offset > limi... | CWE-119 | null | null |
41,898 | compat_copy_entry_to_user(struct ipt_entry *e, void __user **dstptr,
unsigned int *size, struct xt_counters *counters,
unsigned int i)
{
struct xt_entry_target *t;
struct compat_ipt_entry __user *ce;
u_int16_t target_offset, next_offset;
compat_uint_t origsize;
const struct xt_entry_match *ematch;
int r... | DoS Overflow +Info | 0 | compat_copy_entry_to_user(struct ipt_entry *e, void __user **dstptr,
unsigned int *size, struct xt_counters *counters,
unsigned int i)
{
struct xt_entry_target *t;
struct compat_ipt_entry __user *ce;
u_int16_t target_offset, next_offset;
compat_uint_t origsize;
const struct xt_entry_match *ematch;
int r... | @@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
+ (unsigned char *)e + e->next_offset > limi... | CWE-119 | null | null |
41,899 | compat_do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
{
int ret;
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
return -EPERM;
switch (cmd) {
case IPT_SO_GET_INFO:
ret = get_info(sock_net(sk), user, len, 1);
break;
case IPT_SO_GET_ENTRIES:
ret = compat_get_entries(sock_net(... | DoS Overflow +Info | 0 | compat_do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
{
int ret;
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
return -EPERM;
switch (cmd) {
case IPT_SO_GET_INFO:
ret = get_info(sock_net(sk), user, len, 1);
break;
case IPT_SO_GET_ENTRIES:
ret = compat_get_entries(sock_net(... | @@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
int err;
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
+ (unsigned char *)e + e->next_offset > limi... | CWE-119 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.