code stringlengths 14 2.05k | label int64 0 1 | programming_language stringclasses 7
values | cwe_id stringlengths 6 14 | cwe_name stringlengths 5 98 ⌀ | description stringlengths 36 379 ⌀ | url stringlengths 36 48 ⌀ | label_name stringclasses 2
values |
|---|---|---|---|---|---|---|---|
render_pixbuf_size_prepared_cb (GdkPixbufLoader *loader,
gint width,
gint height,
gpointer data)
{
double *scale = data;
int w = (width * (*scale) + 0.5);
int h = (height * (*scale) + 0.5);
gdk_pixbuf_loader_set_size (loader, w, h);
} | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
comics_generate_command_lines (ComicsDocument *comics_document,
GError **error)
{
gchar *quoted_file, *quoted_file_aux;
gchar *quoted_command;
ComicBookDecompressType type;
type = comics_document->command_usage;
comics_document->regex_arg = command_usage_def[type].regex_arg;
quoted_command = g_... | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
comics_document_init (ComicsDocument *comics_document)
{
comics_document->archive = NULL;
comics_document->page_names = NULL;
comics_document->extract_command = NULL;
} | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
get_page_size_area_prepared_cb (GdkPixbufLoader *loader,
gpointer data)
{
gboolean *got_size = data;
*got_size = TRUE;
} | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
comics_remove_dir (gchar *path_name)
{
GDir *content_dir;
const gchar *filename;
gchar *filename_with_path;
if (g_file_test (path_name, G_FILE_TEST_IS_DIR)) {
content_dir = g_dir_open (path_name, 0, NULL);
filename = g_dir_read_name (content_dir);
while (filename) {
filename_with_path =
g_build_fil... | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
comics_document_finalize (GObject *object)
{
ComicsDocument *comics_document = COMICS_DOCUMENT (object);
if (comics_document->decompress_tmp) {
if (comics_remove_dir (comics_document->dir) == -1)
g_warning (_("There was an error deleting “%s”."),
comics_document->dir);
g_free (comics_document->dir);
}... | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
comics_document_render (EvDocument *document,
EvRenderContext *rc)
{
GdkPixbuf *pixbuf;
cairo_surface_t *surface;
pixbuf = comics_document_render_pixbuf (document, rc);
surface = ev_document_misc_surface_from_pixbuf (pixbuf);
g_object_unref (pixbuf);
return surface;
} | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
sort_page_names (gconstpointer a,
gconstpointer b)
{
const char *name_1, *name_2;
gchar *key_1, *key_2;
gboolean sort_last_1, sort_last_2;
int compare;
name_1 = * (const char **) a;
name_2 = * (const char **) b;
#define SORT_LAST_CHAR1 '.'
#define SORT_LAST_CHAR2 '#'
sort_last_1 = name_1[0]... | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
get_supported_image_extensions(void)
{
GSList *extensions = NULL;
GSList *formats = gdk_pixbuf_get_formats ();
GSList *l;
for (l = formats; l != NULL; l = l->next) {
int i;
gchar **ext = gdk_pixbuf_format_get_extensions (l->data);
for (i = 0; ext[i] != NULL; i++) {
extensions = g_slist_append (extensions... | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
comics_decompress_temp_dir (const gchar *command_decompress_tmp,
const gchar *command,
GError **error)
{
gboolean success;
gchar *std_out, *basename;
GError *err = NULL;
gint retval;
success = g_spawn_command_line_sync (command_decompress_tmp, &std_out,
NULL, &retval, &err);
basename... | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
comics_document_get_page_size (EvDocument *document,
EvPage *page,
double *width,
double *height)
{
GdkPixbufLoader *loader;
char **argv;
guchar buf[1024];
gboolean success, got_size = FALSE;
gint outpipe = -1;
GPid child_pid;
gssize bytes;
GdkPixbuf *pixbuf;
gchar *fi... | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
extract_argv (EvDocument *document, gint page)
{
ComicsDocument *comics_document = COMICS_DOCUMENT (document);
char **argv;
char *command_line, *quoted_archive, *quoted_filename;
GError *err = NULL;
if (g_strrstr (comics_document->page_names->pdata[page], "--checkpoint-action="))
{
g_warning ("File unsupported... | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
comics_regex_quote (const gchar *unquoted_string)
{
const gchar *p;
GString *dest;
dest = g_string_new ("'");
p = unquoted_string;
while (*p) {
switch (*p) {
/* * matches a sequence of 0 or more characters */
case ('*'):
/* ? matches exactly 1 charactere */
case ('?'):
/* [...] matches any sin... | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
comics_document_render_pixbuf (EvDocument *document,
EvRenderContext *rc)
{
GdkPixbufLoader *loader;
GdkPixbuf *rotated_pixbuf, *tmp_pixbuf;
char **argv;
guchar buf[4096];
gboolean success;
gint outpipe = -1;
GPid child_pid;
gssize bytes;
gint width, height;
gchar *filename;
ComicsDocument *co... | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
static int set_expected_hash(const char *val, const struct kernel_param *kp)
{
int rv = param_set_uint(val, kp);
ksu_invalidate_manager_uid();
pr_info("ksu_expected_hash set to %x\n", ksu_expected_hash);
return rv;
} | 0 | C | CWE-863 | Incorrect Authorization | The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions. | https://cwe.mitre.org/data/definitions/863.html | vulnerable |
int is_manager_apk(char *path)
{
return check_v2_signature(path, ksu_expected_size, ksu_expected_hash);
} | 0 | C | CWE-863 | Incorrect Authorization | The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions. | https://cwe.mitre.org/data/definitions/863.html | vulnerable |
static void fio_worker_cleanup(void) {
/* switch to winding down */
if (fio_data->is_worker)
FIO_LOG_INFO("(%d) detected exit signal.", (int)getpid());
else
FIO_LOG_INFO("Server Detected exit signal.");
fio_state_callback_force(FIO_CALL_ON_SHUTDOWN);
for (size_t i = 0; i <= fio_data->max_protocol_fd; ... | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
void fio_signal_handler_reset(void) {
struct sigaction old;
if (!fio_old_sig_int.sa_handler)
return;
memset(&old, 0, sizeof(old));
sigaction(SIGINT, &fio_old_sig_int, &old);
sigaction(SIGTERM, &fio_old_sig_term, &old);
sigaction(SIGPIPE, &fio_old_sig_pipe, &old);
if (fio_old_sig_chld.sa_handler)
s... | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static void fio_cluster_signal_children(void) {
if (fio_parent_pid() != getpid()) {
fio_stop();
return;
}
fio_cluster_server_sender(fio_msg_internal_create(0, FIO_CLUSTER_MSG_SHUTDOWN,
(fio_str_info_s){.len = 0},
... | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static void fio_cluster_listen_on_close(intptr_t uuid,
fio_protocol_s *protocol) {
free(protocol);
cluster_data.uuid = -1;
if (fio_parent_pid() == getpid()) {
#if DEBUG
FIO_LOG_DEBUG("(%d) stopped listening for cluster connections",
(int)getpid());
#en... | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static void fio_signal_handler_setup(void) {
/* setup signal handling */
struct sigaction act;
if (fio_old_sig_int.sa_handler)
return;
memset(&act, 0, sizeof(act));
act.sa_handler = sig_int_handler;
sigemptyset(&act.sa_mask);
act.sa_flags = SA_RESTART | SA_NOCLDSTOP;
if (sigaction(SIGINT, &act, &... | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static void __attribute__((destructor)) fio_lib_destroy(void) {
uint8_t add_eol = fio_is_master();
fio_data->active = 0;
fio_on_fork();
fio_defer_perform();
fio_state_callback_force(FIO_CALL_AT_EXIT);
fio_state_callback_clear_all();
fio_defer_perform();
fio_poll_close();
fio_timer_clear_all();
fio_f... | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static struct timespec fio_timer_calc_due(size_t interval) {
struct timespec now = fio_last_tick();
if (interval > 1000) {
now.tv_sec += interval / 1000;
interval -= interval / 1000;
}
now.tv_nsec += (interval * 1000000UL);
if (now.tv_nsec > 1000000000L) {
now.tv_nsec -= 1000000000L;
now.tv_se... | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static void sig_int_handler(int sig) {
struct sigaction *old = NULL;
switch (sig) {
#if !FIO_DISABLE_HOT_RESTART
case SIGUSR1:
fio_signal_children_flag = 1;
old = &fio_old_sig_usr1;
break;
#endif
/* fallthrough */
case SIGINT:
if (!old)
old = &fio_old_sig_int;
/* fallthrough */
c... | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
inline FIO_FUNC ssize_t fio_sendfile(intptr_t uuid, intptr_t source_fd,
off_t offset, size_t length) {
return fio_write2(uuid, .data.fd = source_fd, .length = length, .is_fd = 1,
.offset = offset);
} | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
FIO_FUNC inline void fio_throttle_thread(size_t nano_sec) {
const struct timespec tm = {.tv_nsec = (nano_sec % 1000000000),
.tv_sec = (nano_sec / 1000000000)};
nanosleep(&tm, NULL);
} | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static inline __attribute__((unused)) ssize_t fiobj_send_free(intptr_t uuid,
FIOBJ o) {
fio_str_info_s s = fiobj_obj2cstr(o);
return fio_write2(uuid, .data.buffer = (void *)(o),
.offset = (((intptr_t)s.data) - ((intptr_t)(o))),
... | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static void http1_on_ready(intptr_t uuid, fio_protocol_s *protocol) {
/* resume slow clients from suspension */
http1pr_s *p = (http1pr_s *)protocol;
if ((p->stop & 4)) {
p->stop ^= 4;
fio_force_event(uuid, FIO_EVENT_ON_DATA);
}
(void)protocol;
} | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static int http1_on_response(http1_parser_s *parser) {
http1pr_s *p = parser2http(parser);
http_on_response_handler______internal(&http1_pr2handle(p), p->p.settings);
if (p->request.status_str && !p->stop)
http_finish(&p->request);
h1_reset(p);
return !p->close && fio_is_closed(p->p.uuid);
} | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static inline void http1_consume_data(intptr_t uuid, http1pr_s *p) {
if (fio_pending(uuid) > 4) {
goto throttle;
}
ssize_t i = 0;
size_t org_len = p->buf_len;
int pipeline_limit = 8;
if (!p->buf_len)
return;
do {
i = http1_fio_parser(.parser = &p->parser,
.buffer = p->... | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static void http1_on_data_first_time(intptr_t uuid, fio_protocol_s *protocol) {
http1pr_s *p = (http1pr_s *)protocol;
ssize_t i;
i = fio_read(uuid, p->buf + p->buf_len, HTTP_MAX_HEADER_LENGTH - p->buf_len);
if (i <= 0)
return;
p->buf_len += i;
/* ensure future reads skip this first time HTTP/2.0 test... | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static int http1_on_error(http1_parser_s *parser) {
FIO_LOG_DEBUG("HTTP parser error at HTTP/1.1 buffer position %zu/%zu",
parser->state.next - parser2http(parser)->buf,
parser2http(parser)->buf_len);
fio_close(parser2http(parser)->p.uuid);
return -1;
} | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static int http1_on_request(http1_parser_s *parser) {
http1pr_s *p = parser2http(parser);
http_on_request_handler______internal(&http1_pr2handle(p), p->p.settings);
if (p->request.method && !p->stop)
http_finish(&p->request);
h1_reset(p);
return !p->close && fio_is_closed(p->p.uuid);
} | 0 | C | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
static void process_request(struct connection *conn) {
num_requests++;
if (!parse_request(conn)) {
default_reply(conn, 400, "Bad Request",
"You sent a request that the server couldn't understand.");
}
else if (is_https_redirect(conn)) {
redirect_https(conn);
}
/* fai... | 0 | C | NVD-CWE-noinfo | null | null | null | vulnerable |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.