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,200 | lazy_stat(struct archive_write_disk *a)
{
if (a->pst != NULL) {
/* Already have stat() data available. */
return (ARCHIVE_OK);
}
#ifdef HAVE_FSTAT
if (a->fd >= 0 && fstat(a->fd, &a->st) == 0) {
a->pst = &a->st;
return (ARCHIVE_OK);
}
#endif
/*
* XXX At this point, symlinks should not be hit, otherwise
... | Dir. Trav. | 0 | lazy_stat(struct archive_write_disk *a)
{
if (a->pst != NULL) {
/* Already have stat() data available. */
return (ARCHIVE_OK);
}
#ifdef HAVE_FSTAT
if (a->fd >= 0 && fstat(a->fd, &a->st) == 0) {
a->pst = &a->st;
return (ARCHIVE_OK);
}
#endif
/*
* XXX At this point, symlinks should not be hit, otherwise
... | @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,201 | older(struct stat *st, struct archive_entry *entry)
{
/* First, test the seconds and return if we have a definite answer. */
/* Definitely older. */
if (st->st_mtime < archive_entry_mtime(entry))
return (1);
/* Definitely younger. */
if (st->st_mtime > archive_entry_mtime(entry))
return (0);
/* If this platfo... | Dir. Trav. | 0 | older(struct stat *st, struct archive_entry *entry)
{
/* First, test the seconds and return if we have a definite answer. */
/* Definitely older. */
if (st->st_mtime < archive_entry_mtime(entry))
return (1);
/* Definitely younger. */
if (st->st_mtime > archive_entry_mtime(entry))
return (0);
/* If this platfo... | @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,202 | restore_entry(struct archive_write_disk *a)
{
int ret = ARCHIVE_OK, en;
if (a->flags & ARCHIVE_EXTRACT_UNLINK && !S_ISDIR(a->mode)) {
/*
* TODO: Fix this. Apparently, there are platforms
* that still allow root to hose the entire filesystem
* by unlinking a dir. The S_ISDIR() test above
* prevents us... | Dir. Trav. | 0 | restore_entry(struct archive_write_disk *a)
{
int ret = ARCHIVE_OK, en;
if (a->flags & ARCHIVE_EXTRACT_UNLINK && !S_ISDIR(a->mode)) {
/*
* TODO: Fix this. Apparently, there are platforms
* that still allow root to hose the entire filesystem
* by unlinking a dir. The S_ISDIR() test above
* prevents us... | @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,203 | set_fflags(struct archive_write_disk *a)
{
struct fixup_entry *le;
unsigned long set, clear;
int r;
int critical_flags;
mode_t mode = archive_entry_mode(a->entry);
/*
* Make 'critical_flags' hold all file flags that can't be
* immediately restored. For example, on BSD systems,
* SF_IMMUTABLE prevents h... | Dir. Trav. | 0 | set_fflags(struct archive_write_disk *a)
{
struct fixup_entry *le;
unsigned long set, clear;
int r;
int critical_flags;
mode_t mode = archive_entry_mode(a->entry);
/*
* Make 'critical_flags' hold all file flags that can't be
* immediately restored. For example, on BSD systems,
* SF_IMMUTABLE prevents h... | @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,204 | set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
mode_t mode, unsigned long set, unsigned long clear)
{
int r;
(void)mode; /* UNUSED */
if (set == 0 && clear == 0)
return (ARCHIVE_OK);
/*
* XXX Is the stat here really necessary? Or can I just use
* the 'set' flags directly? ... | Dir. Trav. | 0 | set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
mode_t mode, unsigned long set, unsigned long clear)
{
int r;
(void)mode; /* UNUSED */
if (set == 0 && clear == 0)
return (ARCHIVE_OK);
/*
* XXX Is the stat here really necessary? Or can I just use
* the 'set' flags directly? ... | @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,205 | set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
mode_t mode, unsigned long set, unsigned long clear)
{
int ret;
int myfd = fd;
int newflags, oldflags;
int sf_mask = 0;
if (set == 0 && clear == 0)
return (ARCHIVE_OK);
/* Only regular files and dirs can have flags. */
if (!S... | Dir. Trav. | 0 | set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
mode_t mode, unsigned long set, unsigned long clear)
{
int ret;
int myfd = fd;
int newflags, oldflags;
int sf_mask = 0;
if (set == 0 && clear == 0)
return (ARCHIVE_OK);
/* Only regular files and dirs can have flags. */
if (!S... | @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,206 | set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
mode_t mode, unsigned long set, unsigned long clear)
{
(void)a; /* UNUSED */
(void)fd; /* UNUSED */
(void)name; /* UNUSED */
(void)mode; /* UNUSED */
(void)set; /* UNUSED */
(void)clear; /* UNUSED */
return (ARCHIVE_OK);
}
| Dir. Trav. | 0 | set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
mode_t mode, unsigned long set, unsigned long clear)
{
(void)a; /* UNUSED */
(void)fd; /* UNUSED */
(void)name; /* UNUSED */
(void)mode; /* UNUSED */
(void)set; /* UNUSED */
(void)clear; /* UNUSED */
return (ARCHIVE_OK);
}
| @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,207 | set_mac_metadata(struct archive_write_disk *a, const char *pathname,
const void *metadata, size_t metadata_size)
{
(void)a; /* UNUSED */
(void)pathname; /* UNUSED */
(void)metadata; /* UNUSED */
(void)metadata_size; /* UNUSED */
return (ARCHIVE_OK);
}
| Dir. Trav. | 0 | set_mac_metadata(struct archive_write_disk *a, const char *pathname,
const void *metadata, size_t metadata_size)
{
(void)a; /* UNUSED */
(void)pathname; /* UNUSED */
(void)metadata; /* UNUSED */
(void)metadata_size; /* UNUSED */
return (ARCHIVE_OK);
}
| @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,208 | set_mode(struct archive_write_disk *a, int mode)
{
int r = ARCHIVE_OK;
mode &= 07777; /* Strip off file type bits. */
if (a->todo & TODO_SGID_CHECK) {
/*
* If we don't know the GID is right, we must stat()
* to verify it. We can't just check the GID of this
* process, since systems sometimes set GID fro... | Dir. Trav. | 0 | set_mode(struct archive_write_disk *a, int mode)
{
int r = ARCHIVE_OK;
mode &= 07777; /* Strip off file type bits. */
if (a->todo & TODO_SGID_CHECK) {
/*
* If we don't know the GID is right, we must stat()
* to verify it. We can't just check the GID of this
* process, since systems sometimes set GID fro... | @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,209 | set_ownership(struct archive_write_disk *a)
{
#ifndef __CYGWIN__
/* unfortunately, on win32 there is no 'root' user with uid 0,
so we just have to try the chown and see if it works */
/* If we know we can't change it, don't bother trying. */
if (a->user_uid != 0 && a->user_uid != a->uid) {
archive_set_error(&... | Dir. Trav. | 0 | set_ownership(struct archive_write_disk *a)
{
#ifndef __CYGWIN__
/* unfortunately, on win32 there is no 'root' user with uid 0,
so we just have to try the chown and see if it works */
/* If we know we can't change it, don't bother trying. */
if (a->user_uid != 0 && a->user_uid != a->uid) {
archive_set_error(&... | @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,210 | set_time(int fd, int mode, const char *name,
time_t atime, long atime_nsec,
time_t mtime, long mtime_nsec)
{
/* Select the best implementation for this platform. */
#if defined(HAVE_UTIMENSAT) && defined(HAVE_FUTIMENS)
/*
* utimensat() and futimens() are defined in
* POSIX.1-2008. They support ns resoluti... | Dir. Trav. | 0 | set_time(int fd, int mode, const char *name,
time_t atime, long atime_nsec,
time_t mtime, long mtime_nsec)
{
/* Select the best implementation for this platform. */
#if defined(HAVE_UTIMENSAT) && defined(HAVE_FUTIMENS)
/*
* utimensat() and futimens() are defined in
* POSIX.1-2008. They support ns resoluti... | @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,211 | set_times(struct archive_write_disk *a,
int fd, int mode, const char *name,
time_t atime, long atime_nanos,
time_t birthtime, long birthtime_nanos,
time_t mtime, long mtime_nanos,
time_t cctime, long ctime_nanos)
{
/* Note: set_time doesn't use libarchive return conventions!
* It uses syscall con... | Dir. Trav. | 0 | set_times(struct archive_write_disk *a,
int fd, int mode, const char *name,
time_t atime, long atime_nanos,
time_t birthtime, long birthtime_nanos,
time_t mtime, long mtime_nanos,
time_t cctime, long ctime_nanos)
{
/* Note: set_time doesn't use libarchive return conventions!
* It uses syscall con... | @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,212 | set_xattrs(struct archive_write_disk *a)
{
struct archive_entry *entry = a->entry;
static int warning_done = 0;
int ret = ARCHIVE_OK;
int i = archive_entry_xattr_reset(entry);
while (i--) {
const char *name;
const void *value;
size_t size;
archive_entry_xattr_next(entry, &name, &value, &size);
if (name ... | Dir. Trav. | 0 | set_xattrs(struct archive_write_disk *a)
{
struct archive_entry *entry = a->entry;
static int warning_done = 0;
int ret = ARCHIVE_OK;
int i = archive_entry_xattr_reset(entry);
while (i--) {
const char *name;
const void *value;
size_t size;
archive_entry_xattr_next(entry, &name, &value, &size);
if (name ... | @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,213 | set_xattrs(struct archive_write_disk *a)
{
static int warning_done = 0;
/* If there aren't any extended attributes, then it's okay not
* to extract them, otherwise, issue a single warning. */
if (archive_entry_xattr_count(a->entry) != 0 && !warning_done) {
warning_done = 1;
archive_set_error(&a->archive, ARCH... | Dir. Trav. | 0 | set_xattrs(struct archive_write_disk *a)
{
static int warning_done = 0;
/* If there aren't any extended attributes, then it's okay not
* to extract them, otherwise, issue a single warning. */
if (archive_entry_xattr_count(a->entry) != 0 && !warning_done) {
warning_done = 1;
archive_set_error(&a->archive, ARCH... | @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,214 | sort_dir_list(struct fixup_entry *p)
{
struct fixup_entry *a, *b, *t;
if (p == NULL)
return (NULL);
/* A one-item list is already sorted. */
if (p->next == NULL)
return (p);
/* Step 1: split the list. */
t = p;
a = p->next->next;
while (a != NULL) {
/* Step a twice, t once. */
a = a->next;
if (a != ... | Dir. Trav. | 0 | sort_dir_list(struct fixup_entry *p)
{
struct fixup_entry *a, *b, *t;
if (p == NULL)
return (NULL);
/* A one-item list is already sorted. */
if (p->next == NULL)
return (p);
/* Step 1: split the list. */
t = p;
a = p->next->next;
while (a != NULL) {
/* Step a twice, t once. */
a = a->next;
if (a != ... | @@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
/*
* Canonicalize the pathname. In particular, this strips duplicate
* '/' characters, '.' elements, and trailing '/'. It also raises an
- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
- * set) any '..' in the path.
... | CWE-22 | null | null |
35,215 | static int conf_space_write(struct pci_dev *dev,
const struct config_field_entry *entry,
int offset, u32 value)
{
int ret = 0;
const struct config_field *field = entry->field;
switch (field->size) {
case 1:
if (field->u.b.write)
ret = field->u.b.write(dev, offset, (u8) value,
entry->... | DoS | 0 | static int conf_space_write(struct pci_dev *dev,
const struct config_field_entry *entry,
int offset, u32 value)
{
int ret = 0;
const struct config_field *field = entry->field;
switch (field->size) {
case 1:
if (field->u.b.write)
ret = field->u.b.write(dev, offset, (u8) value,
entry->... | @@ -16,7 +16,7 @@
#include "conf_space.h"
#include "conf_space_quirks.h"
-static bool permissive;
+bool permissive;
module_param(permissive, bool, 0644);
/* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word, | CWE-264 | null | null |
35,216 | static inline u32 get_mask(int size)
{
if (size == 1)
return 0xff;
else if (size == 2)
return 0xffff;
else
return 0xffffffff;
}
| DoS | 0 | static inline u32 get_mask(int size)
{
if (size == 1)
return 0xff;
else if (size == 2)
return 0xffff;
else
return 0xffffffff;
}
| @@ -16,7 +16,7 @@
#include "conf_space.h"
#include "conf_space_quirks.h"
-static bool permissive;
+bool permissive;
module_param(permissive, bool, 0644);
/* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word, | CWE-264 | null | null |
35,217 | static inline u32 merge_value(u32 val, u32 new_val, u32 new_val_mask,
int offset)
{
if (offset >= 0) {
new_val_mask <<= (offset * 8);
new_val <<= (offset * 8);
} else {
new_val_mask >>= (offset * -8);
new_val >>= (offset * -8);
}
val = (val & ~new_val_mask) | (new_val & new_val_mask);
return val;... | DoS | 0 | static inline u32 merge_value(u32 val, u32 new_val, u32 new_val_mask,
int offset)
{
if (offset >= 0) {
new_val_mask <<= (offset * 8);
new_val <<= (offset * 8);
} else {
new_val_mask >>= (offset * -8);
new_val >>= (offset * -8);
}
val = (val & ~new_val_mask) | (new_val & new_val_mask);
return val;... | @@ -16,7 +16,7 @@
#include "conf_space.h"
#include "conf_space_quirks.h"
-static bool permissive;
+bool permissive;
module_param(permissive, bool, 0644);
/* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word, | CWE-264 | null | null |
35,218 | static inline int valid_request(int offset, int size)
{
/* Validate request (no un-aligned requests) */
if ((size == 1 || size == 2 || size == 4) && (offset % size) == 0)
return 1;
return 0;
}
| DoS | 0 | static inline int valid_request(int offset, int size)
{
/* Validate request (no un-aligned requests) */
if ((size == 1 || size == 2 || size == 4) && (offset % size) == 0)
return 1;
return 0;
}
| @@ -16,7 +16,7 @@
#include "conf_space.h"
#include "conf_space_quirks.h"
-static bool permissive;
+bool permissive;
module_param(permissive, bool, 0644);
/* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word, | CWE-264 | null | null |
35,219 | void xen_pcibk_config_free_dev(struct pci_dev *dev)
{
struct xen_pcibk_dev_data *dev_data = pci_get_drvdata(dev);
struct config_field_entry *cfg_entry, *t;
const struct config_field *field;
dev_dbg(&dev->dev, "free-ing virtual configuration space fields\n");
if (!dev_data)
return;
list_for_each_entry_safe(cfg... | DoS | 0 | void xen_pcibk_config_free_dev(struct pci_dev *dev)
{
struct xen_pcibk_dev_data *dev_data = pci_get_drvdata(dev);
struct config_field_entry *cfg_entry, *t;
const struct config_field *field;
dev_dbg(&dev->dev, "free-ing virtual configuration space fields\n");
if (!dev_data)
return;
list_for_each_entry_safe(cfg... | @@ -16,7 +16,7 @@
#include "conf_space.h"
#include "conf_space_quirks.h"
-static bool permissive;
+bool permissive;
module_param(permissive, bool, 0644);
/* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word, | CWE-264 | null | null |
35,220 | void xen_pcibk_config_free_dyn_fields(struct pci_dev *dev)
{
struct xen_pcibk_dev_data *dev_data = pci_get_drvdata(dev);
struct config_field_entry *cfg_entry, *t;
const struct config_field *field;
dev_dbg(&dev->dev, "free-ing dynamically allocated virtual "
"configuration space fields\n");
if (!dev_data)
... | DoS | 0 | void xen_pcibk_config_free_dyn_fields(struct pci_dev *dev)
{
struct xen_pcibk_dev_data *dev_data = pci_get_drvdata(dev);
struct config_field_entry *cfg_entry, *t;
const struct config_field *field;
dev_dbg(&dev->dev, "free-ing dynamically allocated virtual "
"configuration space fields\n");
if (!dev_data)
... | @@ -16,7 +16,7 @@
#include "conf_space.h"
#include "conf_space_quirks.h"
-static bool permissive;
+bool permissive;
module_param(permissive, bool, 0644);
/* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word, | CWE-264 | null | null |
35,221 | int xen_pcibk_config_init(void)
{
return xen_pcibk_config_capability_init();
}
| DoS | 0 | int xen_pcibk_config_init(void)
{
return xen_pcibk_config_capability_init();
}
| @@ -16,7 +16,7 @@
#include "conf_space.h"
#include "conf_space_quirks.h"
-static bool permissive;
+bool permissive;
module_param(permissive, bool, 0644);
/* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word, | CWE-264 | null | null |
35,222 | int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size,
u32 *ret_val)
{
int err = 0;
struct xen_pcibk_dev_data *dev_data = pci_get_drvdata(dev);
const struct config_field_entry *cfg_entry;
const struct config_field *field;
int req_start, req_end, field_start, field_end;
/* if read fails for any ... | DoS | 0 | int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size,
u32 *ret_val)
{
int err = 0;
struct xen_pcibk_dev_data *dev_data = pci_get_drvdata(dev);
const struct config_field_entry *cfg_entry;
const struct config_field *field;
int req_start, req_end, field_start, field_end;
/* if read fails for any ... | @@ -16,7 +16,7 @@
#include "conf_space.h"
#include "conf_space_quirks.h"
-static bool permissive;
+bool permissive;
module_param(permissive, bool, 0644);
/* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word, | CWE-264 | null | null |
35,223 | void xen_pcibk_config_reset_dev(struct pci_dev *dev)
{
struct xen_pcibk_dev_data *dev_data = pci_get_drvdata(dev);
const struct config_field_entry *cfg_entry;
const struct config_field *field;
dev_dbg(&dev->dev, "resetting virtual configuration space\n");
if (!dev_data)
return;
list_for_each_entry(cfg_entry, ... | DoS | 0 | void xen_pcibk_config_reset_dev(struct pci_dev *dev)
{
struct xen_pcibk_dev_data *dev_data = pci_get_drvdata(dev);
const struct config_field_entry *cfg_entry;
const struct config_field *field;
dev_dbg(&dev->dev, "resetting virtual configuration space\n");
if (!dev_data)
return;
list_for_each_entry(cfg_entry, ... | @@ -16,7 +16,7 @@
#include "conf_space.h"
#include "conf_space_quirks.h"
-static bool permissive;
+bool permissive;
module_param(permissive, bool, 0644);
/* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word, | CWE-264 | null | null |
35,224 | int xen_pcibk_config_write(struct pci_dev *dev, int offset, int size, u32 value)
{
int err = 0, handled = 0;
struct xen_pcibk_dev_data *dev_data = pci_get_drvdata(dev);
const struct config_field_entry *cfg_entry;
const struct config_field *field;
u32 tmp_val;
int req_start, req_end, field_start, field_end;
if (... | DoS | 0 | int xen_pcibk_config_write(struct pci_dev *dev, int offset, int size, u32 value)
{
int err = 0, handled = 0;
struct xen_pcibk_dev_data *dev_data = pci_get_drvdata(dev);
const struct config_field_entry *cfg_entry;
const struct config_field *field;
u32 tmp_val;
int req_start, req_end, field_start, field_end;
if (... | @@ -16,7 +16,7 @@
#include "conf_space.h"
#include "conf_space_quirks.h"
-static bool permissive;
+bool permissive;
module_param(permissive, bool, 0644);
/* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word, | CWE-264 | null | null |
35,225 | static void *bar_init(struct pci_dev *dev, int offset)
{
struct pci_bar_info *bar = kmalloc(sizeof(*bar), GFP_KERNEL);
if (!bar)
return ERR_PTR(-ENOMEM);
read_dev_bar(dev, bar, offset, ~0);
bar->which = 0;
return bar;
}
| DoS | 0 | static void *bar_init(struct pci_dev *dev, int offset)
{
struct pci_bar_info *bar = kmalloc(sizeof(*bar), GFP_KERNEL);
if (!bar)
return ERR_PTR(-ENOMEM);
read_dev_bar(dev, bar, offset, ~0);
bar->which = 0;
return bar;
}
| @@ -11,6 +11,10 @@
#include "pciback.h"
#include "conf_space.h"
+struct pci_cmd_info {
+ u16 val;
+};
+
struct pci_bar_info {
u32 val;
u32 len_val;
@@ -20,29 +24,45 @@ struct pci_bar_info {
#define is_enable_cmd(value) ((value)&(PCI_COMMAND_MEMORY|PCI_COMMAND_IO))
#define is_master_cmd(value) ((value)&PCI_CO... | CWE-264 | null | null |
35,226 | static int bar_read(struct pci_dev *dev, int offset, u32 * value, void *data)
{
struct pci_bar_info *bar = data;
if (unlikely(!bar)) {
pr_warn(DRV_NAME ": driver data not found for %s\n",
pci_name(dev));
return XEN_PCI_ERR_op_failed;
}
*value = bar->which ? bar->len_val : bar->val;
return 0;
}
| DoS | 0 | static int bar_read(struct pci_dev *dev, int offset, u32 * value, void *data)
{
struct pci_bar_info *bar = data;
if (unlikely(!bar)) {
pr_warn(DRV_NAME ": driver data not found for %s\n",
pci_name(dev));
return XEN_PCI_ERR_op_failed;
}
*value = bar->which ? bar->len_val : bar->val;
return 0;
}
| @@ -11,6 +11,10 @@
#include "pciback.h"
#include "conf_space.h"
+struct pci_cmd_info {
+ u16 val;
+};
+
struct pci_bar_info {
u32 val;
u32 len_val;
@@ -20,29 +24,45 @@ struct pci_bar_info {
#define is_enable_cmd(value) ((value)&(PCI_COMMAND_MEMORY|PCI_COMMAND_IO))
#define is_master_cmd(value) ((value)&PCI_CO... | CWE-264 | null | null |
35,227 | static void bar_release(struct pci_dev *dev, int offset, void *data)
{
kfree(data);
}
| DoS | 0 | static void bar_release(struct pci_dev *dev, int offset, void *data)
{
kfree(data);
}
| @@ -11,6 +11,10 @@
#include "pciback.h"
#include "conf_space.h"
+struct pci_cmd_info {
+ u16 val;
+};
+
struct pci_bar_info {
u32 val;
u32 len_val;
@@ -20,29 +24,45 @@ struct pci_bar_info {
#define is_enable_cmd(value) ((value)&(PCI_COMMAND_MEMORY|PCI_COMMAND_IO))
#define is_master_cmd(value) ((value)&PCI_CO... | CWE-264 | null | null |
35,228 | static void bar_reset(struct pci_dev *dev, int offset, void *data)
{
struct pci_bar_info *bar = data;
bar->which = 0;
}
| DoS | 0 | static void bar_reset(struct pci_dev *dev, int offset, void *data)
{
struct pci_bar_info *bar = data;
bar->which = 0;
}
| @@ -11,6 +11,10 @@
#include "pciback.h"
#include "conf_space.h"
+struct pci_cmd_info {
+ u16 val;
+};
+
struct pci_bar_info {
u32 val;
u32 len_val;
@@ -20,29 +24,45 @@ struct pci_bar_info {
#define is_enable_cmd(value) ((value)&(PCI_COMMAND_MEMORY|PCI_COMMAND_IO))
#define is_master_cmd(value) ((value)&PCI_CO... | CWE-264 | null | null |
35,229 | static int bist_write(struct pci_dev *dev, int offset, u8 value, void *data)
{
u8 cur_value;
int err;
err = pci_read_config_byte(dev, offset, &cur_value);
if (err)
goto out;
if ((cur_value & ~PCI_BIST_START) == (value & ~PCI_BIST_START)
|| value == PCI_BIST_START)
err = pci_write_config_byte(dev, offset... | DoS | 0 | static int bist_write(struct pci_dev *dev, int offset, u8 value, void *data)
{
u8 cur_value;
int err;
err = pci_read_config_byte(dev, offset, &cur_value);
if (err)
goto out;
if ((cur_value & ~PCI_BIST_START) == (value & ~PCI_BIST_START)
|| value == PCI_BIST_START)
err = pci_write_config_byte(dev, offset... | @@ -11,6 +11,10 @@
#include "pciback.h"
#include "conf_space.h"
+struct pci_cmd_info {
+ u16 val;
+};
+
struct pci_bar_info {
u32 val;
u32 len_val;
@@ -20,29 +24,45 @@ struct pci_bar_info {
#define is_enable_cmd(value) ((value)&(PCI_COMMAND_MEMORY|PCI_COMMAND_IO))
#define is_master_cmd(value) ((value)&PCI_CO... | CWE-264 | null | null |
35,230 | static int interrupt_read(struct pci_dev *dev, int offset, u8 * value,
void *data)
{
*value = (u8) dev->irq;
return 0;
}
| DoS | 0 | static int interrupt_read(struct pci_dev *dev, int offset, u8 * value,
void *data)
{
*value = (u8) dev->irq;
return 0;
}
| @@ -11,6 +11,10 @@
#include "pciback.h"
#include "conf_space.h"
+struct pci_cmd_info {
+ u16 val;
+};
+
struct pci_bar_info {
u32 val;
u32 len_val;
@@ -20,29 +24,45 @@ struct pci_bar_info {
#define is_enable_cmd(value) ((value)&(PCI_COMMAND_MEMORY|PCI_COMMAND_IO))
#define is_master_cmd(value) ((value)&PCI_CO... | CWE-264 | null | null |
35,231 | static inline void read_dev_bar(struct pci_dev *dev,
struct pci_bar_info *bar_info, int offset,
u32 len_mask)
{
int pos;
struct resource *res = dev->resource;
if (offset == PCI_ROM_ADDRESS || offset == PCI_ROM_ADDRESS1)
pos = PCI_ROM_RESOURCE;
else {
pos = (offset - PCI_BASE_ADDRESS_0) / 4;
if (pos &... | DoS | 0 | static inline void read_dev_bar(struct pci_dev *dev,
struct pci_bar_info *bar_info, int offset,
u32 len_mask)
{
int pos;
struct resource *res = dev->resource;
if (offset == PCI_ROM_ADDRESS || offset == PCI_ROM_ADDRESS1)
pos = PCI_ROM_RESOURCE;
else {
pos = (offset - PCI_BASE_ADDRESS_0) / 4;
if (pos &... | @@ -11,6 +11,10 @@
#include "pciback.h"
#include "conf_space.h"
+struct pci_cmd_info {
+ u16 val;
+};
+
struct pci_bar_info {
u32 val;
u32 len_val;
@@ -20,29 +24,45 @@ struct pci_bar_info {
#define is_enable_cmd(value) ((value)&(PCI_COMMAND_MEMORY|PCI_COMMAND_IO))
#define is_master_cmd(value) ((value)&PCI_CO... | CWE-264 | null | null |
35,232 | static void *rom_init(struct pci_dev *dev, int offset)
{
struct pci_bar_info *bar = kmalloc(sizeof(*bar), GFP_KERNEL);
if (!bar)
return ERR_PTR(-ENOMEM);
read_dev_bar(dev, bar, offset, ~PCI_ROM_ADDRESS_ENABLE);
bar->which = 0;
return bar;
}
| DoS | 0 | static void *rom_init(struct pci_dev *dev, int offset)
{
struct pci_bar_info *bar = kmalloc(sizeof(*bar), GFP_KERNEL);
if (!bar)
return ERR_PTR(-ENOMEM);
read_dev_bar(dev, bar, offset, ~PCI_ROM_ADDRESS_ENABLE);
bar->which = 0;
return bar;
}
| @@ -11,6 +11,10 @@
#include "pciback.h"
#include "conf_space.h"
+struct pci_cmd_info {
+ u16 val;
+};
+
struct pci_bar_info {
u32 val;
u32 len_val;
@@ -20,29 +24,45 @@ struct pci_bar_info {
#define is_enable_cmd(value) ((value)&(PCI_COMMAND_MEMORY|PCI_COMMAND_IO))
#define is_master_cmd(value) ((value)&PCI_CO... | CWE-264 | null | null |
35,233 | int xen_pcibk_config_header_add_fields(struct pci_dev *dev)
{
int err;
err = xen_pcibk_config_add_fields(dev, header_common);
if (err)
goto out;
switch (dev->hdr_type) {
case PCI_HEADER_TYPE_NORMAL:
err = xen_pcibk_config_add_fields(dev, header_0);
break;
case PCI_HEADER_TYPE_BRIDGE:
err = xen_pcibk_co... | DoS | 0 | int xen_pcibk_config_header_add_fields(struct pci_dev *dev)
{
int err;
err = xen_pcibk_config_add_fields(dev, header_common);
if (err)
goto out;
switch (dev->hdr_type) {
case PCI_HEADER_TYPE_NORMAL:
err = xen_pcibk_config_add_fields(dev, header_0);
break;
case PCI_HEADER_TYPE_BRIDGE:
err = xen_pcibk_co... | @@ -11,6 +11,10 @@
#include "pciback.h"
#include "conf_space.h"
+struct pci_cmd_info {
+ u16 val;
+};
+
struct pci_bar_info {
u32 val;
u32 len_val;
@@ -20,29 +24,45 @@ struct pci_bar_info {
#define is_enable_cmd(value) ((value)&(PCI_COMMAND_MEMORY|PCI_COMMAND_IO))
#define is_master_cmd(value) ((value)&PCI_CO... | CWE-264 | null | null |
35,234 | void rds_sysctl_exit(void)
{
unregister_net_sysctl_table(rds_sysctl_reg_table);
}
| +Info | 0 | void rds_sysctl_exit(void)
{
unregister_net_sysctl_table(rds_sysctl_reg_table);
}
| @@ -71,14 +71,14 @@ static struct ctl_table rds_sysctl_rds_table[] = {
{
.procname = "max_unacked_packets",
.data = &rds_sysctl_max_unacked_packets,
- .maxlen = sizeof(unsigned long),
+ .maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{
.procname... | CWE-17 | null | null |
35,235 | void llc_sysctl_exit(void)
{
if (llc2_timeout_header) {
unregister_net_sysctl_table(llc2_timeout_header);
llc2_timeout_header = NULL;
}
if (llc_station_header) {
unregister_net_sysctl_table(llc_station_header);
llc_station_header = NULL;
}
}
| +Info | 0 | void llc_sysctl_exit(void)
{
if (llc2_timeout_header) {
unregister_net_sysctl_table(llc2_timeout_header);
llc2_timeout_header = NULL;
}
if (llc_station_header) {
unregister_net_sysctl_table(llc_station_header);
llc_station_header = NULL;
}
}
| @@ -18,28 +18,28 @@ static struct ctl_table llc2_timeout_table[] = {
{
.procname = "ack",
.data = &sysctl_llc2_ack_timeout,
- .maxlen = sizeof(long),
+ .maxlen = sizeof(sysctl_llc2_ack_timeout),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
},
{
.procname = "busy",
.data = &sysct... | CWE-17 | null | null |
35,236 | int __init llc_sysctl_init(void)
{
llc2_timeout_header = register_net_sysctl(&init_net, "net/llc/llc2/timeout", llc2_timeout_table);
llc_station_header = register_net_sysctl(&init_net, "net/llc/station", llc_station_table);
if (!llc2_timeout_header || !llc_station_header) {
llc_sysctl_exit();
return -ENOMEM;
}... | +Info | 0 | int __init llc_sysctl_init(void)
{
llc2_timeout_header = register_net_sysctl(&init_net, "net/llc/llc2/timeout", llc2_timeout_table);
llc_station_header = register_net_sysctl(&init_net, "net/llc/station", llc_station_table);
if (!llc2_timeout_header || !llc_station_header) {
llc_sysctl_exit();
return -ENOMEM;
}... | @@ -18,28 +18,28 @@ static struct ctl_table llc2_timeout_table[] = {
{
.procname = "ack",
.data = &sysctl_llc2_ack_timeout,
- .maxlen = sizeof(long),
+ .maxlen = sizeof(sysctl_llc2_ack_timeout),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
},
{
.procname = "busy",
.data = &sysct... | CWE-17 | null | null |
35,237 | static inline bool TRACKING_CHANGES(xmlNode *xml)
{
if(xml == NULL || xml->doc == NULL || xml->doc->_private == NULL) {
return FALSE;
} else if(is_set(((xml_private_t *)xml->doc->_private)->flags, xpf_tracking)) {
return TRUE;
}
return FALSE;
}
| +Priv | 0 | static inline bool TRACKING_CHANGES(xmlNode *xml)
{
if(xml == NULL || xml->doc == NULL || xml->doc->_private == 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,238 | __add_xml_object(xmlNode * parent, xmlNode * target, xmlNode * patch)
{
xmlNode *patch_child = NULL;
xmlNode *target_child = NULL;
xmlAttrPtr xIter = NULL;
const char *id = NULL;
const char *name = NULL;
const char *value = NULL;
if (patch == NULL) {
return;
} else if (parent =... | +Priv | 0 | __add_xml_object(xmlNode * parent, xmlNode * target, xmlNode * patch)
{
xmlNode *patch_child = NULL;
xmlNode *target_child = NULL;
xmlAttrPtr xIter = NULL;
const char *id = NULL;
const char *name = NULL;
const char *value = NULL;
if (patch == NULL) {
return;
} else if (parent =... | @@ -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,239 | __first_xml_child_match(xmlNode *parent, const char *name, const char *id)
{
xmlNode *cIter = NULL;
for (cIter = __xml_first_child(parent); cIter != NULL; cIter = __xml_next(cIter)) {
if(strcmp((const char *)cIter->name, name) != 0) {
continue;
} else if(id) {
const char... | +Priv | 0 | __first_xml_child_match(xmlNode *parent, const char *name, const char *id)
{
xmlNode *cIter = NULL;
for (cIter = __xml_first_child(parent); cIter != NULL; cIter = __xml_next(cIter)) {
if(strcmp((const char *)cIter->name, name) != 0) {
continue;
} else if(id) {
const char... | @@ -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,240 | __get_prefix(const char *prefix, xmlNode *xml, char *buffer, int offset)
{
const char *id = ID(xml);
if(offset == 0 && prefix == NULL && xml->parent) {
offset = __get_prefix(NULL, xml->parent, buffer, offset);
}
if(id) {
offset += snprintf(buffer + offset, XML_BUFFER_SIZE - offset, "/%... | +Priv | 0 | __get_prefix(const char *prefix, xmlNode *xml, char *buffer, int offset)
{
const char *id = ID(xml);
if(offset == 0 && prefix == NULL && xml->parent) {
offset = __get_prefix(NULL, xml->parent, buffer, offset);
}
if(id) {
offset += snprintf(buffer + offset, XML_BUFFER_SIZE - offset, "/%... | @@ -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,241 | __subtract_xml_object(xmlNode * target, xmlNode * patch)
{
xmlNode *patch_child = NULL;
xmlNode *cIter = NULL;
xmlAttrPtr xIter = NULL;
char *id = NULL;
const char *name = NULL;
const char *value = NULL;
if (target == NULL || patch == NULL) {
return;
}
if (target->type == ... | +Priv | 0 | __subtract_xml_object(xmlNode * target, xmlNode * patch)
{
xmlNode *patch_child = NULL;
xmlNode *cIter = NULL;
xmlAttrPtr xIter = NULL;
char *id = NULL;
const char *name = NULL;
const char *value = NULL;
if (target == NULL || patch == NULL) {
return;
}
if (target->type == ... | @@ -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,242 | __xml_accept_changes(xmlNode * xml)
{
xmlNode *cIter = NULL;
xmlAttr *pIter = NULL;
xml_private_t *p = xml->_private;
p->flags = xpf_none;
pIter = crm_first_attr(xml);
while (pIter != NULL) {
const xmlChar *name = pIter->name;
p = pIter->_private;
pIter = pIter->next;
... | +Priv | 0 | __xml_accept_changes(xmlNode * xml)
{
xmlNode *cIter = NULL;
xmlAttr *pIter = NULL;
xml_private_t *p = xml->_private;
p->flags = xpf_none;
pIter = crm_first_attr(xml);
while (pIter != NULL) {
const xmlChar *name = pIter->name;
p = pIter->_private;
pIter = pIter->next;
... | @@ -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,243 | __xml_acl_apply(xmlNode *xml)
{
GListPtr aIter = NULL;
xml_private_t *p = NULL;
xmlXPathObjectPtr xpathObj = NULL;
if(xml_acl_enabled(xml) == FALSE) {
p = xml->doc->_private;
crm_trace("Not applying ACLs for %s", p->user);
return;
}
p = xml->doc->_private;
for(aIte... | +Priv | 0 | __xml_acl_apply(xmlNode *xml)
{
GListPtr aIter = NULL;
xml_private_t *p = NULL;
xmlXPathObjectPtr xpathObj = NULL;
if(xml_acl_enabled(xml) == FALSE) {
p = xml->doc->_private;
crm_trace("Not applying ACLs for %s", p->user);
return;
}
p = xml->doc->_private;
for(aIte... | @@ -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,244 | __xml_acl_check(xmlNode *xml, const char *name, enum xml_private_flags mode)
{
CRM_ASSERT(xml);
CRM_ASSERT(xml->doc);
CRM_ASSERT(xml->doc->_private);
#if ENABLE_ACL
{
if(TRACKING_CHANGES(xml) && xml_acl_enabled(xml)) {
int offset = 0;
xmlNode *parent = xml;
c... | +Priv | 0 | __xml_acl_check(xmlNode *xml, const char *name, enum xml_private_flags mode)
{
CRM_ASSERT(xml);
CRM_ASSERT(xml->doc);
CRM_ASSERT(xml->doc->_private);
#if ENABLE_ACL
{
if(TRACKING_CHANGES(xml) && xml_acl_enabled(xml)) {
int offset = 0;
xmlNode *parent = xml;
c... | @@ -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,245 | __xml_acl_create(xmlNode * xml, xmlNode *target, enum xml_private_flags mode)
{
xml_acl_t *acl = NULL;
xml_private_t *p = NULL;
const char *tag = crm_element_value(xml, XML_ACL_ATTR_TAG);
const char *ref = crm_element_value(xml, XML_ACL_ATTR_REF);
const char *xpath = crm_element_value(xml, XML_ACL_... | +Priv | 0 | __xml_acl_create(xmlNode * xml, xmlNode *target, enum xml_private_flags mode)
{
xml_acl_t *acl = NULL;
xml_private_t *p = NULL;
const char *tag = crm_element_value(xml, XML_ACL_ATTR_TAG);
const char *ref = crm_element_value(xml, XML_ACL_ATTR_REF);
const char *xpath = crm_element_value(xml, XML_ACL_... | @@ -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,246 | __xml_acl_free(void *data)
{
if(data) {
xml_acl_t *acl = data;
free(acl->xpath);
free(acl);
}
}
| +Priv | 0 | __xml_acl_free(void *data)
{
if(data) {
xml_acl_t *acl = data;
free(acl->xpath);
free(acl);
}
}
| @@ -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,247 | __xml_acl_mode_test(enum xml_private_flags allowed, enum xml_private_flags requested)
{
if(is_set(allowed, xpf_acl_deny)) {
return FALSE;
} else if(is_set(allowed, requested)) {
return TRUE;
} else if(is_set(requested, xpf_acl_read) && is_set(allowed, xpf_acl_write)) {
return TRUE;... | +Priv | 0 | __xml_acl_mode_test(enum xml_private_flags allowed, enum xml_private_flags requested)
{
if(is_set(allowed, xpf_acl_deny)) {
return FALSE;
} else if(is_set(allowed, requested)) {
return TRUE;
} else if(is_set(requested, xpf_acl_read) && is_set(allowed, xpf_acl_write)) {
return TRUE;... | @@ -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,248 | __xml_acl_parse_entry(xmlNode * acl_top, xmlNode * acl_entry, xmlNode *target)
{
xmlNode *child = NULL;
for (child = __xml_first_child(acl_entry); child; child = __xml_next(child)) {
const char *tag = crm_element_name(child);
const char *kind = crm_element_value(child, XML_ACL_ATTR_KIND);
... | +Priv | 0 | __xml_acl_parse_entry(xmlNode * acl_top, xmlNode * acl_entry, xmlNode *target)
{
xmlNode *child = NULL;
for (child = __xml_first_child(acl_entry); child; child = __xml_next(child)) {
const char *tag = crm_element_name(child);
const char *kind = crm_element_value(child, XML_ACL_ATTR_KIND);
... | @@ -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,249 | __xml_acl_to_text(enum xml_private_flags flags)
{
if(is_set(flags, xpf_acl_deny)) {
return "deny";
}
if(is_set(flags, xpf_acl_write)) {
return "read/write";
}
if(is_set(flags, xpf_acl_read)) {
return "read";
}
return "none";
}
| +Priv | 0 | __xml_acl_to_text(enum xml_private_flags flags)
{
if(is_set(flags, xpf_acl_deny)) {
return "deny";
}
if(is_set(flags, xpf_acl_write)) {
return "read/write";
}
if(is_set(flags, xpf_acl_read)) {
return "read";
}
return "none";
}
| @@ -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,250 | __xml_acl_unpack(xmlNode *source, xmlNode *target, const char *user)
{
#if ENABLE_ACL
xml_private_t *p = NULL;
if(target == NULL || target->doc == NULL || target->doc->_private == NULL) {
return;
}
p = target->doc->_private;
if(pcmk_acl_required(user) == FALSE) {
crm_trace("no acls... | +Priv | 0 | __xml_acl_unpack(xmlNode *source, xmlNode *target, const char *user)
{
#if ENABLE_ACL
xml_private_t *p = NULL;
if(target == NULL || target->doc == NULL || target->doc->_private == NULL) {
return;
}
p = target->doc->_private;
if(pcmk_acl_required(user) == FALSE) {
crm_trace("no acls... | @@ -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,251 | static int __xml_build_schema_list(void)
{
int lpc, max;
const char *base = get_schema_root();
struct dirent **namelist = NULL;
max = scandir(base, &namelist, schema_filter, schema_sort);
__xml_schema_add(1, 0.0, "pacemaker-0.6", "crm.dtd", "upgrade06.xsl", 3);
__xml_schema_add(1, 0.0, "transi... | +Priv | 0 | static int __xml_build_schema_list(void)
{
int lpc, max;
const char *base = get_schema_root();
struct dirent **namelist = NULL;
max = scandir(base, &namelist, schema_filter, schema_sort);
__xml_schema_add(1, 0.0, "pacemaker-0.6", "crm.dtd", "upgrade06.xsl", 3);
__xml_schema_add(1, 0.0, "transi... | @@ -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,252 | __xml_diff_object(xmlNode * old, xmlNode * new)
{
xmlNode *cIter = NULL;
xmlAttr *pIter = NULL;
CRM_CHECK(new != NULL, return);
if(old == NULL) {
crm_node_created(new);
__xml_acl_post_process(new); /* Check creation is allowed */
return;
} else {
xml_private_t *p = ... | +Priv | 0 | __xml_diff_object(xmlNode * old, xmlNode * new)
{
xmlNode *cIter = NULL;
xmlAttr *pIter = NULL;
CRM_CHECK(new != NULL, return);
if(old == NULL) {
crm_node_created(new);
__xml_acl_post_process(new); /* Check creation is allowed */
return;
} else {
xml_private_t *p = ... | @@ -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,253 | __xml_find_path(xmlNode *top, const char *key)
{
xmlNode *target = (xmlNode*)top->doc;
char *id = malloc(XML_BUFFER_SIZE);
char *tag = malloc(XML_BUFFER_SIZE);
char *section = malloc(XML_BUFFER_SIZE);
char *current = strdup(key);
char *remainder = malloc(XML_BUFFER_SIZE);
int rc = 0;
wh... | +Priv | 0 | __xml_find_path(xmlNode *top, const char *key)
{
xmlNode *target = (xmlNode*)top->doc;
char *id = malloc(XML_BUFFER_SIZE);
char *tag = malloc(XML_BUFFER_SIZE);
char *section = malloc(XML_BUFFER_SIZE);
char *current = strdup(key);
char *remainder = malloc(XML_BUFFER_SIZE);
int rc = 0;
wh... | @@ -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,254 | __xml_log_change_element(int log_level, const char *file, const char *function, int line,
const char *prefix, xmlNode * data, int depth, int options)
{
xml_private_t *p;
char *prefix_m = NULL;
xmlNode *child = NULL;
xmlAttrPtr pIter = NULL;
if(data == NULL) {
return... | +Priv | 0 | __xml_log_change_element(int log_level, const char *file, const char *function, int line,
const char *prefix, xmlNode * data, int depth, int options)
{
xml_private_t *p;
char *prefix_m = NULL;
xmlNode *child = NULL;
xmlAttrPtr pIter = NULL;
if(data == NULL) {
return... | @@ -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,255 | __xml_node_clean(xmlNode *xml)
{
xmlNode *cIter = NULL;
xml_private_t *p = xml->_private;
if(p) {
p->flags = 0;
}
for (cIter = __xml_first_child(xml); cIter != NULL; cIter = __xml_next(cIter)) {
__xml_node_clean(cIter);
}
}
| +Priv | 0 | __xml_node_clean(xmlNode *xml)
{
xmlNode *cIter = NULL;
xml_private_t *p = xml->_private;
if(p) {
p->flags = 0;
}
for (cIter = __xml_first_child(xml); cIter != NULL; cIter = __xml_next(cIter)) {
__xml_node_clean(cIter);
}
}
| @@ -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,256 | __xml_node_dirty(xmlNode *xml)
{
set_doc_flag(xml, xpf_dirty);
set_parent_flag(xml, xpf_dirty);
}
| +Priv | 0 | __xml_node_dirty(xmlNode *xml)
{
set_doc_flag(xml, xpf_dirty);
set_parent_flag(xml, xpf_dirty);
}
| @@ -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,257 | static int __xml_offset(xmlNode *xml)
{
int position = 0;
xmlNode *cIter = NULL;
for(cIter = xml; cIter->prev; cIter = cIter->prev) {
xml_private_t *p = ((xmlNode*)cIter->prev)->_private;
if(is_not_set(p->flags, xpf_skip)) {
position++;
}
}
return position;
}
| +Priv | 0 | static int __xml_offset(xmlNode *xml)
{
int position = 0;
xmlNode *cIter = NULL;
for(cIter = xml; cIter->prev; cIter = cIter->prev) {
xml_private_t *p = ((xmlNode*)cIter->prev)->_private;
if(is_not_set(p->flags, xpf_skip)) {
position++;
}
}
return position;
}
| @@ -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,258 | static int __xml_offset_no_deletions(xmlNode *xml)
{
int position = 0;
xmlNode *cIter = NULL;
for(cIter = xml; cIter->prev; cIter = cIter->prev) {
xml_private_t *p = ((xmlNode*)cIter->prev)->_private;
if(is_not_set(p->flags, xpf_deleted)) {
position++;
}
}
ret... | +Priv | 0 | static int __xml_offset_no_deletions(xmlNode *xml)
{
int position = 0;
xmlNode *cIter = NULL;
for(cIter = xml; cIter->prev; cIter = cIter->prev) {
xml_private_t *p = ((xmlNode*)cIter->prev)->_private;
if(is_not_set(p->flags, xpf_deleted)) {
position++;
}
}
ret... | @@ -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,259 | __xml_private_free(xml_private_t *p)
{
__xml_private_clean(p);
free(p);
}
| +Priv | 0 | __xml_private_free(xml_private_t *p)
{
__xml_private_clean(p);
free(p);
}
| @@ -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,260 | __xml_purge_attributes(xmlNode *xml)
{
xmlNode *child = NULL;
xmlAttr *xIter = NULL;
bool readable_children = FALSE;
xml_private_t *p = xml->_private;
if(__xml_acl_mode_test(p->flags, xpf_acl_read)) {
crm_trace("%s is readable", crm_element_name(xml), ID(xml));
return TRUE;
}
... | +Priv | 0 | __xml_purge_attributes(xmlNode *xml)
{
xmlNode *child = NULL;
xmlAttr *xIter = NULL;
bool readable_children = FALSE;
xml_private_t *p = xml->_private;
if(__xml_acl_mode_test(p->flags, xpf_acl_read)) {
crm_trace("%s is readable", crm_element_name(xml), ID(xml));
return TRUE;
}
... | @@ -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,261 | static void __xml_schema_add(
int type, float version, const char *name, const char *location, const char *transform, int after_transform)
{
int last = xml_schema_max;
xml_schema_max++;
known_schemas = realloc_safe(known_schemas, xml_schema_max*sizeof(struct schema_s));
CRM_ASSERT(known_schemas != ... | +Priv | 0 | static void __xml_schema_add(
int type, float version, const char *name, const char *location, const char *transform, int after_transform)
{
int last = xml_schema_max;
xml_schema_max++;
known_schemas = realloc_safe(known_schemas, xml_schema_max*sizeof(struct schema_s));
CRM_ASSERT(known_schemas != ... | @@ -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,262 | add_message_xml(xmlNode * msg, const char *field, xmlNode * xml)
{
xmlNode *holder = create_xml_node(msg, field);
add_node_copy(holder, xml);
return TRUE;
}
| +Priv | 0 | add_message_xml(xmlNode * msg, const char *field, xmlNode * xml)
{
xmlNode *holder = create_xml_node(msg, field);
add_node_copy(holder, xml);
return TRUE;
}
| @@ -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,263 | add_node_copy(xmlNode * parent, xmlNode * src_node)
{
xmlNode *child = NULL;
xmlDoc *doc = getDocPtr(parent);
CRM_CHECK(src_node != NULL, return NULL);
child = xmlDocCopyNode(src_node, doc, 1);
xmlAddChild(parent, child);
crm_node_created(child);
return child;
}
| +Priv | 0 | add_node_copy(xmlNode * parent, xmlNode * src_node)
{
xmlNode *child = NULL;
xmlDoc *doc = getDocPtr(parent);
CRM_CHECK(src_node != NULL, return NULL);
child = xmlDocCopyNode(src_node, doc, 1);
xmlAddChild(parent, child);
crm_node_created(child);
return 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,264 | add_node_nocopy(xmlNode * parent, const char *name, xmlNode * child)
{
add_node_copy(parent, child);
free_xml(child);
return 1;
}
| +Priv | 0 | add_node_nocopy(xmlNode * parent, const char *name, xmlNode * child)
{
add_node_copy(parent, child);
free_xml(child);
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,265 | add_xml_comment(xmlNode * parent, xmlNode * target, xmlNode * update)
{
CRM_CHECK(update != NULL, return 0);
CRM_CHECK(update->type == XML_COMMENT_NODE, return 0);
if (target == NULL) {
target = find_xml_comment(parent, update);
}
if (target == NULL) {
add_node_copy(parent, up... | +Priv | 0 | add_xml_comment(xmlNode * parent, xmlNode * target, xmlNode * update)
{
CRM_CHECK(update != NULL, return 0);
CRM_CHECK(update->type == XML_COMMENT_NODE, return 0);
if (target == NULL) {
target = find_xml_comment(parent, update);
}
if (target == NULL) {
add_node_copy(parent, up... | @@ -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,266 | add_xml_object(xmlNode * parent, xmlNode * target, xmlNode * update, gboolean as_diff)
{
xmlNode *a_child = NULL;
const char *object_id = NULL;
const char *object_name = NULL;
#if XML_PARSE_DEBUG
crm_log_xml_trace("update:", update);
crm_log_xml_trace("target:", target);
#endif
CRM_CHECK(updat... | +Priv | 0 | add_xml_object(xmlNode * parent, xmlNode * target, xmlNode * update, gboolean as_diff)
{
xmlNode *a_child = NULL;
const char *object_id = NULL;
const char *object_name = NULL;
#if XML_PARSE_DEBUG
crm_log_xml_trace("update:", update);
crm_log_xml_trace("target:", target);
#endif
CRM_CHECK(updat... | @@ -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,267 | apply_transformation(xmlNode * xml, const char *transform)
{
char *xform = NULL;
xmlNode *out = NULL;
xmlDocPtr res = NULL;
xmlDocPtr doc = NULL;
xsltStylesheet *xslt = NULL;
CRM_CHECK(xml != NULL, return FALSE);
doc = getDocPtr(xml);
xform = get_schema_path(NULL, transform);
xmlLo... | +Priv | 0 | apply_transformation(xmlNode * xml, const char *transform)
{
char *xform = NULL;
xmlNode *out = NULL;
xmlDocPtr res = NULL;
xmlDocPtr doc = NULL;
xsltStylesheet *xslt = NULL;
CRM_CHECK(xml != NULL, return FALSE);
doc = getDocPtr(xml);
xform = get_schema_path(NULL, transform);
xmlLo... | @@ -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,268 | apply_xml_diff(xmlNode * old, xmlNode * diff, xmlNode ** new)
{
gboolean result = TRUE;
int root_nodes_seen = 0;
static struct qb_log_callsite *digest_cs = NULL;
const char *digest = crm_element_value(diff, XML_ATTR_DIGEST);
const char *version = crm_element_value(diff, XML_ATTR_CRM_VERSION);
x... | +Priv | 0 | apply_xml_diff(xmlNode * old, xmlNode * diff, xmlNode ** new)
{
gboolean result = TRUE;
int root_nodes_seen = 0;
static struct qb_log_callsite *digest_cs = NULL;
const char *digest = crm_element_value(diff, XML_ATTR_DIGEST);
const char *version = crm_element_value(diff, XML_ATTR_CRM_VERSION);
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,269 | cli_config_update(xmlNode ** xml, int *best_version, gboolean to_logs)
{
gboolean rc = TRUE;
const char *value = crm_element_value(*xml, XML_ATTR_VALIDATION);
int version = get_schema_version(value);
int min_version = xml_minimum_schema_index();
if (version < min_version) {
xmlNode *conver... | +Priv | 0 | cli_config_update(xmlNode ** xml, int *best_version, gboolean to_logs)
{
gboolean rc = TRUE;
const char *value = crm_element_value(*xml, XML_ATTR_VALIDATION);
int version = get_schema_version(value);
int min_version = xml_minimum_schema_index();
if (version < min_version) {
xmlNode *conver... | @@ -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,270 | copy_in_properties(xmlNode * target, xmlNode * src)
{
if (src == NULL) {
crm_warn("No node to copy properties from");
} else if (target == NULL) {
crm_err("No node to copy properties into");
} else {
xmlAttrPtr pIter = NULL;
for (pIter = crm_first_attr(src); pIter != NULL;... | +Priv | 0 | copy_in_properties(xmlNode * target, xmlNode * src)
{
if (src == NULL) {
crm_warn("No node to copy properties from");
} else if (target == NULL) {
crm_err("No node to copy properties into");
} else {
xmlAttrPtr pIter = NULL;
for (pIter = crm_first_attr(src); pIter != 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,271 | copy_xml(xmlNode * src)
{
xmlDoc *doc = xmlNewDoc((const xmlChar *)"1.0");
xmlNode *copy = xmlDocCopyNode(src, doc, 1);
xmlDocSetRootElement(doc, copy);
xmlSetTreeDoc(copy, doc);
return copy;
}
| +Priv | 0 | copy_xml(xmlNode * src)
{
xmlDoc *doc = xmlNewDoc((const xmlChar *)"1.0");
xmlNode *copy = xmlDocCopyNode(src, doc, 1);
xmlDocSetRootElement(doc, copy);
xmlSetTreeDoc(copy, doc);
return copy;
}
| @@ -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,272 | crm_attr_value(xmlAttr * attr)
{
if (attr == NULL || attr->children == NULL) {
return NULL;
}
return (const char *)attr->children->content;
}
| +Priv | 0 | crm_attr_value(xmlAttr * attr)
{
if (attr == NULL || attr->children == NULL) {
return NULL;
}
return (const char *)attr->children->content;
}
| @@ -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,273 | crm_buffer_add_char(char **buffer, int *offset, int *max, char c)
{
buffer_print(*buffer, *max, *offset, "%c", c);
}
| +Priv | 0 | crm_buffer_add_char(char **buffer, int *offset, int *max, char c)
{
buffer_print(*buffer, *max, *offset, "%c", c);
}
| @@ -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,274 | crm_element_value(xmlNode * data, const char *name)
{
xmlAttr *attr = NULL;
if (data == NULL) {
crm_err("Couldn't find %s in NULL", name ? name : "<null>");
CRM_LOG_ASSERT(data != NULL);
return NULL;
} else if (name == NULL) {
crm_err("Couldn't find NULL in %s", crm_element... | +Priv | 0 | crm_element_value(xmlNode * data, const char *name)
{
xmlAttr *attr = NULL;
if (data == NULL) {
crm_err("Couldn't find %s in NULL", name ? name : "<null>");
CRM_LOG_ASSERT(data != NULL);
return NULL;
} else if (name == NULL) {
crm_err("Couldn't find NULL in %s", 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,275 | crm_element_value_copy(xmlNode * data, const char *name)
{
char *value_copy = NULL;
const char *value = crm_element_value(data, name);
if (value != NULL) {
value_copy = strdup(value);
}
return value_copy;
}
| +Priv | 0 | crm_element_value_copy(xmlNode * data, const char *name)
{
char *value_copy = NULL;
const char *value = crm_element_value(data, name);
if (value != NULL) {
value_copy = strdup(value);
}
return value_copy;
}
| @@ -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,276 | crm_element_value_int(xmlNode * data, const char *name, int *dest)
{
const char *value = crm_element_value(data, name);
CRM_CHECK(dest != NULL, return -1);
if (value) {
*dest = crm_int_helper(value, NULL);
return 0;
}
return -1;
}
| +Priv | 0 | crm_element_value_int(xmlNode * data, const char *name, int *dest)
{
const char *value = crm_element_value(data, name);
CRM_CHECK(dest != NULL, return -1);
if (value) {
*dest = crm_int_helper(value, NULL);
return 0;
}
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,277 | crm_first_attr(xmlNode * xml)
{
if (xml == NULL) {
return NULL;
}
return xml->properties;
}
| +Priv | 0 | crm_first_attr(xmlNode * xml)
{
if (xml == NULL) {
return NULL;
}
return xml->properties;
}
| @@ -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,278 | crm_node_created(xmlNode *xml)
{
xmlNode *cIter = NULL;
xml_private_t *p = xml->_private;
if(p && TRACKING_CHANGES(xml)) {
if(is_not_set(p->flags, xpf_created)) {
p->flags |= xpf_created;
__xml_node_dirty(xml);
}
for (cIter = __xml_first_child(xml); cIter !... | +Priv | 0 | crm_node_created(xmlNode *xml)
{
xmlNode *cIter = NULL;
xml_private_t *p = xml->_private;
if(p && TRACKING_CHANGES(xml)) {
if(is_not_set(p->flags, xpf_created)) {
p->flags |= xpf_created;
__xml_node_dirty(xml);
}
for (cIter = __xml_first_child(xml); cIter !... | @@ -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,279 | crm_xml_add(xmlNode * node, const char *name, const char *value)
{
bool dirty = FALSE;
xmlAttr *attr = NULL;
CRM_CHECK(node != NULL, return NULL);
CRM_CHECK(name != NULL, return NULL);
if (value == NULL) {
return NULL;
}
#if XML_PARANOIA_CHECKS
{
const char *old_value = NUL... | +Priv | 0 | crm_xml_add(xmlNode * node, const char *name, const char *value)
{
bool dirty = FALSE;
xmlAttr *attr = NULL;
CRM_CHECK(node != NULL, return NULL);
CRM_CHECK(name != NULL, return NULL);
if (value == NULL) {
return NULL;
}
#if XML_PARANOIA_CHECKS
{
const char *old_value = 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,280 | crm_xml_add_int(xmlNode * node, const char *name, int value)
{
char *number = crm_itoa(value);
const char *added = crm_xml_add(node, name, number);
free(number);
return added;
}
| +Priv | 0 | crm_xml_add_int(xmlNode * node, const char *name, int value)
{
char *number = crm_itoa(value);
const char *added = crm_xml_add(node, name, number);
free(number);
return added;
}
| @@ -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,281 | crm_xml_err(void *ctx, const char *msg, ...)
{
int len = 0;
va_list args;
char *buf = NULL;
static int buffer_len = 0;
static char *buffer = NULL;
static struct qb_log_callsite *xml_error_cs = NULL;
va_start(args, msg);
len = vasprintf(&buf, msg, args);
if(xml_error_cs == NULL) {
... | +Priv | 0 | crm_xml_err(void *ctx, const char *msg, ...)
{
int len = 0;
va_list args;
char *buf = NULL;
static int buffer_len = 0;
static char *buffer = NULL;
static struct qb_log_callsite *xml_error_cs = NULL;
va_start(args, msg);
len = vasprintf(&buf, msg, args);
if(xml_error_cs == 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,282 | crm_xml_escape(const char *text)
{
int index;
int changes = 0;
int length = 1 + strlen(text);
char *copy = strdup(text);
/*
* When xmlCtxtReadDoc() parses < and friends in a
* value, it converts them to their human readable
* form.
*
* If one uses xmlNodeDump() to conver... | +Priv | 0 | crm_xml_escape(const char *text)
{
int index;
int changes = 0;
int length = 1 + strlen(text);
char *copy = strdup(text);
/*
* When xmlCtxtReadDoc() parses < and friends in a
* value, it converts them to their human readable
* form.
*
* If one uses xmlNodeDump() to conver... | @@ -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,283 | crm_xml_escape_shuffle(char *text, int start, int *length, const char *replace)
{
int lpc;
int offset = strlen(replace) - 1; /* We have space for 1 char already */
*length += offset;
text = realloc_safe(text, *length);
for (lpc = (*length) - 1; lpc > (start + offset); lpc--) {
text[lpc] ... | +Priv | 0 | crm_xml_escape_shuffle(char *text, int start, int *length, const char *replace)
{
int lpc;
int offset = strlen(replace) - 1; /* We have space for 1 char already */
*length += offset;
text = realloc_safe(text, *length);
for (lpc = (*length) - 1; lpc > (start + offset); lpc--) {
text[lpc] ... | @@ -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,284 | crm_xml_replace(xmlNode * node, const char *name, const char *value)
{
bool dirty = FALSE;
xmlAttr *attr = NULL;
const char *old_value = NULL;
CRM_CHECK(node != NULL, return NULL);
CRM_CHECK(name != NULL && name[0] != 0, return NULL);
old_value = crm_element_value(node, name);
/* Could be... | +Priv | 0 | crm_xml_replace(xmlNode * node, const char *name, const char *value)
{
bool dirty = FALSE;
xmlAttr *attr = NULL;
const char *old_value = NULL;
CRM_CHECK(node != NULL, return NULL);
CRM_CHECK(name != NULL && name[0] != 0, return NULL);
old_value = crm_element_value(node, name);
/* Could be... | @@ -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,285 | diff_xml_object(xmlNode * old, xmlNode * new, gboolean suppress)
{
xmlNode *tmp1 = NULL;
xmlNode *diff = create_xml_node(NULL, "diff");
xmlNode *removed = create_xml_node(diff, "diff-removed");
xmlNode *added = create_xml_node(diff, "diff-added");
crm_xml_add(diff, XML_ATTR_CRM_VERSION, CRM_FEATURE... | +Priv | 0 | diff_xml_object(xmlNode * old, xmlNode * new, gboolean suppress)
{
xmlNode *tmp1 = NULL;
xmlNode *diff = create_xml_node(NULL, "diff");
xmlNode *removed = create_xml_node(diff, "diff-removed");
xmlNode *added = create_xml_node(diff, "diff-added");
crm_xml_add(diff, XML_ATTR_CRM_VERSION, CRM_FEATURE... | @@ -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,286 | dump_filtered_xml(xmlNode * data, int options, char **buffer, int *offset, int *max)
{
int lpc;
xmlAttrPtr xIter = NULL;
static int filter_len = DIMOF(filter);
for (lpc = 0; options && lpc < filter_len; lpc++) {
filter[lpc].found = FALSE;
}
for (xIter = crm_first_attr(data); xIter != N... | +Priv | 0 | dump_filtered_xml(xmlNode * data, int options, char **buffer, int *offset, int *max)
{
int lpc;
xmlAttrPtr xIter = NULL;
static int filter_len = DIMOF(filter);
for (lpc = 0; options && lpc < filter_len; lpc++) {
filter[lpc].found = FALSE;
}
for (xIter = crm_first_attr(data); xIter != 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,287 | dump_pair(gpointer data, gpointer user_data)
{
name_value_t *pair = data;
xmlNode *parent = user_data;
crm_xml_add(parent, pair->name, pair->value);
}
| +Priv | 0 | dump_pair(gpointer data, gpointer user_data)
{
name_value_t *pair = data;
xmlNode *parent = user_data;
crm_xml_add(parent, pair->name, pair->value);
}
| @@ -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,288 | dump_xml_attr(xmlAttrPtr attr, int options, char **buffer, int *offset, int *max)
{
char *p_value = NULL;
const char *p_name = NULL;
CRM_ASSERT(buffer != NULL);
if (attr == NULL || attr->children == NULL) {
return;
}
p_name = (const char *)attr->name;
p_value = crm_xml_escape((cons... | +Priv | 0 | dump_xml_attr(xmlAttrPtr attr, int options, char **buffer, int *offset, int *max)
{
char *p_value = NULL;
const char *p_name = NULL;
CRM_ASSERT(buffer != NULL);
if (attr == NULL || attr->children == NULL) {
return;
}
p_name = (const char *)attr->name;
p_value = crm_xml_escape((cons... | @@ -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,289 | dump_xml_comment(xmlNode * data, int options, char **buffer, int *offset, int *max, int depth)
{
CRM_ASSERT(max != NULL);
CRM_ASSERT(offset != NULL);
CRM_ASSERT(buffer != NULL);
if (data == NULL) {
crm_trace("Nothing to dump");
return;
}
if (*buffer == NULL) {
*offset =... | +Priv | 0 | dump_xml_comment(xmlNode * data, int options, char **buffer, int *offset, int *max, int depth)
{
CRM_ASSERT(max != NULL);
CRM_ASSERT(offset != NULL);
CRM_ASSERT(buffer != NULL);
if (data == NULL) {
crm_trace("Nothing to dump");
return;
}
if (*buffer == NULL) {
*offset =... | @@ -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,290 | dump_xml_unformatted(xmlNode * an_xml_node)
{
char *buffer = NULL;
int offset = 0, max = 0;
crm_xml_dump(an_xml_node, 0, &buffer, &offset, &max, 0);
return buffer;
}
| +Priv | 0 | dump_xml_unformatted(xmlNode * an_xml_node)
{
char *buffer = NULL;
int offset = 0, max = 0;
crm_xml_dump(an_xml_node, 0, &buffer, &offset, &max, 0);
return buffer;
}
| @@ -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,291 | expand_idref(xmlNode * input, xmlNode * top)
{
const char *tag = NULL;
const char *ref = NULL;
xmlNode *result = input;
char *xpath_string = NULL;
if (result == NULL) {
return NULL;
} else if (top == NULL) {
top = input;
}
tag = crm_element_name(result);
ref = crm_... | +Priv | 0 | expand_idref(xmlNode * input, xmlNode * top)
{
const char *tag = NULL;
const char *ref = NULL;
xmlNode *result = input;
char *xpath_string = NULL;
if (result == NULL) {
return NULL;
} else if (top == NULL) {
top = input;
}
tag = crm_element_name(result);
ref = 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,292 | expand_plus_plus(xmlNode * target, const char *name, const char *value)
{
int offset = 1;
int name_len = 0;
int int_value = 0;
int value_len = 0;
const char *old_value = NULL;
if (value == NULL || name == NULL) {
return;
}
old_value = crm_element_value(target, name);
if (... | +Priv | 0 | expand_plus_plus(xmlNode * target, const char *name, const char *value)
{
int offset = 1;
int name_len = 0;
int int_value = 0;
int value_len = 0;
const char *old_value = NULL;
if (value == NULL || name == NULL) {
return;
}
old_value = crm_element_value(target, 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,293 | filename2xml(const char *filename)
{
xmlNode *xml = NULL;
xmlDocPtr output = NULL;
const char *match = NULL;
xmlParserCtxtPtr ctxt = NULL;
xmlErrorPtr last_error = NULL;
static int xml_options = XML_PARSE_NOBLANKS | XML_PARSE_RECOVER;
/* create a parser context */
ctxt = xmlNewParserCtx... | +Priv | 0 | filename2xml(const char *filename)
{
xmlNode *xml = NULL;
xmlDocPtr output = NULL;
const char *match = NULL;
xmlParserCtxtPtr ctxt = NULL;
xmlErrorPtr last_error = NULL;
static int xml_options = XML_PARSE_NOBLANKS | XML_PARSE_RECOVER;
/* create a parser context */
ctxt = xmlNewParserCtx... | @@ -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,294 | find_entity(xmlNode * parent, const char *node_name, const char *id)
{
xmlNode *a_child = NULL;
for (a_child = __xml_first_child(parent); a_child != NULL; a_child = __xml_next(a_child)) {
/* Uncertain if node_name == NULL check is strictly necessary here */
if (node_name == NULL || strcmp((cons... | +Priv | 0 | find_entity(xmlNode * parent, const char *node_name, const char *id)
{
xmlNode *a_child = NULL;
for (a_child = __xml_first_child(parent); a_child != NULL; a_child = __xml_next(a_child)) {
/* Uncertain if node_name == NULL check is strictly necessary here */
if (node_name == NULL || strcmp((cons... | @@ -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,295 | find_xml_children(xmlNode ** children, xmlNode * root,
const char *tag, const char *field, const char *value, gboolean search_matches)
{
int match_found = 0;
CRM_CHECK(root != NULL, return FALSE);
CRM_CHECK(children != NULL, return FALSE);
if (tag != NULL && safe_str_neq(tag, crm_ele... | +Priv | 0 | find_xml_children(xmlNode ** children, xmlNode * root,
const char *tag, const char *field, const char *value, gboolean search_matches)
{
int match_found = 0;
CRM_CHECK(root != NULL, return FALSE);
CRM_CHECK(children != NULL, return FALSE);
if (tag != NULL && safe_str_neq(tag, crm_ele... | @@ -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,296 | find_xml_comment(xmlNode * root, xmlNode * search_comment)
{
xmlNode *a_child = NULL;
CRM_CHECK(search_comment->type == XML_COMMENT_NODE, return NULL);
for (a_child = __xml_first_child(root); a_child != NULL; a_child = __xml_next(a_child)) {
if (a_child->type != XML_COMMENT_NODE) {
con... | +Priv | 0 | find_xml_comment(xmlNode * root, xmlNode * search_comment)
{
xmlNode *a_child = NULL;
CRM_CHECK(search_comment->type == XML_COMMENT_NODE, return NULL);
for (a_child = __xml_first_child(root); a_child != NULL; a_child = __xml_next(a_child)) {
if (a_child->type != XML_COMMENT_NODE) {
con... | @@ -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,297 | find_xml_node(xmlNode * root, const char *search_path, gboolean must_find)
{
xmlNode *a_child = NULL;
const char *name = "NULL";
if (root != NULL) {
name = crm_element_name(root);
}
if (search_path == NULL) {
crm_warn("Will never find <NULL>");
return NULL;
}
for (... | +Priv | 0 | find_xml_node(xmlNode * root, const char *search_path, gboolean must_find)
{
xmlNode *a_child = NULL;
const char *name = "NULL";
if (root != NULL) {
name = crm_element_name(root);
}
if (search_path == NULL) {
crm_warn("Will never find <NULL>");
return NULL;
}
for (... | @@ -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,298 | first_named_child(xmlNode * parent, const char *name)
{
xmlNode *match = NULL;
for (match = __xml_first_child(parent); match != NULL; match = __xml_next(match)) {
/*
* name == NULL gives first child regardless of name; this is
* semantically incorrect in this funciton, but may be nece... | +Priv | 0 | first_named_child(xmlNode * parent, const char *name)
{
xmlNode *match = NULL;
for (match = __xml_first_child(parent); match != NULL; match = __xml_next(match)) {
/*
* name == NULL gives first child regardless of name; this is
* semantically incorrect in this funciton, but may be nece... | @@ -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,299 | fix_plus_plus_recursive(xmlNode * target)
{
/* TODO: Remove recursion and use xpath searches for value++ */
xmlNode *child = NULL;
xmlAttrPtr pIter = NULL;
for (pIter = crm_first_attr(target); pIter != NULL; pIter = pIter->next) {
const char *p_name = (const char *)pIter->name;
const ch... | +Priv | 0 | fix_plus_plus_recursive(xmlNode * target)
{
/* TODO: Remove recursion and use xpath searches for value++ */
xmlNode *child = NULL;
xmlAttrPtr pIter = NULL;
for (pIter = crm_first_attr(target); pIter != NULL; pIter = pIter->next) {
const char *p_name = (const char *)pIter->name;
const ch... | @@ -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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.