idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
35,300 | freeXpathObject(xmlXPathObjectPtr xpathObj)
{
int lpc, max = numXpathResults(xpathObj);
if(xpathObj == NULL) {
return;
}
for(lpc = 0; lpc < max; lpc++) {
if (xpathObj->nodesetval->nodeTab[lpc] && xpathObj->nodesetval->nodeTab[lpc]->type != XML_NAMESPACE_DECL) {
xpathObj->no... | +Priv | 0 | freeXpathObject(xmlXPathObjectPtr xpathObj)
{
int lpc, max = numXpathResults(xpathObj);
if(xpathObj == NULL) {
return;
}
for(lpc = 0; lpc < max; lpc++) {
if (xpathObj->nodesetval->nodeTab[lpc] && xpathObj->nodesetval->nodeTab[lpc]->type != XML_NAMESPACE_DECL) {
xpathObj->no... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,301 | free_xml(xmlNode * child)
{
if (child != NULL) {
xmlNode *top = NULL;
xmlDoc *doc = child->doc;
xml_private_t *p = child->_private;
if (doc != NULL) {
top = xmlDocGetRootElement(doc);
}
if (doc != NULL && top == child) {
/* Free everything */... | +Priv | 0 | free_xml(xmlNode * child)
{
if (child != NULL) {
xmlNode *top = NULL;
xmlDoc *doc = child->doc;
xml_private_t *p = child->_private;
if (doc != NULL) {
top = xmlDocGetRootElement(doc);
}
if (doc != NULL && top == child) {
/* Free everything */... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,302 | getXpathResult(xmlXPathObjectPtr xpathObj, int index)
{
xmlNode *match = NULL;
int max = numXpathResults(xpathObj);
CRM_CHECK(index >= 0, return NULL);
CRM_CHECK(xpathObj != NULL, return NULL);
if (index >= max) {
crm_err("Requested index %d of only %d items", index, max);
return N... | +Priv | 0 | getXpathResult(xmlXPathObjectPtr xpathObj, int index)
{
xmlNode *match = NULL;
int max = numXpathResults(xpathObj);
CRM_CHECK(index >= 0, return NULL);
CRM_CHECK(xpathObj != NULL, return NULL);
if (index >= max) {
crm_err("Requested index %d of only %d items", index, max);
return N... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,303 | get_schema_name(int version)
{
if (version < 0 || version >= xml_schema_max) {
return "unknown";
}
return known_schemas[version].name;
}
| +Priv | 0 | get_schema_name(int version)
{
if (version < 0 || version >= xml_schema_max) {
return "unknown";
}
return known_schemas[version].name;
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,304 | get_schema_path(const char *name, const char *file)
{
const char *base = get_schema_root();
if(file) {
return crm_strdup_printf("%s/%s", base, file);
}
return crm_strdup_printf("%s/%s.rng", base, name);
}
| +Priv | 0 | get_schema_path(const char *name, const char *file)
{
const char *base = get_schema_root();
if(file) {
return crm_strdup_printf("%s/%s", base, file);
}
return crm_strdup_printf("%s/%s.rng", base, name);
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,305 | get_schema_root(void)
{
static const char *base = NULL;
if (base == NULL) {
base = getenv("PCMK_schema_directory");
}
if (base == NULL || strlen(base) == 0) {
base = CRM_DTD_DIRECTORY;
}
return base;
}
| +Priv | 0 | get_schema_root(void)
{
static const char *base = NULL;
if (base == NULL) {
base = getenv("PCMK_schema_directory");
}
if (base == NULL || strlen(base) == 0) {
base = CRM_DTD_DIRECTORY;
}
return base;
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,306 | get_schema_version(const char *name)
{
int lpc = 0;
if(name == NULL) {
name = "none";
}
for (; lpc < xml_schema_max; lpc++) {
if (safe_str_eq(name, known_schemas[lpc].name)) {
return lpc;
}
}
return -1;
}
| +Priv | 0 | get_schema_version(const char *name)
{
int lpc = 0;
if(name == NULL) {
name = "none";
}
for (; lpc < xml_schema_max; lpc++) {
if (safe_str_eq(name, known_schemas[lpc].name)) {
return lpc;
}
}
return -1;
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,307 | get_xpath_object(const char *xpath, xmlNode * xml_obj, int error_level)
{
int max;
xmlNode *result = NULL;
xmlXPathObjectPtr xpathObj = NULL;
char *nodePath = NULL;
char *matchNodePath = NULL;
if (xpath == NULL) {
return xml_obj; /* or return NULL? */
}
xpathObj = xpath... | +Priv | 0 | get_xpath_object(const char *xpath, xmlNode * xml_obj, int error_level)
{
int max;
xmlNode *result = NULL;
xmlXPathObjectPtr xpathObj = NULL;
char *nodePath = NULL;
char *matchNodePath = NULL;
if (xpath == NULL) {
return xml_obj; /* or return NULL? */
}
xpathObj = xpath... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,308 | get_xpath_object_relative(const char *xpath, xmlNode * xml_obj, int error_level)
{
int len = 0;
xmlNode *result = NULL;
char *xpath_full = NULL;
char *xpath_prefix = NULL;
if (xml_obj == NULL || xpath == NULL) {
return NULL;
}
xpath_prefix = (char *)xmlGetNodePath(xml_obj);
len... | +Priv | 0 | get_xpath_object_relative(const char *xpath, xmlNode * xml_obj, int error_level)
{
int len = 0;
xmlNode *result = NULL;
char *xpath_full = NULL;
char *xpath_prefix = NULL;
if (xml_obj == NULL || xpath == NULL) {
return NULL;
}
xpath_prefix = (char *)xmlGetNodePath(xml_obj);
len... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,309 | hash2metafield(gpointer key, gpointer value, gpointer user_data)
{
char *crm_name = NULL;
if (key == NULL || value == NULL) {
return;
} else if (((char *)key)[0] == '#') {
return;
} else if (strstr(key, ":")) {
return;
}
crm_name = crm_meta_name(key);
hash2field(crm... | +Priv | 0 | hash2metafield(gpointer key, gpointer value, gpointer user_data)
{
char *crm_name = NULL;
if (key == NULL || value == NULL) {
return;
} else if (((char *)key)[0] == '#') {
return;
} else if (strstr(key, ":")) {
return;
}
crm_name = crm_meta_name(key);
hash2field(crm... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,310 | hash2smartfield(gpointer key, gpointer value, gpointer user_data)
{
const char *name = key;
const char *s_value = value;
xmlNode *xml_node = user_data;
if (isdigit(name[0])) {
xmlNode *tmp = create_xml_node(xml_node, XML_TAG_PARAM);
crm_xml_add(tmp, XML_NVPAIR_ATTR_NAME, name);
... | +Priv | 0 | hash2smartfield(gpointer key, gpointer value, gpointer user_data)
{
const char *name = key;
const char *s_value = value;
xmlNode *xml_node = user_data;
if (isdigit(name[0])) {
xmlNode *tmp = create_xml_node(xml_node, XML_TAG_PARAM);
crm_xml_add(tmp, XML_NVPAIR_ATTR_NAME, name);
... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,311 | in_upper_context(int depth, int context, xmlNode * xml_node)
{
if (context == 0) {
return 0;
}
if (xml_node->properties) {
return depth;
} else if (depth < context) {
xmlNode *child = NULL;
for (child = __xml_first_child(xml_node); child != NULL; child = __xml_next(chi... | +Priv | 0 | in_upper_context(int depth, int context, xmlNode * xml_node)
{
if (context == 0) {
return 0;
}
if (xml_node->properties) {
return depth;
} else if (depth < context) {
xmlNode *child = NULL;
for (child = __xml_first_child(xml_node); child != NULL; child = __xml_next(chi... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,312 | insert_prefix(int options, char **buffer, int *offset, int *max, int depth)
{
if (options & xml_log_option_formatted) {
size_t spaces = 2 * depth;
if ((*buffer) == NULL || spaces >= ((*max) - (*offset))) {
(*max) = QB_MAX(CHUNK_SIZE, (*max) * 2);
(*buffer) = realloc_safe((*b... | +Priv | 0 | insert_prefix(int options, char **buffer, int *offset, int *max, int depth)
{
if (options & xml_log_option_formatted) {
size_t spaces = 2 * depth;
if ((*buffer) == NULL || spaces >= ((*max) - (*offset))) {
(*max) = QB_MAX(CHUNK_SIZE, (*max) * 2);
(*buffer) = realloc_safe((*b... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,313 | is_config_change(xmlNode *xml)
{
GListPtr gIter = NULL;
xml_private_t *p = NULL;
xmlNode *config = first_named_child(xml, XML_CIB_TAG_CONFIGURATION);
if(config) {
p = config->_private;
}
if(p && is_set(p->flags, xpf_dirty)) {
return TRUE;
}
if(xml->doc && xml->doc->_pri... | +Priv | 0 | is_config_change(xmlNode *xml)
{
GListPtr gIter = NULL;
xml_private_t *p = NULL;
xmlNode *config = first_named_child(xml, XML_CIB_TAG_CONFIGURATION);
if(config) {
p = config->_private;
}
if(p && is_set(p->flags, xpf_dirty)) {
return TRUE;
}
if(xml->doc && xml->doc->_pri... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,314 | log_data_element(int log_level, const char *file, const char *function, int line,
const char *prefix, xmlNode * data, int depth, int options)
{
xmlNode *a_child = NULL;
char *prefix_m = NULL;
if (prefix == NULL) {
prefix = "";
}
/* Since we use the same file and line, to ... | +Priv | 0 | log_data_element(int log_level, const char *file, const char *function, int line,
const char *prefix, xmlNode * data, int depth, int options)
{
xmlNode *a_child = NULL;
char *prefix_m = NULL;
if (prefix == NULL) {
prefix = "";
}
/* Since we use the same file and line, to ... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,315 | static gboolean patch_legacy_mode(void)
{
static gboolean init = TRUE;
static gboolean legacy = FALSE;
if(init) {
init = FALSE;
legacy = daemon_option_enabled("cib", "legacy");
if(legacy) {
crm_notice("Enabled legacy mode");
}
}
return legacy;
}
| +Priv | 0 | static gboolean patch_legacy_mode(void)
{
static gboolean init = TRUE;
static gboolean legacy = FALSE;
if(init) {
init = FALSE;
legacy = daemon_option_enabled("cib", "legacy");
if(legacy) {
crm_notice("Enabled legacy mode");
}
}
return legacy;
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,316 | pcmkDeregisterNode(xmlNodePtr node)
{
__xml_private_free(node->_private);
}
| +Priv | 0 | pcmkDeregisterNode(xmlNodePtr node)
{
__xml_private_free(node->_private);
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,317 | pcmkRegisterNode(xmlNodePtr node)
{
xml_private_t *p = NULL;
switch(node->type) {
case XML_ELEMENT_NODE:
case XML_DOCUMENT_NODE:
case XML_ATTRIBUTE_NODE:
case XML_COMMENT_NODE:
p = calloc(1, sizeof(xml_private_t));
p->check = XML_PRIVATE_MAGIC;
... | +Priv | 0 | pcmkRegisterNode(xmlNodePtr node)
{
xml_private_t *p = NULL;
switch(node->type) {
case XML_ELEMENT_NODE:
case XML_DOCUMENT_NODE:
case XML_ATTRIBUTE_NODE:
case XML_COMMENT_NODE:
p = calloc(1, sizeof(xml_private_t));
p->check = XML_PRIVATE_MAGIC;
... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,318 | purge_diff_markers(xmlNode * a_node)
{
xmlNode *child = NULL;
CRM_CHECK(a_node != NULL, return);
xml_remove_prop(a_node, XML_DIFF_MARKER);
for (child = __xml_first_child(a_node); child != NULL; child = __xml_next(child)) {
purge_diff_markers(child);
}
}
| +Priv | 0 | purge_diff_markers(xmlNode * a_node)
{
xmlNode *child = NULL;
CRM_CHECK(a_node != NULL, return);
xml_remove_prop(a_node, XML_DIFF_MARKER);
for (child = __xml_first_child(a_node); child != NULL; child = __xml_next(child)) {
purge_diff_markers(child);
}
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,319 | replace_xml_child(xmlNode * parent, xmlNode * child, xmlNode * update, gboolean delete_only)
{
gboolean can_delete = FALSE;
xmlNode *child_of_child = NULL;
const char *up_id = NULL;
const char *child_id = NULL;
const char *right_val = NULL;
CRM_CHECK(child != NULL, return FALSE);
CRM_CHECK... | +Priv | 0 | replace_xml_child(xmlNode * parent, xmlNode * child, xmlNode * update, gboolean delete_only)
{
gboolean can_delete = FALSE;
xmlNode *child_of_child = NULL;
const char *up_id = NULL;
const char *child_id = NULL;
const char *right_val = NULL;
CRM_CHECK(child != NULL, return FALSE);
CRM_CHECK... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,320 | static int schema_filter(const struct dirent * a)
{
int rc = 0;
float version = 0;
if(strstr(a->d_name, "pacemaker-") != a->d_name) {
/* crm_trace("%s - wrong prefix", a->d_name); */
} else if(strstr(a->d_name, ".rng") == NULL) {
/* crm_trace("%s - wrong suffix", a->d_name); */
} ... | +Priv | 0 | static int schema_filter(const struct dirent * a)
{
int rc = 0;
float version = 0;
if(strstr(a->d_name, "pacemaker-") != a->d_name) {
/* crm_trace("%s - wrong prefix", a->d_name); */
} else if(strstr(a->d_name, ".rng") == NULL) {
/* crm_trace("%s - wrong suffix", a->d_name); */
} ... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,321 | static int schema_sort(const struct dirent ** a, const struct dirent **b)
{
int rc = 0;
float a_version = 0.0;
float b_version = 0.0;
sscanf(a[0]->d_name, "pacemaker-%f.rng", &a_version);
sscanf(b[0]->d_name, "pacemaker-%f.rng", &b_version);
if(a_version > b_version) {
rc = 1;
} el... | +Priv | 0 | static int schema_sort(const struct dirent ** a, const struct dirent **b)
{
int rc = 0;
float a_version = 0.0;
float b_version = 0.0;
sscanf(a[0]->d_name, "pacemaker-%f.rng", &a_version);
sscanf(b[0]->d_name, "pacemaker-%f.rng", &b_version);
if(a_version > b_version) {
rc = 1;
} el... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,322 | set_doc_flag(xmlNode *xml, long flag)
{
if(xml && xml->doc && xml->doc->_private){
/* During calls to xmlDocCopyNode(), xml->doc may be unset */
xml_private_t *p = xml->doc->_private;
p->flags |= flag;
/* crm_trace("Setting flag %x due to %s[@id=%s]", flag, xml->name, ID(xml)); */... | +Priv | 0 | set_doc_flag(xmlNode *xml, long flag)
{
if(xml && xml->doc && xml->doc->_private){
/* During calls to xmlDocCopyNode(), xml->doc may be unset */
xml_private_t *p = xml->doc->_private;
p->flags |= flag;
/* crm_trace("Setting flag %x due to %s[@id=%s]", flag, xml->name, ID(xml)); */... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,323 | sort_pairs(gconstpointer a, gconstpointer b)
{
int rc = 0;
const name_value_t *pair_a = a;
const name_value_t *pair_b = b;
CRM_ASSERT(a != NULL);
CRM_ASSERT(pair_a->name != NULL);
CRM_ASSERT(b != NULL);
CRM_ASSERT(pair_b->name != NULL);
rc = strcmp(pair_a->name, pair_b->name);
if ... | +Priv | 0 | sort_pairs(gconstpointer a, gconstpointer b)
{
int rc = 0;
const name_value_t *pair_a = a;
const name_value_t *pair_b = b;
CRM_ASSERT(a != NULL);
CRM_ASSERT(pair_a->name != NULL);
CRM_ASSERT(b != NULL);
CRM_ASSERT(pair_b->name != NULL);
rc = strcmp(pair_a->name, pair_b->name);
if ... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,324 | sorted_xml(xmlNode * input, xmlNode * parent, gboolean recursive)
{
xmlNode *child = NULL;
GListPtr sorted = NULL;
GListPtr unsorted = NULL;
name_value_t *pair = NULL;
xmlNode *result = NULL;
const char *name = NULL;
xmlAttrPtr pIter = NULL;
CRM_CHECK(input != NULL, return NULL);
n... | +Priv | 0 | sorted_xml(xmlNode * input, xmlNode * parent, gboolean recursive)
{
xmlNode *child = NULL;
GListPtr sorted = NULL;
GListPtr unsorted = NULL;
name_value_t *pair = NULL;
xmlNode *result = NULL;
const char *name = NULL;
xmlAttrPtr pIter = NULL;
CRM_CHECK(input != NULL, return NULL);
n... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,325 | stdin2xml(void)
{
size_t data_length = 0;
size_t read_chars = 0;
char *xml_buffer = NULL;
xmlNode *xml_obj = NULL;
do {
size_t next = XML_BUFFER_SIZE + data_length + 1;
if(next <= 0) {
crm_err("Buffer size exceeded at: %l + %d", data_length, XML_BUFFER_SIZE);
... | +Priv | 0 | stdin2xml(void)
{
size_t data_length = 0;
size_t read_chars = 0;
char *xml_buffer = NULL;
xmlNode *xml_obj = NULL;
do {
size_t next = XML_BUFFER_SIZE + data_length + 1;
if(next <= 0) {
crm_err("Buffer size exceeded at: %l + %d", data_length, XML_BUFFER_SIZE);
... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,326 | string2xml(const char *input)
{
xmlNode *xml = NULL;
xmlDocPtr output = NULL;
xmlParserCtxtPtr ctxt = NULL;
xmlErrorPtr last_error = NULL;
if (input == NULL) {
crm_err("Can't parse NULL input");
return NULL;
}
/* create a parser context */
ctxt = xmlNewParserCtxt();
... | +Priv | 0 | string2xml(const char *input)
{
xmlNode *xml = NULL;
xmlDocPtr output = NULL;
xmlParserCtxtPtr ctxt = NULL;
xmlErrorPtr last_error = NULL;
if (input == NULL) {
crm_err("Can't parse NULL input");
return NULL;
}
/* create a parser context */
ctxt = xmlNewParserCtxt();
... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,327 | subtract_xml_object(xmlNode * parent, xmlNode * left, xmlNode * right,
gboolean full, gboolean * changed, const char *marker)
{
gboolean dummy = FALSE;
gboolean skip = FALSE;
xmlNode *diff = NULL;
xmlNode *right_child = NULL;
xmlNode *left_child = NULL;
xmlAttrPtr xIter = NUL... | +Priv | 0 | subtract_xml_object(xmlNode * parent, xmlNode * left, xmlNode * right,
gboolean full, gboolean * changed, const char *marker)
{
gboolean dummy = FALSE;
gboolean skip = FALSE;
xmlNode *diff = NULL;
xmlNode *right_child = NULL;
xmlNode *left_child = NULL;
xmlAttrPtr xIter = NUL... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,328 | update_validation(xmlNode ** xml_blob, int *best, int max, gboolean transform, gboolean to_logs)
{
xmlNode *xml = NULL;
char *value = NULL;
int max_stable_schemas = xml_latest_schema_index();
int lpc = 0, match = -1, rc = pcmk_ok;
CRM_CHECK(best != NULL, return -EINVAL);
CRM_CHECK(xml_blob != N... | +Priv | 0 | update_validation(xmlNode ** xml_blob, int *best, int max, gboolean transform, gboolean to_logs)
{
xmlNode *xml = NULL;
char *value = NULL;
int max_stable_schemas = xml_latest_schema_index();
int lpc = 0, match = -1, rc = pcmk_ok;
CRM_CHECK(best != NULL, return -EINVAL);
CRM_CHECK(xml_blob != N... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,329 | update_xml_child(xmlNode * child, xmlNode * to_update)
{
gboolean can_update = TRUE;
xmlNode *child_of_child = NULL;
CRM_CHECK(child != NULL, return FALSE);
CRM_CHECK(to_update != NULL, return FALSE);
if (safe_str_neq(crm_element_name(to_update), crm_element_name(child))) {
can_update = FA... | +Priv | 0 | update_xml_child(xmlNode * child, xmlNode * to_update)
{
gboolean can_update = TRUE;
xmlNode *child_of_child = NULL;
CRM_CHECK(child != NULL, return FALSE);
CRM_CHECK(to_update != NULL, return FALSE);
if (safe_str_neq(crm_element_name(to_update), crm_element_name(child))) {
can_update = FA... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,330 | validate_with(xmlNode * xml, int method, gboolean to_logs)
{
xmlDocPtr doc = NULL;
gboolean valid = FALSE;
int type = 0;
char *file = NULL;
if(method < 0) {
return FALSE;
}
type = known_schemas[method].type;
if(type == 0) {
return TRUE;
}
CRM_CHECK(xml != NULL,... | +Priv | 0 | validate_with(xmlNode * xml, int method, gboolean to_logs)
{
xmlDocPtr doc = NULL;
gboolean valid = FALSE;
int type = 0;
char *file = NULL;
if(method < 0) {
return FALSE;
}
type = known_schemas[method].type;
if(type == 0) {
return TRUE;
}
CRM_CHECK(xml != NULL,... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,331 | validate_with_dtd(xmlDocPtr doc, gboolean to_logs, const char *dtd_file)
{
gboolean valid = TRUE;
xmlDtdPtr dtd = NULL;
xmlValidCtxtPtr cvp = NULL;
CRM_CHECK(doc != NULL, return FALSE);
CRM_CHECK(dtd_file != NULL, return FALSE);
dtd = xmlParseDTD(NULL, (const xmlChar *)dtd_file);
if(dtd =... | +Priv | 0 | validate_with_dtd(xmlDocPtr doc, gboolean to_logs, const char *dtd_file)
{
gboolean valid = TRUE;
xmlDtdPtr dtd = NULL;
xmlValidCtxtPtr cvp = NULL;
CRM_CHECK(doc != NULL, return FALSE);
CRM_CHECK(dtd_file != NULL, return FALSE);
dtd = xmlParseDTD(NULL, (const xmlChar *)dtd_file);
if(dtd =... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,332 | validate_with_relaxng(xmlDocPtr doc, gboolean to_logs, const char *relaxng_file,
relaxng_ctx_cache_t ** cached_ctx)
{
int rc = 0;
gboolean valid = TRUE;
relaxng_ctx_cache_t *ctx = NULL;
CRM_CHECK(doc != NULL, return FALSE);
CRM_CHECK(relaxng_file != NULL, return FALSE);
i... | +Priv | 0 | validate_with_relaxng(xmlDocPtr doc, gboolean to_logs, const char *relaxng_file,
relaxng_ctx_cache_t ** cached_ctx)
{
int rc = 0;
gboolean valid = TRUE;
relaxng_ctx_cache_t *ctx = NULL;
CRM_CHECK(doc != NULL, return FALSE);
CRM_CHECK(relaxng_file != NULL, return FALSE);
i... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,333 | validate_xml(xmlNode * xml_blob, const char *validation, gboolean to_logs)
{
int version = 0;
if (validation == NULL) {
validation = crm_element_value(xml_blob, XML_ATTR_VALIDATION);
}
if (validation == NULL) {
int lpc = 0;
bool valid = FALSE;
validation = crm_element_... | +Priv | 0 | validate_xml(xmlNode * xml_blob, const char *validation, gboolean to_logs)
{
int version = 0;
if (validation == NULL) {
validation = crm_element_value(xml_blob, XML_ATTR_VALIDATION);
}
if (validation == NULL) {
int lpc = 0;
bool valid = FALSE;
validation = crm_element_... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,334 | validate_xml_verbose(xmlNode * xml_blob)
{
int fd = 0;
xmlDoc *doc = NULL;
xmlNode *xml = NULL;
gboolean rc = FALSE;
char *filename = strdup(CRM_STATE_DIR "/cib-invalid.XXXXXX");
umask(S_IWGRP | S_IWOTH | S_IROTH);
fd = mkstemp(filename);
write_xml_fd(xml_blob, filename, fd, FALSE);
... | +Priv | 0 | validate_xml_verbose(xmlNode * xml_blob)
{
int fd = 0;
xmlDoc *doc = NULL;
xmlNode *xml = NULL;
gboolean rc = FALSE;
char *filename = strdup(CRM_STATE_DIR "/cib-invalid.XXXXXX");
umask(S_IWGRP | S_IWOTH | S_IROTH);
fd = mkstemp(filename);
write_xml_fd(xml_blob, filename, fd, FALSE);
... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,335 | write_xml_stream(xmlNode * xml_node, const char *filename, FILE * stream, gboolean compress)
{
int res = 0;
char *buffer = NULL;
unsigned int out = 0;
CRM_CHECK(stream != NULL, return -1);
crm_trace("Writing XML out to %s", filename);
if (xml_node == NULL) {
crm_err("Cannot write NULL ... | +Priv | 0 | write_xml_stream(xmlNode * xml_node, const char *filename, FILE * stream, gboolean compress)
{
int res = 0;
char *buffer = NULL;
unsigned int out = 0;
CRM_CHECK(stream != NULL, return -1);
crm_trace("Writing XML out to %s", filename);
if (xml_node == NULL) {
crm_err("Cannot write NULL ... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,336 | xml2list(xmlNode * parent)
{
xmlNode *child = NULL;
xmlAttrPtr pIter = NULL;
xmlNode *nvpair_list = NULL;
GHashTable *nvpair_hash = g_hash_table_new_full(crm_str_hash, g_str_equal,
g_hash_destroy_str, g_hash_destroy_str);
CRM_CHECK(parent != NULL,... | +Priv | 0 | xml2list(xmlNode * parent)
{
xmlNode *child = NULL;
xmlAttrPtr pIter = NULL;
xmlNode *nvpair_list = NULL;
GHashTable *nvpair_hash = g_hash_table_new_full(crm_str_hash, g_str_equal,
g_hash_destroy_str, g_hash_destroy_str);
CRM_CHECK(parent != NULL,... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,337 | xml_acl_denied(xmlNode *xml)
{
if(xml && xml->doc && xml->doc->_private){
xml_private_t *p = xml->doc->_private;
return is_set(p->flags, xpf_acl_denied);
}
return FALSE;
}
| +Priv | 0 | xml_acl_denied(xmlNode *xml)
{
if(xml && xml->doc && xml->doc->_private){
xml_private_t *p = xml->doc->_private;
return is_set(p->flags, xpf_acl_denied);
}
return FALSE;
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,338 | xml_acl_disable(xmlNode *xml)
{
if(xml_acl_enabled(xml)) {
xml_private_t *p = xml->doc->_private;
/* Catch anything that was created but shouldn't have been */
__xml_acl_apply(xml);
__xml_acl_post_process(xml);
clear_bit(p->flags, xpf_acl_enabled);
}
}
| +Priv | 0 | xml_acl_disable(xmlNode *xml)
{
if(xml_acl_enabled(xml)) {
xml_private_t *p = xml->doc->_private;
/* Catch anything that was created but shouldn't have been */
__xml_acl_apply(xml);
__xml_acl_post_process(xml);
clear_bit(p->flags, xpf_acl_enabled);
}
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,339 | xml_acl_enabled(xmlNode *xml)
{
if(xml && xml->doc && xml->doc->_private){
xml_private_t *p = xml->doc->_private;
return is_set(p->flags, xpf_acl_enabled);
}
return FALSE;
}
| +Priv | 0 | xml_acl_enabled(xmlNode *xml)
{
if(xml && xml->doc && xml->doc->_private){
xml_private_t *p = xml->doc->_private;
return is_set(p->flags, xpf_acl_enabled);
}
return FALSE;
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,340 | xml_acl_filtered_copy(const char *user, xmlNode* acl_source, xmlNode *xml, xmlNode ** result)
{
GListPtr aIter = NULL;
xmlNode *target = NULL;
xml_private_t *p = NULL;
xml_private_t *doc = NULL;
*result = NULL;
if(xml == NULL || pcmk_acl_required(user) == FALSE) {
crm_trace("no acls nee... | +Priv | 0 | xml_acl_filtered_copy(const char *user, xmlNode* acl_source, xmlNode *xml, xmlNode ** result)
{
GListPtr aIter = NULL;
xmlNode *target = NULL;
xml_private_t *p = NULL;
xml_private_t *doc = NULL;
*result = NULL;
if(xml == NULL || pcmk_acl_required(user) == FALSE) {
crm_trace("no acls nee... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,341 | xml_apply_patchset(xmlNode *xml, xmlNode *patchset, bool check_version)
{
int format = 1;
int rc = pcmk_ok;
xmlNode *old = NULL;
const char *digest = crm_element_value(patchset, XML_ATTR_DIGEST);
if(patchset == NULL) {
return rc;
}
xml_log_patchset(LOG_TRACE, __FUNCTION__, patchse... | +Priv | 0 | xml_apply_patchset(xmlNode *xml, xmlNode *patchset, bool check_version)
{
int format = 1;
int rc = pcmk_ok;
xmlNode *old = NULL;
const char *digest = crm_element_value(patchset, XML_ATTR_DIGEST);
if(patchset == NULL) {
return rc;
}
xml_log_patchset(LOG_TRACE, __FUNCTION__, patchse... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,342 | xml_apply_patchset_v2(xmlNode *xml, xmlNode *patchset, bool check_version)
{
int rc = pcmk_ok;
xmlNode *change = NULL;
for (change = __xml_first_child(patchset); change != NULL; change = __xml_next(change)) {
xmlNode *match = NULL;
const char *op = crm_element_value(change, XML_DIFF_OP);
... | +Priv | 0 | xml_apply_patchset_v2(xmlNode *xml, xmlNode *patchset, bool check_version)
{
int rc = pcmk_ok;
xmlNode *change = NULL;
for (change = __xml_first_child(patchset); change != NULL; change = __xml_next(change)) {
xmlNode *match = NULL;
const char *op = crm_element_value(change, XML_DIFF_OP);
... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,343 | xml_calculate_changes(xmlNode * old, xmlNode * new)
{
CRM_CHECK(safe_str_eq(crm_element_name(old), crm_element_name(new)), return);
CRM_CHECK(safe_str_eq(ID(old), ID(new)), return);
if(xml_tracking_changes(new) == FALSE) {
xml_track_changes(new, NULL, NULL, FALSE);
}
__xml_diff_object(old,... | +Priv | 0 | xml_calculate_changes(xmlNode * old, xmlNode * new)
{
CRM_CHECK(safe_str_eq(crm_element_name(old), crm_element_name(new)), return);
CRM_CHECK(safe_str_eq(ID(old), ID(new)), return);
if(xml_tracking_changes(new) == FALSE) {
xml_track_changes(new, NULL, NULL, FALSE);
}
__xml_diff_object(old,... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,344 | xml_create_patchset(int format, xmlNode *source, xmlNode *target, bool *config_changed, bool manage_version, bool with_digest)
{
int counter = 0;
bool config = FALSE;
xmlNode *patch = NULL;
const char *version = crm_element_value(source, XML_ATTR_CRM_VERSION);
xml_acl_disable(target);
if(xml_do... | +Priv | 0 | xml_create_patchset(int format, xmlNode *source, xmlNode *target, bool *config_changed, bool manage_version, bool with_digest)
{
int counter = 0;
bool config = FALSE;
xmlNode *patch = NULL;
const char *version = crm_element_value(source, XML_ATTR_CRM_VERSION);
xml_acl_disable(target);
if(xml_do... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,345 | xml_create_patchset_v1(xmlNode *source, xmlNode *target, bool config, bool with_digest)
{
xmlNode *patchset = diff_xml_object(source, target, !with_digest);
if(patchset) {
CRM_LOG_ASSERT(xml_document_dirty(target));
xml_repair_v1_diff(source, target, patchset, config);
crm_xml_add(patch... | +Priv | 0 | xml_create_patchset_v1(xmlNode *source, xmlNode *target, bool config, bool with_digest)
{
xmlNode *patchset = diff_xml_object(source, target, !with_digest);
if(patchset) {
CRM_LOG_ASSERT(xml_document_dirty(target));
xml_repair_v1_diff(source, target, patchset, config);
crm_xml_add(patch... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,346 | bool xml_document_dirty(xmlNode *xml)
{
if(xml != NULL && xml->doc && xml->doc->_private) {
xml_private_t *doc = xml->doc->_private;
return is_set(doc->flags, xpf_dirty);
}
return FALSE;
}
| +Priv | 0 | bool xml_document_dirty(xmlNode *xml)
{
if(xml != NULL && xml->doc && xml->doc->_private) {
xml_private_t *doc = xml->doc->_private;
return is_set(doc->flags, xpf_dirty);
}
return FALSE;
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,347 | xml_get_path(xmlNode *xml)
{
int offset = 0;
char buffer[XML_BUFFER_SIZE];
if(__get_prefix(NULL, xml, buffer, offset) > 0) {
return strdup(buffer);
}
return NULL;
}
| +Priv | 0 | xml_get_path(xmlNode *xml)
{
int offset = 0;
char buffer[XML_BUFFER_SIZE];
if(__get_prefix(NULL, xml, buffer, offset) > 0) {
return strdup(buffer);
}
return NULL;
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,348 | xml_latest_schema(void)
{
return get_schema_name(xml_latest_schema_index());
}
| +Priv | 0 | xml_latest_schema(void)
{
return get_schema_name(xml_latest_schema_index());
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,349 | xml_latest_schema_index(void)
{
return xml_schema_max - 4;
}
| +Priv | 0 | xml_latest_schema_index(void)
{
return xml_schema_max - 4;
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,350 | xml_log_changes(uint8_t log_level, const char *function, xmlNode * xml)
{
GListPtr gIter = NULL;
xml_private_t *doc = NULL;
CRM_ASSERT(xml);
CRM_ASSERT(xml->doc);
doc = xml->doc->_private;
if(is_not_set(doc->flags, xpf_dirty)) {
return;
}
for(gIter = doc->deleted_paths; gIter;... | +Priv | 0 | xml_log_changes(uint8_t log_level, const char *function, xmlNode * xml)
{
GListPtr gIter = NULL;
xml_private_t *doc = NULL;
CRM_ASSERT(xml);
CRM_ASSERT(xml->doc);
doc = xml->doc->_private;
if(is_not_set(doc->flags, xpf_dirty)) {
return;
}
for(gIter = doc->deleted_paths; gIter;... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,351 | xml_log_patchset(uint8_t log_level, const char *function, xmlNode * patchset)
{
int format = 1;
xmlNode *child = NULL;
xmlNode *added = NULL;
xmlNode *removed = NULL;
gboolean is_first = TRUE;
int add[] = { 0, 0, 0 };
int del[] = { 0, 0, 0 };
const char *fmt = NULL;
const char *dig... | +Priv | 0 | xml_log_patchset(uint8_t log_level, const char *function, xmlNode * patchset)
{
int format = 1;
xmlNode *child = NULL;
xmlNode *added = NULL;
xmlNode *removed = NULL;
gboolean is_first = TRUE;
int add[] = { 0, 0, 0 };
int del[] = { 0, 0, 0 };
const char *fmt = NULL;
const char *dig... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,352 | xml_patch_version_check(xmlNode *xml, xmlNode *patchset, int format)
{
int lpc = 0;
bool changed = FALSE;
int this[] = { 0, 0, 0 };
int add[] = { 0, 0, 0 };
int del[] = { 0, 0, 0 };
const char *vfields[] = {
XML_ATTR_GENERATION_ADMIN,
XML_ATTR_GENERATION,
XML_ATTR_NUMU... | +Priv | 0 | xml_patch_version_check(xmlNode *xml, xmlNode *patchset, int format)
{
int lpc = 0;
bool changed = FALSE;
int this[] = { 0, 0, 0 };
int add[] = { 0, 0, 0 };
int del[] = { 0, 0, 0 };
const char *vfields[] = {
XML_ATTR_GENERATION_ADMIN,
XML_ATTR_GENERATION,
XML_ATTR_NUMU... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,353 | bool xml_patch_versions(xmlNode *patchset, int add[3], int del[3])
{
int lpc = 0;
int format = 1;
xmlNode *tmp = NULL;
const char *vfields[] = {
XML_ATTR_GENERATION_ADMIN,
XML_ATTR_GENERATION,
XML_ATTR_NUMUPDATES,
};
crm_element_value_int(patchset, "format", &format);
... | +Priv | 0 | bool xml_patch_versions(xmlNode *patchset, int add[3], int del[3])
{
int lpc = 0;
int format = 1;
xmlNode *tmp = NULL;
const char *vfields[] = {
XML_ATTR_GENERATION_ADMIN,
XML_ATTR_GENERATION,
XML_ATTR_NUMUPDATES,
};
crm_element_value_int(patchset, "format", &format);
... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,354 | xml_remove_prop(xmlNode * obj, const char *name)
{
if(__xml_acl_check(obj, NULL, xpf_acl_write) == FALSE) {
crm_trace("Cannot remove %s from %s", name, obj->name);
} else if(TRACKING_CHANGES(obj)) {
/* Leave in place (marked for removal) until after the diff is calculated */
xml_private... | +Priv | 0 | xml_remove_prop(xmlNode * obj, const char *name)
{
if(__xml_acl_check(obj, NULL, xpf_acl_write) == FALSE) {
crm_trace("Cannot remove %s from %s", name, obj->name);
} else if(TRACKING_CHANGES(obj)) {
/* Leave in place (marked for removal) until after the diff is calculated */
xml_private... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,355 | xml_track_changes(xmlNode * xml, const char *user, xmlNode *acl_source, bool enforce_acls)
{
xml_accept_changes(xml);
crm_trace("Tracking changes%s to %p", enforce_acls?" with ACLs":"", xml);
set_doc_flag(xml, xpf_tracking);
if(enforce_acls) {
if(acl_source == NULL) {
acl_source = x... | +Priv | 0 | xml_track_changes(xmlNode * xml, const char *user, xmlNode *acl_source, bool enforce_acls)
{
xml_accept_changes(xml);
crm_trace("Tracking changes%s to %p", enforce_acls?" with ACLs":"", xml);
set_doc_flag(xml, xpf_tracking);
if(enforce_acls) {
if(acl_source == NULL) {
acl_source = x... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,356 | bool xml_tracking_changes(xmlNode * xml)
{
if(xml == NULL) {
return FALSE;
} else if(is_set(((xml_private_t *)xml->doc->_private)->flags, xpf_tracking)) {
return TRUE;
}
return FALSE;
}
| +Priv | 0 | bool xml_tracking_changes(xmlNode * xml)
{
if(xml == NULL) {
return FALSE;
} else if(is_set(((xml_private_t *)xml->doc->_private)->flags, xpf_tracking)) {
return TRUE;
}
return FALSE;
}
| @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,357 | xpath_search(xmlNode * xml_top, const char *path)
{
xmlDocPtr doc = NULL;
xmlXPathObjectPtr xpathObj = NULL;
xmlXPathContextPtr xpathCtx = NULL;
const xmlChar *xpathExpr = (const xmlChar *)path;
CRM_CHECK(path != NULL, return NULL);
CRM_CHECK(xml_top != NULL, return NULL);
CRM_CHECK(strlen(... | +Priv | 0 | xpath_search(xmlNode * xml_top, const char *path)
{
xmlDocPtr doc = NULL;
xmlXPathObjectPtr xpathObj = NULL;
xmlXPathContextPtr xpathCtx = NULL;
const xmlChar *xpathExpr = (const xmlChar *)path;
CRM_CHECK(path != NULL, return NULL);
CRM_CHECK(xml_top != NULL, return NULL);
CRM_CHECK(strlen(... | @@ -1020,13 +1020,16 @@ __xml_acl_post_process(xmlNode * xml)
if(is_set(p->flags, xpf_created)) {
xmlAttr *xIter = NULL;
+ char *path = xml_get_path(xml);
- /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
+ /* Always allow new scaffolding, ie. node ... | CWE-264 | null | null |
35,358 | SYSCALL_DEFINE1(pipe, int __user *, fildes)
{
return sys_pipe2(fildes, 0);
}
| DoS +Priv | 0 | SYSCALL_DEFINE1(pipe, int __user *, fildes)
{
return sys_pipe2(fildes, 0);
}
| @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,359 | SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
{
struct file *files[2];
int fd[2];
int error;
error = __do_pipe_flags(fd, files, flags);
if (!error) {
if (unlikely(copy_to_user(fildes, fd, sizeof(fd)))) {
fput(files[0]);
fput(files[1]);
put_unused_fd(fd[0]);
put_unused_fd(fd[1]);
error ... | DoS +Priv | 0 | SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
{
struct file *files[2];
int fd[2];
int error;
error = __do_pipe_flags(fd, files, flags);
if (!error) {
if (unlikely(copy_to_user(fildes, fd, sizeof(fd)))) {
fput(files[0]);
fput(files[1]);
put_unused_fd(fd[0]);
put_unused_fd(fd[1]);
error ... | @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,360 | static int __do_pipe_flags(int *fd, struct file **files, int flags)
{
int error;
int fdw, fdr;
if (flags & ~(O_CLOEXEC | O_NONBLOCK | O_DIRECT))
return -EINVAL;
error = create_pipe_files(files, flags);
if (error)
return error;
error = get_unused_fd_flags(flags);
if (error < 0)
goto err_read_pipe;
fdr =... | DoS +Priv | 0 | static int __do_pipe_flags(int *fd, struct file **files, int flags)
{
int error;
int fdw, fdr;
if (flags & ~(O_CLOEXEC | O_NONBLOCK | O_DIRECT))
return -EINVAL;
error = create_pipe_files(files, flags);
if (error)
return error;
error = get_unused_fd_flags(flags);
if (error < 0)
goto err_read_pipe;
fdr =... | @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,361 | static inline void __pipe_lock(struct pipe_inode_info *pipe)
{
mutex_lock_nested(&pipe->mutex, I_MUTEX_PARENT);
}
| DoS +Priv | 0 | static inline void __pipe_lock(struct pipe_inode_info *pipe)
{
mutex_lock_nested(&pipe->mutex, I_MUTEX_PARENT);
}
| @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,362 | static inline void __pipe_unlock(struct pipe_inode_info *pipe)
{
mutex_unlock(&pipe->mutex);
}
| DoS +Priv | 0 | static inline void __pipe_unlock(struct pipe_inode_info *pipe)
{
mutex_unlock(&pipe->mutex);
}
| @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,363 | struct pipe_inode_info *alloc_pipe_info(void)
{
struct pipe_inode_info *pipe;
pipe = kzalloc(sizeof(struct pipe_inode_info), GFP_KERNEL);
if (pipe) {
pipe->bufs = kzalloc(sizeof(struct pipe_buffer) * PIPE_DEF_BUFFERS, GFP_KERNEL);
if (pipe->bufs) {
init_waitqueue_head(&pipe->wait);
pipe->r_counter = pipe-... | DoS +Priv | 0 | struct pipe_inode_info *alloc_pipe_info(void)
{
struct pipe_inode_info *pipe;
pipe = kzalloc(sizeof(struct pipe_inode_info), GFP_KERNEL);
if (pipe) {
pipe->bufs = kzalloc(sizeof(struct pipe_buffer) * PIPE_DEF_BUFFERS, GFP_KERNEL);
if (pipe->bufs) {
init_waitqueue_head(&pipe->wait);
pipe->r_counter = pipe-... | @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,364 | int create_pipe_files(struct file **res, int flags)
{
int err;
struct inode *inode = get_pipe_inode();
struct file *f;
struct path path;
static struct qstr name = { .name = "" };
if (!inode)
return -ENFILE;
err = -ENOMEM;
path.dentry = d_alloc_pseudo(pipe_mnt->mnt_sb, &name);
if (!path.dentry)
goto err_i... | DoS +Priv | 0 | int create_pipe_files(struct file **res, int flags)
{
int err;
struct inode *inode = get_pipe_inode();
struct file *f;
struct path path;
static struct qstr name = { .name = "" };
if (!inode)
return -ENFILE;
err = -ENOMEM;
path.dentry = d_alloc_pseudo(pipe_mnt->mnt_sb, &name);
if (!path.dentry)
goto err_i... | @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,365 | int do_pipe_flags(int *fd, int flags)
{
struct file *files[2];
int error = __do_pipe_flags(fd, files, flags);
if (!error) {
fd_install(fd[0], files[0]);
fd_install(fd[1], files[1]);
}
return error;
}
| DoS +Priv | 0 | int do_pipe_flags(int *fd, int flags)
{
struct file *files[2];
int error = __do_pipe_flags(fd, files, flags);
if (!error) {
fd_install(fd[0], files[0]);
fd_install(fd[1], files[1]);
}
return error;
}
| @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,366 | void generic_pipe_buf_get(struct pipe_inode_info *pipe, struct pipe_buffer *buf)
{
page_cache_get(buf->page);
}
| DoS +Priv | 0 | void generic_pipe_buf_get(struct pipe_inode_info *pipe, struct pipe_buffer *buf)
{
page_cache_get(buf->page);
}
| @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,367 | void generic_pipe_buf_release(struct pipe_inode_info *pipe,
struct pipe_buffer *buf)
{
page_cache_release(buf->page);
}
| DoS +Priv | 0 | void generic_pipe_buf_release(struct pipe_inode_info *pipe,
struct pipe_buffer *buf)
{
page_cache_release(buf->page);
}
| @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,368 | int generic_pipe_buf_steal(struct pipe_inode_info *pipe,
struct pipe_buffer *buf)
{
struct page *page = buf->page;
/*
* A reference of one is golden, that means that the owner of this
* page is the only one holding a reference to it. lock the page
* and return OK.
*/
if (page_count(page) == 1) {
loc... | DoS +Priv | 0 | int generic_pipe_buf_steal(struct pipe_inode_info *pipe,
struct pipe_buffer *buf)
{
struct page *page = buf->page;
/*
* A reference of one is golden, that means that the owner of this
* page is the only one holding a reference to it. lock the page
* and return OK.
*/
if (page_count(page) == 1) {
loc... | @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,369 | struct pipe_inode_info *get_pipe_info(struct file *file)
{
return file->f_op == &pipefifo_fops ? file->private_data : NULL;
}
| DoS +Priv | 0 | struct pipe_inode_info *get_pipe_info(struct file *file)
{
return file->f_op == &pipefifo_fops ? file->private_data : NULL;
}
| @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,370 | static struct inode * get_pipe_inode(void)
{
struct inode *inode = new_inode_pseudo(pipe_mnt->mnt_sb);
struct pipe_inode_info *pipe;
if (!inode)
goto fail_inode;
inode->i_ino = get_next_ino();
pipe = alloc_pipe_info();
if (!pipe)
goto fail_iput;
inode->i_pipe = pipe;
pipe->files = 2;
pipe->readers = pi... | DoS +Priv | 0 | static struct inode * get_pipe_inode(void)
{
struct inode *inode = new_inode_pseudo(pipe_mnt->mnt_sb);
struct pipe_inode_info *pipe;
if (!inode)
goto fail_inode;
inode->i_ino = get_next_ino();
pipe = alloc_pipe_info();
if (!pipe)
goto fail_iput;
inode->i_pipe = pipe;
pipe->files = 2;
pipe->readers = pi... | @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,371 | static int __init init_pipe_fs(void)
{
int err = register_filesystem(&pipe_fs_type);
if (!err) {
pipe_mnt = kern_mount(&pipe_fs_type);
if (IS_ERR(pipe_mnt)) {
err = PTR_ERR(pipe_mnt);
unregister_filesystem(&pipe_fs_type);
}
}
return err;
}
| DoS +Priv | 0 | static int __init init_pipe_fs(void)
{
int err = register_filesystem(&pipe_fs_type);
if (!err) {
pipe_mnt = kern_mount(&pipe_fs_type);
if (IS_ERR(pipe_mnt)) {
err = PTR_ERR(pipe_mnt);
unregister_filesystem(&pipe_fs_type);
}
}
return err;
}
| @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,372 | static inline int is_packetized(struct file *file)
{
return (file->f_flags & O_DIRECT) != 0;
}
| DoS +Priv | 0 | static inline int is_packetized(struct file *file)
{
return (file->f_flags & O_DIRECT) != 0;
}
| @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,373 | void pipe_double_lock(struct pipe_inode_info *pipe1,
struct pipe_inode_info *pipe2)
{
BUG_ON(pipe1 == pipe2);
if (pipe1 < pipe2) {
pipe_lock_nested(pipe1, I_MUTEX_PARENT);
pipe_lock_nested(pipe2, I_MUTEX_CHILD);
} else {
pipe_lock_nested(pipe2, I_MUTEX_PARENT);
pipe_lock_nested(pipe1, I_MUTEX_CHILD)... | DoS +Priv | 0 | void pipe_double_lock(struct pipe_inode_info *pipe1,
struct pipe_inode_info *pipe2)
{
BUG_ON(pipe1 == pipe2);
if (pipe1 < pipe2) {
pipe_lock_nested(pipe1, I_MUTEX_PARENT);
pipe_lock_nested(pipe2, I_MUTEX_CHILD);
} else {
pipe_lock_nested(pipe2, I_MUTEX_PARENT);
pipe_lock_nested(pipe1, I_MUTEX_CHILD)... | @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,374 | pipe_fasync(int fd, struct file *filp, int on)
{
struct pipe_inode_info *pipe = filp->private_data;
int retval = 0;
__pipe_lock(pipe);
if (filp->f_mode & FMODE_READ)
retval = fasync_helper(fd, filp, on, &pipe->fasync_readers);
if ((filp->f_mode & FMODE_WRITE) && retval >= 0) {
retval = fasync_helper(fd, filp,... | DoS +Priv | 0 | pipe_fasync(int fd, struct file *filp, int on)
{
struct pipe_inode_info *pipe = filp->private_data;
int retval = 0;
__pipe_lock(pipe);
if (filp->f_mode & FMODE_READ)
retval = fasync_helper(fd, filp, on, &pipe->fasync_readers);
if ((filp->f_mode & FMODE_WRITE) && retval >= 0) {
retval = fasync_helper(fd, filp,... | @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,375 | static void pipe_lock_nested(struct pipe_inode_info *pipe, int subclass)
{
if (pipe->files)
mutex_lock_nested(&pipe->mutex, subclass);
}
| DoS +Priv | 0 | static void pipe_lock_nested(struct pipe_inode_info *pipe, int subclass)
{
if (pipe->files)
mutex_lock_nested(&pipe->mutex, subclass);
}
| @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,376 | pipe_poll(struct file *filp, poll_table *wait)
{
unsigned int mask;
struct pipe_inode_info *pipe = filp->private_data;
int nrbufs;
poll_wait(filp, &pipe->wait, wait);
/* Reading only -- no need for acquiring the semaphore. */
nrbufs = pipe->nrbufs;
mask = 0;
if (filp->f_mode & FMODE_READ) {
mask = (nrbufs ... | DoS +Priv | 0 | pipe_poll(struct file *filp, poll_table *wait)
{
unsigned int mask;
struct pipe_inode_info *pipe = filp->private_data;
int nrbufs;
poll_wait(filp, &pipe->wait, wait);
/* Reading only -- no need for acquiring the semaphore. */
nrbufs = pipe->nrbufs;
mask = 0;
if (filp->f_mode & FMODE_READ) {
mask = (nrbufs ... | @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,377 | int pipe_proc_fn(struct ctl_table *table, int write, void __user *buf,
size_t *lenp, loff_t *ppos)
{
int ret;
ret = proc_dointvec_minmax(table, write, buf, lenp, ppos);
if (ret < 0 || !write)
return ret;
pipe_max_size = round_pipe_size(pipe_max_size);
return ret;
}
| DoS +Priv | 0 | int pipe_proc_fn(struct ctl_table *table, int write, void __user *buf,
size_t *lenp, loff_t *ppos)
{
int ret;
ret = proc_dointvec_minmax(table, write, buf, lenp, ppos);
if (ret < 0 || !write)
return ret;
pipe_max_size = round_pipe_size(pipe_max_size);
return ret;
}
| @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,378 | pipe_read(struct kiocb *iocb, struct iov_iter *to)
{
size_t total_len = iov_iter_count(to);
struct file *filp = iocb->ki_filp;
struct pipe_inode_info *pipe = filp->private_data;
int do_wakeup;
ssize_t ret;
/* Null read succeeds. */
if (unlikely(total_len == 0))
return 0;
do_wakeup = 0;
ret = 0;
__pipe_loc... | DoS +Priv | 0 | pipe_read(struct kiocb *iocb, struct iov_iter *to)
{
size_t total_len = iov_iter_count(to);
struct file *filp = iocb->ki_filp;
struct pipe_inode_info *pipe = filp->private_data;
int do_wakeup;
ssize_t ret;
/* Null read succeeds. */
if (unlikely(total_len == 0))
return 0;
do_wakeup = 0;
ret = 0;
__pipe_loc... | @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,379 | pipe_release(struct inode *inode, struct file *file)
{
struct pipe_inode_info *pipe = file->private_data;
__pipe_lock(pipe);
if (file->f_mode & FMODE_READ)
pipe->readers--;
if (file->f_mode & FMODE_WRITE)
pipe->writers--;
if (pipe->readers || pipe->writers) {
wake_up_interruptible_sync_poll(&pipe->wait, PO... | DoS +Priv | 0 | pipe_release(struct inode *inode, struct file *file)
{
struct pipe_inode_info *pipe = file->private_data;
__pipe_lock(pipe);
if (file->f_mode & FMODE_READ)
pipe->readers--;
if (file->f_mode & FMODE_WRITE)
pipe->writers--;
if (pipe->readers || pipe->writers) {
wake_up_interruptible_sync_poll(&pipe->wait, PO... | @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,380 | static long pipe_set_size(struct pipe_inode_info *pipe, unsigned long nr_pages)
{
struct pipe_buffer *bufs;
/*
* We can shrink the pipe, if arg >= pipe->nrbufs. Since we don't
* expect a lot of shrink+grow operations, just free and allocate
* again like we would do for growing. If the pipe currently
* contai... | DoS +Priv | 0 | static long pipe_set_size(struct pipe_inode_info *pipe, unsigned long nr_pages)
{
struct pipe_buffer *bufs;
/*
* We can shrink the pipe, if arg >= pipe->nrbufs. Since we don't
* expect a lot of shrink+grow operations, just free and allocate
* again like we would do for growing. If the pipe currently
* contai... | @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,381 | void pipe_wait(struct pipe_inode_info *pipe)
{
DEFINE_WAIT(wait);
/*
* Pipes are system-local resources, so sleeping on them
* is considered a noninteractive wait:
*/
prepare_to_wait(&pipe->wait, &wait, TASK_INTERRUPTIBLE);
pipe_unlock(pipe);
schedule();
finish_wait(&pipe->wait, &wait);
pipe_lock(pipe);
... | DoS +Priv | 0 | void pipe_wait(struct pipe_inode_info *pipe)
{
DEFINE_WAIT(wait);
/*
* Pipes are system-local resources, so sleeping on them
* is considered a noninteractive wait:
*/
prepare_to_wait(&pipe->wait, &wait, TASK_INTERRUPTIBLE);
pipe_unlock(pipe);
schedule();
finish_wait(&pipe->wait, &wait);
pipe_lock(pipe);
... | @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,382 | static char *pipefs_dname(struct dentry *dentry, char *buffer, int buflen)
{
return dynamic_dname(dentry, buffer, buflen, "pipe:[%lu]",
dentry->d_inode->i_ino);
}
| DoS +Priv | 0 | static char *pipefs_dname(struct dentry *dentry, char *buffer, int buflen)
{
return dynamic_dname(dentry, buffer, buflen, "pipe:[%lu]",
dentry->d_inode->i_ino);
}
| @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,383 | static struct dentry *pipefs_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
{
return mount_pseudo(fs_type, "pipe:", &pipefs_ops,
&pipefs_dentry_operations, PIPEFS_MAGIC);
}
| DoS +Priv | 0 | static struct dentry *pipefs_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
{
return mount_pseudo(fs_type, "pipe:", &pipefs_ops,
&pipefs_dentry_operations, PIPEFS_MAGIC);
}
| @@ -116,50 +116,6 @@ void pipe_wait(struct pipe_inode_info *pipe)
pipe_lock(pipe);
}
-static int
-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
- int atomic)
-{
- unsigned long copy;
-
- while (len > 0) {
- while (!iov->iov_len)
- iov++;
- copy = min_t(unsigned long, len, iov->iov_l... | CWE-17 | null | null |
35,384 | static size_t __iovec_copy_from_user_inatomic(char *vaddr,
const struct iovec *iov, size_t base, size_t bytes)
{
size_t copied = 0, left = 0;
while (bytes) {
char __user *buf = iov->iov_base + base;
int copy = min(bytes, iov->iov_len - base);
base = 0;
left = __copy_from_user_inatomic(vaddr, buf, copy... | DoS +Priv | 0 | static size_t __iovec_copy_from_user_inatomic(char *vaddr,
const struct iovec *iov, size_t base, size_t bytes)
{
size_t copied = 0, left = 0;
while (bytes) {
char __user *buf = iov->iov_base + base;
int copy = min(bytes, iov->iov_len - base);
base = 0;
left = __copy_from_user_inatomic(vaddr, buf, copy... | @@ -82,6 +82,84 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
}
EXPORT_SYMBOL(copy_page_to_iter);
+size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
+ struct iov_iter *i)
+{
+ size_t skip, copy, left, wanted;
+ const struct iovec *iov;
+ char __user *buf;
+ ... | CWE-17 | null | null |
35,385 | size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
struct iov_iter *i)
{
size_t skip, copy, left, wanted;
const struct iovec *iov;
char __user *buf;
void *kaddr, *from;
if (unlikely(bytes > i->count))
bytes = i->count;
if (unlikely(!bytes))
return 0;
wanted = bytes;
iov = i->iov... | DoS +Priv | 0 | size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
struct iov_iter *i)
{
size_t skip, copy, left, wanted;
const struct iovec *iov;
char __user *buf;
void *kaddr, *from;
if (unlikely(bytes > i->count))
bytes = i->count;
if (unlikely(!bytes))
return 0;
wanted = bytes;
iov = i->iov... | @@ -82,6 +82,84 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
}
EXPORT_SYMBOL(copy_page_to_iter);
+size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
+ struct iov_iter *i)
+{
+ size_t skip, copy, left, wanted;
+ const struct iovec *iov;
+ char __user *buf;
+ ... | CWE-17 | null | null |
35,386 | void iov_iter_advance(struct iov_iter *i, size_t bytes)
{
BUG_ON(i->count < bytes);
if (likely(i->nr_segs == 1)) {
i->iov_offset += bytes;
i->count -= bytes;
} else {
const struct iovec *iov = i->iov;
size_t base = i->iov_offset;
unsigned long nr_segs = i->nr_segs;
/*
* The !iov->iov_len check ensur... | DoS +Priv | 0 | void iov_iter_advance(struct iov_iter *i, size_t bytes)
{
BUG_ON(i->count < bytes);
if (likely(i->nr_segs == 1)) {
i->iov_offset += bytes;
i->count -= bytes;
} else {
const struct iovec *iov = i->iov;
size_t base = i->iov_offset;
unsigned long nr_segs = i->nr_segs;
/*
* The !iov->iov_len check ensur... | @@ -82,6 +82,84 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
}
EXPORT_SYMBOL(copy_page_to_iter);
+size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
+ struct iov_iter *i)
+{
+ size_t skip, copy, left, wanted;
+ const struct iovec *iov;
+ char __user *buf;
+ ... | CWE-17 | null | null |
35,387 | unsigned long iov_iter_alignment(const struct iov_iter *i)
{
const struct iovec *iov = i->iov;
unsigned long res;
size_t size = i->count;
size_t n;
if (!size)
return 0;
res = (unsigned long)iov->iov_base + i->iov_offset;
n = iov->iov_len - i->iov_offset;
if (n >= size)
return res | size;
size -= n;
res ... | DoS +Priv | 0 | unsigned long iov_iter_alignment(const struct iov_iter *i)
{
const struct iovec *iov = i->iov;
unsigned long res;
size_t size = i->count;
size_t n;
if (!size)
return 0;
res = (unsigned long)iov->iov_base + i->iov_offset;
n = iov->iov_len - i->iov_offset;
if (n >= size)
return res | size;
size -= n;
res ... | @@ -82,6 +82,84 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
}
EXPORT_SYMBOL(copy_page_to_iter);
+size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
+ struct iov_iter *i)
+{
+ size_t skip, copy, left, wanted;
+ const struct iovec *iov;
+ char __user *buf;
+ ... | CWE-17 | null | null |
35,388 | size_t iov_iter_copy_from_user_atomic(struct page *page,
struct iov_iter *i, unsigned long offset, size_t bytes)
{
char *kaddr;
size_t copied;
kaddr = kmap_atomic(page);
if (likely(i->nr_segs == 1)) {
int left;
char __user *buf = i->iov->iov_base + i->iov_offset;
left = __copy_from_user_inatomic(kaddr + of... | DoS +Priv | 0 | size_t iov_iter_copy_from_user_atomic(struct page *page,
struct iov_iter *i, unsigned long offset, size_t bytes)
{
char *kaddr;
size_t copied;
kaddr = kmap_atomic(page);
if (likely(i->nr_segs == 1)) {
int left;
char __user *buf = i->iov->iov_base + i->iov_offset;
left = __copy_from_user_inatomic(kaddr + of... | @@ -82,6 +82,84 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
}
EXPORT_SYMBOL(copy_page_to_iter);
+size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
+ struct iov_iter *i)
+{
+ size_t skip, copy, left, wanted;
+ const struct iovec *iov;
+ char __user *buf;
+ ... | CWE-17 | null | null |
35,389 | int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes)
{
char __user *buf = i->iov->iov_base + i->iov_offset;
bytes = min(bytes, i->iov->iov_len - i->iov_offset);
return fault_in_pages_readable(buf, bytes);
}
| DoS +Priv | 0 | int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes)
{
char __user *buf = i->iov->iov_base + i->iov_offset;
bytes = min(bytes, i->iov->iov_len - i->iov_offset);
return fault_in_pages_readable(buf, bytes);
}
| @@ -82,6 +82,84 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
}
EXPORT_SYMBOL(copy_page_to_iter);
+size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
+ struct iov_iter *i)
+{
+ size_t skip, copy, left, wanted;
+ const struct iovec *iov;
+ char __user *buf;
+ ... | CWE-17 | null | null |
35,390 | ssize_t iov_iter_get_pages(struct iov_iter *i,
struct page **pages, size_t maxsize,
size_t *start)
{
size_t offset = i->iov_offset;
const struct iovec *iov = i->iov;
size_t len;
unsigned long addr;
int n;
int res;
len = iov->iov_len - offset;
if (len > i->count)
len = i->count;
if (len > maxsize)
... | DoS +Priv | 0 | ssize_t iov_iter_get_pages(struct iov_iter *i,
struct page **pages, size_t maxsize,
size_t *start)
{
size_t offset = i->iov_offset;
const struct iovec *iov = i->iov;
size_t len;
unsigned long addr;
int n;
int res;
len = iov->iov_len - offset;
if (len > i->count)
len = i->count;
if (len > maxsize)
... | @@ -82,6 +82,84 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
}
EXPORT_SYMBOL(copy_page_to_iter);
+size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
+ struct iov_iter *i)
+{
+ size_t skip, copy, left, wanted;
+ const struct iovec *iov;
+ char __user *buf;
+ ... | CWE-17 | null | null |
35,391 | ssize_t iov_iter_get_pages_alloc(struct iov_iter *i,
struct page ***pages, size_t maxsize,
size_t *start)
{
size_t offset = i->iov_offset;
const struct iovec *iov = i->iov;
size_t len;
unsigned long addr;
void *p;
int n;
int res;
len = iov->iov_len - offset;
if (len > i->count)
len = i->count;
if... | DoS +Priv | 0 | ssize_t iov_iter_get_pages_alloc(struct iov_iter *i,
struct page ***pages, size_t maxsize,
size_t *start)
{
size_t offset = i->iov_offset;
const struct iovec *iov = i->iov;
size_t len;
unsigned long addr;
void *p;
int n;
int res;
len = iov->iov_len - offset;
if (len > i->count)
len = i->count;
if... | @@ -82,6 +82,84 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
}
EXPORT_SYMBOL(copy_page_to_iter);
+size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
+ struct iov_iter *i)
+{
+ size_t skip, copy, left, wanted;
+ const struct iovec *iov;
+ char __user *buf;
+ ... | CWE-17 | null | null |
35,392 | void iov_iter_init(struct iov_iter *i, int direction,
const struct iovec *iov, unsigned long nr_segs,
size_t count)
{
/* It will get better. Eventually... */
if (segment_eq(get_fs(), KERNEL_DS))
direction |= REQ_KERNEL;
i->type = direction;
i->iov = iov;
i->nr_segs = nr_segs;
i->iov_offset = 0;
i->count... | DoS +Priv | 0 | void iov_iter_init(struct iov_iter *i, int direction,
const struct iovec *iov, unsigned long nr_segs,
size_t count)
{
/* It will get better. Eventually... */
if (segment_eq(get_fs(), KERNEL_DS))
direction |= REQ_KERNEL;
i->type = direction;
i->iov = iov;
i->nr_segs = nr_segs;
i->iov_offset = 0;
i->count... | @@ -82,6 +82,84 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
}
EXPORT_SYMBOL(copy_page_to_iter);
+size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
+ struct iov_iter *i)
+{
+ size_t skip, copy, left, wanted;
+ const struct iovec *iov;
+ char __user *buf;
+ ... | CWE-17 | null | null |
35,393 | int iov_iter_npages(const struct iov_iter *i, int maxpages)
{
size_t offset = i->iov_offset;
size_t size = i->count;
const struct iovec *iov = i->iov;
int npages = 0;
int n;
for (n = 0; size && n < i->nr_segs; n++, iov++) {
unsigned long addr = (unsigned long)iov->iov_base + offset;
size_t len = iov->iov_len... | DoS +Priv | 0 | int iov_iter_npages(const struct iov_iter *i, int maxpages)
{
size_t offset = i->iov_offset;
size_t size = i->count;
const struct iovec *iov = i->iov;
int npages = 0;
int n;
for (n = 0; size && n < i->nr_segs; n++, iov++) {
unsigned long addr = (unsigned long)iov->iov_base + offset;
size_t len = iov->iov_len... | @@ -82,6 +82,84 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
}
EXPORT_SYMBOL(copy_page_to_iter);
+size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
+ struct iov_iter *i)
+{
+ size_t skip, copy, left, wanted;
+ const struct iovec *iov;
+ char __user *buf;
+ ... | CWE-17 | null | null |
35,394 | size_t iov_iter_single_seg_count(const struct iov_iter *i)
{
const struct iovec *iov = i->iov;
if (i->nr_segs == 1)
return i->count;
else
return min(i->count, iov->iov_len - i->iov_offset);
}
| DoS +Priv | 0 | size_t iov_iter_single_seg_count(const struct iov_iter *i)
{
const struct iovec *iov = i->iov;
if (i->nr_segs == 1)
return i->count;
else
return min(i->count, iov->iov_len - i->iov_offset);
}
| @@ -82,6 +82,84 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
}
EXPORT_SYMBOL(copy_page_to_iter);
+size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
+ struct iov_iter *i)
+{
+ size_t skip, copy, left, wanted;
+ const struct iovec *iov;
+ char __user *buf;
+ ... | CWE-17 | null | null |
35,395 | CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags)
{
CMS_ContentInfo *cms;
if (comp_nid <= 0)
comp_nid = NID_zlib_compression;
cms = cms_CompressedData_create(comp_nid);
if (!cms)
return NULL;
if(!(flags & CMS_DETACHED))
CMS_set_detached(cms, 0);
if ((flags & CMS_STREAM) || CMS_fina... | DoS | 0 | CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags)
{
CMS_ContentInfo *cms;
if (comp_nid <= 0)
comp_nid = NID_zlib_compression;
cms = cms_CompressedData_create(comp_nid);
if (!cms)
return NULL;
if(!(flags & CMS_DETACHED))
CMS_set_detached(cms, 0);
if ((flags & CMS_STREAM) || CMS_fina... | @@ -60,21 +60,28 @@
#include "cms_lcl.h"
#include "asn1_locl.h"
-static int cms_copy_content(BIO *out, BIO *in, unsigned int flags)
+static BIO *cms_get_text_bio(BIO *out, unsigned int flags)
{
- unsigned char buf[4096];
- int r = 0, i;
- BIO *tmpout = NULL;
-
+ BIO *rbio;
if (out == NULL)
- tmpout = BIO_new(B... | CWE-399 | null | null |
35,396 | CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags)
{
CMSerr(CMS_F_CMS_COMPRESS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM);
return NULL;
}
| DoS | 0 | CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags)
{
CMSerr(CMS_F_CMS_COMPRESS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM);
return NULL;
}
| @@ -60,21 +60,28 @@
#include "cms_lcl.h"
#include "asn1_locl.h"
-static int cms_copy_content(BIO *out, BIO *in, unsigned int flags)
+static BIO *cms_get_text_bio(BIO *out, unsigned int flags)
{
- unsigned char buf[4096];
- int r = 0, i;
- BIO *tmpout = NULL;
-
+ BIO *rbio;
if (out == NULL)
- tmpout = BIO_new(B... | CWE-399 | null | null |
35,397 | CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags)
{
CMS_ContentInfo *cms;
cms = cms_Data_create();
if (!cms)
return NULL;
if ((flags & CMS_STREAM) || CMS_final(cms, in, NULL, flags))
return cms;
CMS_ContentInfo_free(cms);
return NULL;
}
| DoS | 0 | CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags)
{
CMS_ContentInfo *cms;
cms = cms_Data_create();
if (!cms)
return NULL;
if ((flags & CMS_STREAM) || CMS_final(cms, in, NULL, flags))
return cms;
CMS_ContentInfo_free(cms);
return NULL;
}
| @@ -60,21 +60,28 @@
#include "cms_lcl.h"
#include "asn1_locl.h"
-static int cms_copy_content(BIO *out, BIO *in, unsigned int flags)
+static BIO *cms_get_text_bio(BIO *out, unsigned int flags)
{
- unsigned char buf[4096];
- int r = 0, i;
- BIO *tmpout = NULL;
-
+ BIO *rbio;
if (out == NULL)
- tmpout = BIO_new(B... | CWE-399 | null | null |
35,398 | int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert,
BIO *dcont, BIO *out,
unsigned int flags)
{
int r;
BIO *cont;
if (OBJ_obj2nid(CMS_get0_type(cms)) != NID_pkcs7_enveloped)
{
CMSerr(CMS_F_CMS_DECRYPT, CMS_R_TYPE_NOT_ENVELOPED_DATA);
return 0;
}
if (!dcont && !check_content(cms))
retu... | DoS | 0 | int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert,
BIO *dcont, BIO *out,
unsigned int flags)
{
int r;
BIO *cont;
if (OBJ_obj2nid(CMS_get0_type(cms)) != NID_pkcs7_enveloped)
{
CMSerr(CMS_F_CMS_DECRYPT, CMS_R_TYPE_NOT_ENVELOPED_DATA);
return 0;
}
if (!dcont && !check_content(cms))
retu... | @@ -60,21 +60,28 @@
#include "cms_lcl.h"
#include "asn1_locl.h"
-static int cms_copy_content(BIO *out, BIO *in, unsigned int flags)
+static BIO *cms_get_text_bio(BIO *out, unsigned int flags)
{
- unsigned char buf[4096];
- int r = 0, i;
- BIO *tmpout = NULL;
-
+ BIO *rbio;
if (out == NULL)
- tmpout = BIO_new(B... | CWE-399 | null | null |
35,399 | int CMS_decrypt_set1_password(CMS_ContentInfo *cms,
unsigned char *pass, ossl_ssize_t passlen)
{
STACK_OF(CMS_RecipientInfo) *ris;
CMS_RecipientInfo *ri;
int i, r;
ris = CMS_get0_RecipientInfos(cms);
for (i = 0; i < sk_CMS_RecipientInfo_num(ris); i++)
{
ri = sk_CMS_RecipientInfo_value(ris, i);
if (CMS_... | DoS | 0 | int CMS_decrypt_set1_password(CMS_ContentInfo *cms,
unsigned char *pass, ossl_ssize_t passlen)
{
STACK_OF(CMS_RecipientInfo) *ris;
CMS_RecipientInfo *ri;
int i, r;
ris = CMS_get0_RecipientInfos(cms);
for (i = 0; i < sk_CMS_RecipientInfo_num(ris); i++)
{
ri = sk_CMS_RecipientInfo_value(ris, i);
if (CMS_... | @@ -60,21 +60,28 @@
#include "cms_lcl.h"
#include "asn1_locl.h"
-static int cms_copy_content(BIO *out, BIO *in, unsigned int flags)
+static BIO *cms_get_text_bio(BIO *out, unsigned int flags)
{
- unsigned char buf[4096];
- int r = 0, i;
- BIO *tmpout = NULL;
-
+ BIO *rbio;
if (out == NULL)
- tmpout = BIO_new(B... | CWE-399 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.