idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
4,400
dbus_g_proxy_manager_unmonitor_name_owner (DBusGProxyManager *manager, const char *name) { DBusGProxyNameOwnerInfo *info; const char *owner; gboolean ret; ret = dbus_g_proxy_manager_lookup_name_owner (manager, name, &info, &owner); g_assert (ret); g_assert (info != NULL); g_assert (owner...
+Priv
0
dbus_g_proxy_manager_unmonitor_name_owner (DBusGProxyManager *manager, const char *name) { DBusGProxyNameOwnerInfo *info; const char *owner; gboolean ret; ret = dbus_g_proxy_manager_lookup_name_owner (manager, name, &info, &owner); g_assert (ret); g_assert (info != NULL); g_assert (owner...
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,401
dbus_g_proxy_manager_unref (DBusGProxyManager *manager) { g_assert (manager != NULL); g_assert (manager->refcount > 0); LOCK_MANAGER (manager); manager->refcount -= 1; if (manager->refcount == 0) { UNLOCK_MANAGER (manager); if (manager->bus_proxy) g_object_unref (manager->bus_proxy); ...
+Priv
0
dbus_g_proxy_manager_unref (DBusGProxyManager *manager) { g_assert (manager != NULL); g_assert (manager->refcount > 0); LOCK_MANAGER (manager); manager->refcount -= 1; if (manager->refcount == 0) { UNLOCK_MANAGER (manager); if (manager->bus_proxy) g_object_unref (manager->bus_proxy); ...
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,402
g_proxy_get_signal_match_rule (DBusGProxy *proxy) { DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); /* FIXME Escaping is required here */ if (priv->name) return g_strdup_printf ("type='signal',sender='%s',path='%s',interface='%s'", priv->name, priv->path, priv->interf...
+Priv
0
g_proxy_get_signal_match_rule (DBusGProxy *proxy) { DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); /* FIXME Escaping is required here */ if (priv->name) return g_strdup_printf ("type='signal',sender='%s',path='%s',interface='%s'", priv->name, priv->path, priv->interf...
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,403
g_proxy_list_free (DBusGProxyList *list) { /* we don't hold a reference to the proxies in the list, * as they ref the GProxyManager */ g_slist_free (list->proxies); g_free (list); }
+Priv
0
g_proxy_list_free (DBusGProxyList *list) { /* we don't hold a reference to the proxies in the list, * as they ref the GProxyManager */ g_slist_free (list->proxies); g_free (list); }
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,404
g_proxy_list_new (DBusGProxy *first_proxy) { DBusGProxyList *list; DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(first_proxy); list = (void*) tristring_alloc_from_strings (G_STRUCT_OFFSET (DBusGProxyList, name), priv->name, ...
+Priv
0
g_proxy_list_new (DBusGProxy *first_proxy) { DBusGProxyList *list; DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(first_proxy); list = (void*) tristring_alloc_from_strings (G_STRUCT_OFFSET (DBusGProxyList, name), priv->name, ...
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,405
get_name_owner (DBusConnection *connection, const char *name, GError **error) { DBusError derror; DBusMessage *request, *reply; char *base_name; dbus_error_init (&derror); base_name = NULL; reply = NULL; request = dbus_message_new_method_call (DBUS_SERVICE_DBUS, DBUS...
+Priv
0
get_name_owner (DBusConnection *connection, const char *name, GError **error) { DBusError derror; DBusMessage *request, *reply; char *base_name; dbus_error_init (&derror); base_name = NULL; reply = NULL; request = dbus_message_new_method_call (DBUS_SERVICE_DBUS, DBUS...
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,406
get_owner_match_rule (const gchar *name) { return g_strdup_printf ("type='signal',sender='" DBUS_SERVICE_DBUS "',path='" DBUS_PATH_DBUS "',interface='" DBUS_INTERFACE_DBUS "',member='NameOwnerChanged'" ",arg0='%s'", name); }
+Priv
0
get_owner_match_rule (const gchar *name) { return g_strdup_printf ("type='signal',sender='" DBUS_SERVICE_DBUS "',path='" DBUS_PATH_DBUS "',interface='" DBUS_INTERFACE_DBUS "',member='NameOwnerChanged'" ",arg0='%s'", name); }
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,407
guint_slice_free (gpointer data) { g_slice_free (guint, data); }
+Priv
0
guint_slice_free (gpointer data) { g_slice_free (guint, data); }
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,408
insert_nameinfo (DBusGProxyManager *manager, const char *owner, DBusGProxyNameOwnerInfo *info) { GSList *names; gboolean insert; names = g_hash_table_lookup (manager->owner_names, owner); /* Only need to g_hash_table_insert the first time */ insert = (names == NULL); names = g_sl...
+Priv
0
insert_nameinfo (DBusGProxyManager *manager, const char *owner, DBusGProxyNameOwnerInfo *info) { GSList *names; gboolean insert; names = g_hash_table_lookup (manager->owner_names, owner); /* Only need to g_hash_table_insert the first time */ insert = (names == NULL); names = g_sl...
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,409
list_proxies_foreach (gpointer key, gpointer value, gpointer user_data) { DBusGProxyList *list; GSList **ret; GSList *tmp; list = value; ret = user_data; tmp = list->proxies; while (tmp != NULL) { DBusGProxy *proxy = DBUS_G_PROXY (tmp->data); ...
+Priv
0
list_proxies_foreach (gpointer key, gpointer value, gpointer user_data) { DBusGProxyList *list; GSList **ret; GSList *tmp; list = value; ret = user_data; tmp = list->proxies; while (tmp != NULL) { DBusGProxy *proxy = DBUS_G_PROXY (tmp->data); ...
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,410
name_owner_foreach (gpointer key, gpointer val, gpointer data) { const char *owner; DBusGProxyNameOwnerForeachData *foreach_data; GSList *names; GSList *link; owner = key; names = val; foreach_data = data; if (foreach_data->owner != NULL) return; g_assert (foreach_data->info == NULL); link =...
+Priv
0
name_owner_foreach (gpointer key, gpointer val, gpointer data) { const char *owner; DBusGProxyNameOwnerForeachData *foreach_data; GSList *names; GSList *link; owner = key; names = val; foreach_data = data; if (foreach_data->owner != NULL) return; g_assert (foreach_data->info == NULL); link =...
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,411
strequal_len (const char *a, const char *b, size_t *lenp) { size_t a_len; size_t b_len; a_len = strlen (a); b_len = strlen (b); if (a_len != b_len) return FALSE; if (memcmp (a, b, a_len) != 0) return FALSE; *lenp = a_len; return TRUE; }
+Priv
0
strequal_len (const char *a, const char *b, size_t *lenp) { size_t a_len; size_t b_len; a_len = strlen (a); b_len = strlen (b); if (a_len != b_len) return FALSE; if (memcmp (a, b, a_len) != 0) return FALSE; *lenp = a_len; return TRUE; }
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,412
tristring_alloc_from_strings (size_t padding_before, const char *name, const char *path, const char *interface) { size_t name_len, iface_len, path_len, len; char *tri; if (name) name_len = strlen (name); else ...
+Priv
0
tristring_alloc_from_strings (size_t padding_before, const char *name, const char *path, const char *interface) { size_t name_len, iface_len, path_len, len; char *tri; if (name) name_len = strlen (name); else ...
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,413
tristring_equal (gconstpointer a, gconstpointer b) { const char *ap = a; const char *bp = b; size_t len; if (!strequal_len (ap, bp, &len)) return FALSE; ap += len + 1; bp += len + 1; if (!strequal_len (ap, bp, &len)) return FALSE; ap += len + 1; bp += len + 1; if (str...
+Priv
0
tristring_equal (gconstpointer a, gconstpointer b) { const char *ap = a; const char *bp = b; size_t len; if (!strequal_len (ap, bp, &len)) return FALSE; ap += len + 1; bp += len + 1; if (!strequal_len (ap, bp, &len)) return FALSE; ap += len + 1; bp += len + 1; if (str...
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,414
tristring_from_message (DBusMessage *message) { const char *path; const char *interface; path = dbus_message_get_path (message); interface = dbus_message_get_interface (message); g_assert (path); g_assert (interface); return tristring_alloc_from_strings (0, dbus...
+Priv
0
tristring_from_message (DBusMessage *message) { const char *path; const char *interface; path = dbus_message_get_path (message); interface = dbus_message_get_interface (message); g_assert (path); g_assert (interface); return tristring_alloc_from_strings (0, dbus...
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,415
tristring_from_proxy (DBusGProxy *proxy) { DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); return tristring_alloc_from_strings (0, priv->name, priv->path, priv->interface); }
+Priv
0
tristring_from_proxy (DBusGProxy *proxy) { DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); return tristring_alloc_from_strings (0, priv->name, priv->path, priv->interface); }
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,416
tristring_hash (gconstpointer key) { const char *p = key; guint h = *p; if (h) { for (p += 1; *p != '\0'; p++) h = (h << 5) - h + *p; } /* skip nul and do the next substring */ for (p += 1; *p != '\0'; p++) h = (h << 5) - h + *p; /* skip nul again and another substring */ for ...
+Priv
0
tristring_hash (gconstpointer key) { const char *p = key; guint h = *p; if (h) { for (p += 1; *p != '\0'; p++) h = (h << 5) - h + *p; } /* skip nul and do the next substring */ for (p += 1; *p != '\0'; p++) h = (h << 5) - h + *p; /* skip nul again and another substring */ for ...
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,417
unassociate_proxies (gpointer key, gpointer val, gpointer user_data) { DBusGProxyList *list; const char *name; GSList *tmp; DBusGProxyUnassociateData *data; list = val; data = user_data; name = data->name; for (tmp = list->proxies; tmp; tmp = tmp->next) { DBusGProxy *proxy = DBUS_G_PROXY (...
+Priv
0
unassociate_proxies (gpointer key, gpointer val, gpointer user_data) { DBusGProxyList *list; const char *name; GSList *tmp; DBusGProxyUnassociateData *data; list = val; data = user_data; name = data->name; for (tmp = list->proxies; tmp; tmp = tmp->next) { DBusGProxy *proxy = DBUS_G_PROXY (...
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection, GSList *tmp; const char *sender; + sender = dbus_message_get_sender (message); + /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, + if (g_strcmp0 (sender, DBUS...
CWE-20
null
null
4,418
PreserveTrMode(xps_context_t *ctx) { gs_c_param_list list; dev_param_req_t request; gs_param_name ParamName = "PreserveTrMode"; gs_param_typed_value Param; char *data; gs_gstate *pgs = ctx->pgs; int code = 0; /* Interrogate the device to see if it supports Text Rendering Mode */ da...
DoS
0
PreserveTrMode(xps_context_t *ctx) { gs_c_param_list list; dev_param_req_t request; gs_param_name ParamName = "PreserveTrMode"; gs_param_typed_value Param; char *data; gs_gstate *pgs = ctx->pgs; int code = 0; /* Interrogate the device to see if it supports Text Rendering Mode */ da...
@@ -144,8 +144,8 @@ xps_select_best_font_encoding(xps_font_t *font) xps_identify_font_encoding(font, i, &pid, &eid); if (pid == xps_cmap_list[k].pid && eid == xps_cmap_list[k].eid) { - xps_select_font_encoding(font, i); - return; + if (...
CWE-125
null
null
4,419
xps_debug_path(xps_context_t *ctx) { segment *seg; curve_segment *cseg; seg = (segment*)ctx->pgs->path->first_subpath; while (seg) { switch (seg->type) { case s_start: dmprintf2(ctx->memory, "%g %g moveto\n", fixed2float(seg->pt.x) * 0.001, ...
DoS
0
xps_debug_path(xps_context_t *ctx) { segment *seg; curve_segment *cseg; seg = (segment*)ctx->pgs->path->first_subpath; while (seg) { switch (seg->type) { case s_start: dmprintf2(ctx->memory, "%g %g moveto\n", fixed2float(seg->pt.x) * 0.001, ...
@@ -144,8 +144,8 @@ xps_select_best_font_encoding(xps_font_t *font) xps_identify_font_encoding(font, i, &pid, &eid); if (pid == xps_cmap_list[k].pid && eid == xps_cmap_list[k].eid) { - xps_select_font_encoding(font, i); - return; + if (...
CWE-125
null
null
4,420
xps_deobfuscate_font_resource(xps_context_t *ctx, xps_part_t *part) { byte buf[33]; byte key[16]; char *p; int i; p = strrchr(part->name, '/'); if (!p) p = part->name; for (i = 0; i < 32 && *p; p++) { if (isxdigit(*p)) buf[i++] = *p; } buf[i] = 0; ...
DoS
0
xps_deobfuscate_font_resource(xps_context_t *ctx, xps_part_t *part) { byte buf[33]; byte key[16]; char *p; int i; p = strrchr(part->name, '/'); if (!p) p = part->name; for (i = 0; i < 32 && *p; p++) { if (isxdigit(*p)) buf[i++] = *p; } buf[i] = 0; ...
@@ -144,8 +144,8 @@ xps_select_best_font_encoding(xps_font_t *font) xps_identify_font_encoding(font, i, &pid, &eid); if (pid == xps_cmap_list[k].pid && eid == xps_cmap_list[k].eid) { - xps_select_font_encoding(font, i); - return; + if (...
CWE-125
null
null
4,421
xps_flush_text_buffer(xps_context_t *ctx, xps_font_t *font, xps_text_buffer_t *buf, int is_charpath) { gs_text_params_t params; gs_text_enum_t *textenum; float initial_x, x = buf->x[0]; float initial_y, y = buf->y[0]; int code; int i; gs_gstate_color saved; initial_x = x; i...
DoS
0
xps_flush_text_buffer(xps_context_t *ctx, xps_font_t *font, xps_text_buffer_t *buf, int is_charpath) { gs_text_params_t params; gs_text_enum_t *textenum; float initial_x, x = buf->x[0]; float initial_y, y = buf->y[0]; int code; int i; gs_gstate_color saved; initial_x = x; i...
@@ -144,8 +144,8 @@ xps_select_best_font_encoding(xps_font_t *font) xps_identify_font_encoding(font, i, &pid, &eid); if (pid == xps_cmap_list[k].pid && eid == xps_cmap_list[k].eid) { - xps_select_font_encoding(font, i); - return; + if (...
CWE-125
null
null
4,422
xps_parse_digits(char *s, int *digit) { *digit = 0; while (*s >= '0' && *s <= '9') { *digit = *digit * 10 + (*s - '0'); s ++; } return s; }
DoS
0
xps_parse_digits(char *s, int *digit) { *digit = 0; while (*s >= '0' && *s <= '9') { *digit = *digit * 10 + (*s - '0'); s ++; } return s; }
@@ -144,8 +144,8 @@ xps_select_best_font_encoding(xps_font_t *font) xps_identify_font_encoding(font, i, &pid, &eid); if (pid == xps_cmap_list[k].pid && eid == xps_cmap_list[k].eid) { - xps_select_font_encoding(font, i); - return; + if (...
CWE-125
null
null
4,423
xps_parse_glyph_index(char *s, int *glyph_index) { if (*s >= '0' && *s <= '9') s = xps_parse_digits(s, glyph_index); return s; }
DoS
0
xps_parse_glyph_index(char *s, int *glyph_index) { if (*s >= '0' && *s <= '9') s = xps_parse_digits(s, glyph_index); return s; }
@@ -144,8 +144,8 @@ xps_select_best_font_encoding(xps_font_t *font) xps_identify_font_encoding(font, i, &pid, &eid); if (pid == xps_cmap_list[k].pid && eid == xps_cmap_list[k].eid) { - xps_select_font_encoding(font, i); - return; + if (...
CWE-125
null
null
4,424
xps_parse_glyph_metrics(char *s, float *advance, float *uofs, float *vofs, int bidi_level) { s = xps_parse_glyph_advance(s, advance, bidi_level); s = xps_parse_glyph_offsets(s, uofs, vofs); return s; }
DoS
0
xps_parse_glyph_metrics(char *s, float *advance, float *uofs, float *vofs, int bidi_level) { s = xps_parse_glyph_advance(s, advance, bidi_level); s = xps_parse_glyph_offsets(s, uofs, vofs); return s; }
@@ -144,8 +144,8 @@ xps_select_best_font_encoding(xps_font_t *font) xps_identify_font_encoding(font, i, &pid, &eid); if (pid == xps_cmap_list[k].pid && eid == xps_cmap_list[k].eid) { - xps_select_font_encoding(font, i); - return; + if (...
CWE-125
null
null
4,425
xps_parse_glyphs_imp(xps_context_t *ctx, xps_font_t *font, float size, float originx, float originy, int is_sideways, int bidi_level, char *indices, char *unicode, int is_charpath, int sim_bold) { xps_text_buffer_t buf; xps_glyph_metrics_t mtx; float x = originx; float y = originy; c...
DoS
0
xps_parse_glyphs_imp(xps_context_t *ctx, xps_font_t *font, float size, float originx, float originy, int is_sideways, int bidi_level, char *indices, char *unicode, int is_charpath, int sim_bold) { xps_text_buffer_t buf; xps_glyph_metrics_t mtx; float x = originx; float y = originy; c...
@@ -144,8 +144,8 @@ xps_select_best_font_encoding(xps_font_t *font) xps_identify_font_encoding(font, i, &pid, &eid); if (pid == xps_cmap_list[k].pid && eid == xps_cmap_list[k].eid) { - xps_select_font_encoding(font, i); - return; + if (...
CWE-125
null
null
4,426
static inline int u16(const byte *p) { return (p[0] << 8) | p[1]; }
DoS Overflow
0
static inline int u16(const byte *p) { return (p[0] << 8) | p[1]; }
@@ -141,10 +141,14 @@ xps_true_callback_glyph_name(gs_font *pfont, gs_glyph glyph, gs_const_string *ps int table_offset; ulong format; - uint numGlyphs; + int numGlyphs; uint glyph_name_index; const byte *postp; /* post table pointer */ + if (glyph >= GS_MIN_GLYPH_INDEX) { + glyp...
CWE-119
null
null
4,427
static inline int u32(const byte *p) { return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; }
DoS Overflow
0
static inline int u32(const byte *p) { return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; }
@@ -141,10 +141,14 @@ xps_true_callback_glyph_name(gs_font *pfont, gs_glyph glyph, gs_const_string *ps int table_offset; ulong format; - uint numGlyphs; + int numGlyphs; uint glyph_name_index; const byte *postp; /* post table pointer */ + if (glyph >= GS_MIN_GLYPH_INDEX) { + glyp...
CWE-119
null
null
4,428
xps_true_callback_encode_char(gs_font *pfont, gs_char chr, gs_glyph_space_t spc) { xps_font_t *font = pfont->client_data; int value; value = xps_encode_font_char(font, chr); if (value == 0) return GS_NO_GLYPH; return value; }
DoS Overflow
0
xps_true_callback_encode_char(gs_font *pfont, gs_char chr, gs_glyph_space_t spc) { xps_font_t *font = pfont->client_data; int value; value = xps_encode_font_char(font, chr); if (value == 0) return GS_NO_GLYPH; return value; }
@@ -141,10 +141,14 @@ xps_true_callback_glyph_name(gs_font *pfont, gs_glyph glyph, gs_const_string *ps int table_offset; ulong format; - uint numGlyphs; + int numGlyphs; uint glyph_name_index; const byte *postp; /* post table pointer */ + if (glyph >= GS_MIN_GLYPH_INDEX) { + glyp...
CWE-119
null
null
4,429
xps_true_callback_string_proc(gs_font_type42 *p42, ulong offset, uint length, const byte **pdata) { xps_font_t *font = p42->client_data; if (offset + length > font->length) { *pdata = NULL; return gs_throw2(-1, "font data access out of bounds (offset=%lu size=%u)", offset, length); } ...
DoS Overflow
0
xps_true_callback_string_proc(gs_font_type42 *p42, ulong offset, uint length, const byte **pdata) { xps_font_t *font = p42->client_data; if (offset + length > font->length) { *pdata = NULL; return gs_throw2(-1, "font data access out of bounds (offset=%lu size=%u)", offset, length); } ...
@@ -141,10 +141,14 @@ xps_true_callback_glyph_name(gs_font *pfont, gs_glyph glyph, gs_const_string *ps int table_offset; ulong format; - uint numGlyphs; + int numGlyphs; uint glyph_name_index; const byte *postp; /* post table pointer */ + if (glyph >= GS_MIN_GLYPH_INDEX) { + glyp...
CWE-119
null
null
4,430
xps_true_callback_glyph_name(gs_font *pfont, gs_glyph glyph, gs_const_string *pstr) { /* This function is copied verbatim from plfont.c */ int table_length; int table_offset; ulong format; int numGlyphs; uint glyph_name_index; const byte *postp; /* post table pointer */ if (glyph >= G...
DoS Overflow
0
xps_true_callback_glyph_name(gs_font *pfont, gs_glyph glyph, gs_const_string *pstr) { /* This function is copied verbatim from plfont.c */ int table_length; int table_offset; ulong format; int numGlyphs; uint glyph_name_index; const byte *postp; /* post table pointer */ if (glyph >= G...
@@ -385,7 +385,7 @@ xps_init_truetype_font(xps_context_t *ctx, xps_font_t *font) p42->procs.build_char = xps_true_callback_build_char; memset(p42->font_name.chars, 0, sizeof(p42->font_name.chars)); - xps_load_sfnt_name(font, (char*)p42->font_name.chars); + xps_load_sfnt_name(font, (cha...
CWE-119
null
null
4,431
static void Ins_MDRP( INS_ARG ) { Int point; TT_F26Dot6 distance, org_dist; point = (Int)args[0]; if ( BOUNDS( args[0], CUR.zp1.n_points ) ) { /* Current version of FreeType silently ignores this out of bounds error * and drops the instruction, see bu...
DoS
0
static void Ins_MDRP( INS_ARG ) { Int point; TT_F26Dot6 distance, org_dist; point = (Int)args[0]; if ( BOUNDS( args[0], CUR.zp1.n_points ) ) { /* Current version of FreeType silently ignores this out of bounds error * and drops the instruction, see bu...
@@ -3858,7 +3858,8 @@ static int nInstrCount=0; /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */ if ( BOUNDS( args[0], CUR.zp1.n_points ) || - BOUNDS( args[1]+1, CUR.cvtSize+1 ) ) + BOUNDS( args[1]+1, CUR.cvtSize+1 ) || + BOUNDS(CUR.GS.rp0, CUR.zp0.n_points) ) { CUR.e...
CWE-125
null
null
4,432
xps_decode_font_char(xps_font_t *font, int code) { int gid = xps_decode_font_char_imp(font, code); if (gid == 0) return code; return gid; }
DoS
0
xps_decode_font_char(xps_font_t *font, int code) { int gid = xps_decode_font_char_imp(font, code); if (gid == 0) return code; return gid; }
@@ -182,12 +182,27 @@ xps_load_sfnt_name(xps_font_t *font, char *namep) return; } + /* validate the offset, and the data for the two + * values we're about to read + */ + if (offset + 6 > font->length) + { + gs_warn("name table byte offset invalid"); + return; + } ...
CWE-125
null
null
4,433
xps_decode_font_char_imp(xps_font_t *font, int code) { byte *table; /* no cmap selected: return identity */ if (font->cmapsubtable <= 0) return code; table = font->data + font->cmapsubtable; switch (u16(table)) { case 0: /* Apple standard 1-to-1 mapping. */ { ...
DoS
0
xps_decode_font_char_imp(xps_font_t *font, int code) { byte *table; /* no cmap selected: return identity */ if (font->cmapsubtable <= 0) return code; table = font->data + font->cmapsubtable; switch (u16(table)) { case 0: /* Apple standard 1-to-1 mapping. */ { ...
@@ -182,12 +182,27 @@ xps_load_sfnt_name(xps_font_t *font, char *namep) return; } + /* validate the offset, and the data for the two + * values we're about to read + */ + if (offset + 6 > font->length) + { + gs_warn("name table byte offset invalid"); + return; + } ...
CWE-125
null
null
4,434
xps_encode_font_char(xps_font_t *font, int code) { int gid = xps_encode_font_char_imp(font, code); if (gid == 0 && font->usepua) gid = xps_encode_font_char_imp(font, 0xF000 | code); return gid; }
DoS
0
xps_encode_font_char(xps_font_t *font, int code) { int gid = xps_encode_font_char_imp(font, code); if (gid == 0 && font->usepua) gid = xps_encode_font_char_imp(font, 0xF000 | code); return gid; }
@@ -182,12 +182,27 @@ xps_load_sfnt_name(xps_font_t *font, char *namep) return; } + /* validate the offset, and the data for the two + * values we're about to read + */ + if (offset + 6 > font->length) + { + gs_warn("name table byte offset invalid"); + return; + } ...
CWE-125
null
null
4,435
xps_encode_font_char_imp(xps_font_t *font, int code) { byte *table; /* no cmap selected: return identity */ if (font->cmapsubtable <= 0) return code; table = font->data + font->cmapsubtable; switch (u16(table)) { case 0: /* Apple standard 1-to-1 mapping. */ return table[co...
DoS
0
xps_encode_font_char_imp(xps_font_t *font, int code) { byte *table; /* no cmap selected: return identity */ if (font->cmapsubtable <= 0) return code; table = font->data + font->cmapsubtable; switch (u16(table)) { case 0: /* Apple standard 1-to-1 mapping. */ return table[co...
@@ -182,12 +182,27 @@ xps_load_sfnt_name(xps_font_t *font, char *namep) return; } + /* validate the offset, and the data for the two + * values we're about to read + */ + if (offset + 6 > font->length) + { + gs_warn("name table byte offset invalid"); + return; + } ...
CWE-125
null
null
4,436
xps_select_font_encoding(xps_font_t *font, int idx) { byte *cmapdata, *entry; int pid, eid; if (idx < 0 || idx >= font->cmapsubcount) return; cmapdata = font->data + font->cmaptable; entry = cmapdata + 4 + idx * 8; pid = u16(entry + 0); eid = u16(entry + 2); font->cmapsubtable = ...
DoS
0
xps_select_font_encoding(xps_font_t *font, int idx) { byte *cmapdata, *entry; int pid, eid; if (idx < 0 || idx >= font->cmapsubcount) return; cmapdata = font->data + font->cmaptable; entry = cmapdata + 4 + idx * 8; pid = u16(entry + 0); eid = u16(entry + 2); font->cmapsubtable = ...
@@ -182,12 +182,27 @@ xps_load_sfnt_name(xps_font_t *font, char *namep) return; } + /* validate the offset, and the data for the two + * values we're about to read + */ + if (offset + 6 > font->length) + { + gs_warn("name table byte offset invalid"); + return; + } ...
CWE-125
null
null
4,437
cleanup (pam_handle_t *pamh UNUSED, void *data, int err UNUSED) { free (data); }
DoS
0
cleanup (pam_handle_t *pamh UNUSED, void *data, int err UNUSED) { free (data); }
@@ -37,6 +37,9 @@ #include <sys/types.h> #include <sys/fsuid.h> #include <sys/wait.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> #include <errno.h> #include <fnmatch.h> #include <grp.h> @@ -232,9 +235,10 @@ check_acl(pam_handle_t *pamh, { char path[PATH_MAX]; struct passwd *p...
CWE-399
null
null
4,438
pam_sm_close_session (pam_handle_t *pamh, int flags UNUSED, int argc, const char **argv) { void *cookiefile; int i, debug = 0; const char* user; struct passwd *tpwd = NULL; uid_t unlinkuid, fsuid; if (pam_get_user(pamh, &user, NULL) != PAM_SUCCESS) pam_syslog(pamh, LOG_ERR, "error determining target us...
DoS
0
pam_sm_close_session (pam_handle_t *pamh, int flags UNUSED, int argc, const char **argv) { void *cookiefile; int i, debug = 0; const char* user; struct passwd *tpwd = NULL; uid_t unlinkuid, fsuid; if (pam_get_user(pamh, &user, NULL) != PAM_SUCCESS) pam_syslog(pamh, LOG_ERR, "error determining target us...
@@ -37,6 +37,9 @@ #include <sys/types.h> #include <sys/fsuid.h> #include <sys/wait.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> #include <errno.h> #include <fnmatch.h> #include <grp.h> @@ -232,9 +235,10 @@ check_acl(pam_handle_t *pamh, { char path[PATH_MAX]; struct passwd *p...
CWE-399
null
null
4,439
run_coprocess(pam_handle_t *pamh, const char *input, char **output, uid_t uid, gid_t gid, const char *command, ...) { int ipipe[2], opipe[2], i; char buf[LINE_MAX]; pid_t child; char *buffer = NULL; size_t buffer_size = 0; va_list ap; *output = NULL; /* Create stdio pipery. */ if (pipe(ipipe) == -1) {...
DoS
0
run_coprocess(pam_handle_t *pamh, const char *input, char **output, uid_t uid, gid_t gid, const char *command, ...) { int ipipe[2], opipe[2], i; char buf[LINE_MAX]; pid_t child; char *buffer = NULL; size_t buffer_size = 0; va_list ap; *output = NULL; /* Create stdio pipery. */ if (pipe(ipipe) == -1) {...
@@ -37,6 +37,9 @@ #include <sys/types.h> #include <sys/fsuid.h> #include <sys/wait.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> #include <errno.h> #include <fnmatch.h> #include <grp.h> @@ -232,9 +235,10 @@ check_acl(pam_handle_t *pamh, { char path[PATH_MAX]; struct passwd *p...
CWE-399
null
null
4,440
_gcry_ecc_eddsa_compute_h_d (unsigned char **r_digest, gcry_mpi_t d, mpi_ec_t ec) { gpg_err_code_t rc; unsigned char *rawmpi = NULL; unsigned int rawmpilen; unsigned char *digest; gcry_buffer_t hvec[2]; int hashalgo, b; *r_digest = NULL; hashalgo = GCRY_MD_SHA512; if (ha...
+Info
0
_gcry_ecc_eddsa_compute_h_d (unsigned char **r_digest, gcry_mpi_t d, mpi_ec_t ec) { gpg_err_code_t rc; unsigned char *rawmpi = NULL; unsigned int rawmpilen; unsigned char *digest; gcry_buffer_t hvec[2]; int hashalgo, b; *r_digest = NULL; hashalgo = GCRY_MD_SHA512; if (ha...
@@ -603,7 +603,7 @@ _gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey, a = mpi_snew (0); x = mpi_new (0); y = mpi_new (0); - r = mpi_new (0); + r = mpi_snew (0); ctx = _gcry_mpi_ec_p_internal_new (skey->E.model, skey->E.dialect, 0, skey->E.p, skey->E.a, ske...
CWE-200
null
null
4,441
_gcry_ecc_eddsa_encodepoint (mpi_point_t point, mpi_ec_t ec, gcry_mpi_t x_in, gcry_mpi_t y_in, int with_prefix, unsigned char **r_buffer, unsigned int *r_buflen) { gpg_err_code_t rc; gcry_mpi_t x, y; x = x_in? x_in : mpi_new (...
+Info
0
_gcry_ecc_eddsa_encodepoint (mpi_point_t point, mpi_ec_t ec, gcry_mpi_t x_in, gcry_mpi_t y_in, int with_prefix, unsigned char **r_buffer, unsigned int *r_buflen) { gpg_err_code_t rc; gcry_mpi_t x, y; x = x_in? x_in : mpi_new (...
@@ -603,7 +603,7 @@ _gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey, a = mpi_snew (0); x = mpi_new (0); y = mpi_new (0); - r = mpi_new (0); + r = mpi_snew (0); ctx = _gcry_mpi_ec_p_internal_new (skey->E.model, skey->E.dialect, 0, skey->E.p, skey->E.a, ske...
CWE-200
null
null
4,442
_gcry_ecc_eddsa_ensure_compact (gcry_mpi_t value, unsigned int nbits) { gpg_err_code_t rc; const unsigned char *buf; unsigned int rawmpilen; gcry_mpi_t x, y; unsigned char *enc; unsigned int enclen; if (!mpi_is_opaque (value)) return GPG_ERR_INV_OBJ; buf = mpi_get_opaque (value, &rawmpilen); if (...
+Info
0
_gcry_ecc_eddsa_ensure_compact (gcry_mpi_t value, unsigned int nbits) { gpg_err_code_t rc; const unsigned char *buf; unsigned int rawmpilen; gcry_mpi_t x, y; unsigned char *enc; unsigned int enclen; if (!mpi_is_opaque (value)) return GPG_ERR_INV_OBJ; buf = mpi_get_opaque (value, &rawmpilen); if (...
@@ -603,7 +603,7 @@ _gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey, a = mpi_snew (0); x = mpi_new (0); y = mpi_new (0); - r = mpi_new (0); + r = mpi_snew (0); ctx = _gcry_mpi_ec_p_internal_new (skey->E.model, skey->E.dialect, 0, skey->E.p, skey->E.a, ske...
CWE-200
null
null
4,443
_gcry_ecc_eddsa_genkey (ECC_secret_key *sk, elliptic_curve_t *E, mpi_ec_t ctx, int flags) { gpg_err_code_t rc; int b = 256/8; /* The only size we currently support. */ gcry_mpi_t a, x, y; mpi_point_struct Q; gcry_random_level_t random_level; char *dbuf; size_t dlen; ...
+Info
0
_gcry_ecc_eddsa_genkey (ECC_secret_key *sk, elliptic_curve_t *E, mpi_ec_t ctx, int flags) { gpg_err_code_t rc; int b = 256/8; /* The only size we currently support. */ gcry_mpi_t a, x, y; mpi_point_struct Q; gcry_random_level_t random_level; char *dbuf; size_t dlen; ...
@@ -603,7 +603,7 @@ _gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey, a = mpi_snew (0); x = mpi_new (0); y = mpi_new (0); - r = mpi_new (0); + r = mpi_snew (0); ctx = _gcry_mpi_ec_p_internal_new (skey->E.model, skey->E.dialect, 0, skey->E.p, skey->E.a, ske...
CWE-200
null
null
4,444
eddsa_encodempi (gcry_mpi_t mpi, unsigned int minlen, unsigned char **r_buffer, unsigned int *r_buflen) { unsigned char *rawmpi; unsigned int rawmpilen; rawmpi = _gcry_mpi_get_buffer (mpi, minlen, &rawmpilen, NULL); if (!rawmpi) return gpg_err_code_from_syserror (); *r_buffer = rawmpi; ...
+Info
0
eddsa_encodempi (gcry_mpi_t mpi, unsigned int minlen, unsigned char **r_buffer, unsigned int *r_buflen) { unsigned char *rawmpi; unsigned int rawmpilen; rawmpi = _gcry_mpi_get_buffer (mpi, minlen, &rawmpilen, NULL); if (!rawmpi) return gpg_err_code_from_syserror (); *r_buffer = rawmpi; ...
@@ -603,7 +603,7 @@ _gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey, a = mpi_snew (0); x = mpi_new (0); y = mpi_new (0); - r = mpi_new (0); + r = mpi_snew (0); ctx = _gcry_mpi_ec_p_internal_new (skey->E.model, skey->E.dialect, 0, skey->E.p, skey->E.a, ske...
CWE-200
null
null
4,445
scanval (const char *string) { gpg_err_code_t rc; gcry_mpi_t val; rc = _gcry_mpi_scan (&val, GCRYMPI_FMT_HEX, string, 0, NULL); if (rc) log_fatal ("scanning ECC parameter failed: %s\n", gpg_strerror (rc)); return val; }
+Info
0
scanval (const char *string) { gpg_err_code_t rc; gcry_mpi_t val; rc = _gcry_mpi_scan (&val, GCRYMPI_FMT_HEX, string, 0, NULL); if (rc) log_fatal ("scanning ECC parameter failed: %s\n", gpg_strerror (rc)); return val; }
@@ -603,7 +603,7 @@ _gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey, a = mpi_snew (0); x = mpi_new (0); y = mpi_new (0); - r = mpi_new (0); + r = mpi_snew (0); ctx = _gcry_mpi_ec_p_internal_new (skey->E.model, skey->E.dialect, 0, skey->E.p, skey->E.a, ske...
CWE-200
null
null
4,446
int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey) { EVP_MD_CTX ctx; const EVP_MD *type; unsigned char *p,*buf_in=NULL; int ret= -1,i,inl; EVP_MD_CTX_init(&ctx); i=OBJ_obj2nid(a->algorithm); type=EVP_get_digestbyname(OBJ_nid2sn(i)); if (type == NULL) {...
DoS
0
int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey) { EVP_MD_CTX ctx; const EVP_MD *type; unsigned char *p,*buf_in=NULL; int ret= -1,i,inl; EVP_MD_CTX_init(&ctx); i=OBJ_obj2nid(a->algorithm); type=EVP_get_digestbyname(OBJ_nid2sn(i)); if (type == NULL) {...
@@ -138,6 +138,12 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signat unsigned char *buf_in=NULL; int ret= -1,i,inl; + if (!pkey) + { + ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_PASSED_NULL_PARAMETER); + return -1; + ...
CWE-310
null
null
4,447
int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey) { EVP_MD_CTX ctx; const EVP_MD *type; unsigned char *p,*buf_in=NULL; int ret= -1,i,inl; EVP_MD_CTX_init(&ctx); i=OBJ_obj2nid(a->algorithm); type=EVP_get_digestbyname(OBJ_nid2sn(i)); if (type == NULL) {...
DoS
0
int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey) { EVP_MD_CTX ctx; const EVP_MD *type; unsigned char *p,*buf_in=NULL; int ret= -1,i,inl; EVP_MD_CTX_init(&ctx); i=OBJ_obj2nid(a->algorithm); type=EVP_get_digestbyname(OBJ_nid2sn(i)); if (type == NULL) {...
@@ -136,6 +136,12 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signat int mdnid, pknid; + if (!pkey) + { + ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_PASSED_NULL_PARAMETER); + return -1; + } + EVP_MD_CTX_init(&...
CWE-310
null
null
4,448
NTSTATUS change_dir_owner_to_parent(connection_struct *conn, const char *inherit_from_dir, const char *fname, SMB_STRUCT_STAT *psbuf) { struct smb_filename *smb_fname_parent; struct smb_filename *smb_fname_cwd = NULL; char *saved_dir = NULL; TALLOC_CTX *ctx = talloc_tos(); NTSTATUS...
DoS
0
NTSTATUS change_dir_owner_to_parent(connection_struct *conn, const char *inherit_from_dir, const char *fname, SMB_STRUCT_STAT *psbuf) { struct smb_filename *smb_fname_parent; struct smb_filename *smb_fname_cwd = NULL; char *saved_dir = NULL; TALLOC_CTX *ctx = talloc_tos(); NTSTATUS...
@@ -640,7 +640,9 @@ static NTSTATUS fd_open_atomic(struct connection_struct *conn, bool *file_created) { NTSTATUS status = NT_STATUS_UNSUCCESSFUL; + NTSTATUS retry_status; bool file_existed = VALID_STAT(fsp->fsp_name->st); + int curr_flags; *file_created = ...
CWE-835
null
null
4,449
void change_file_owner_to_parent(connection_struct *conn, const char *inherit_from_dir, files_struct *fsp) { struct smb_filename *smb_fname_parent; int ret; smb_fname_parent = synthetic_smb_fname(talloc_tos(), inherit_from_dir, NULL, NULL, 0); if (smb_fname_parent == NULL) { return;...
DoS
0
void change_file_owner_to_parent(connection_struct *conn, const char *inherit_from_dir, files_struct *fsp) { struct smb_filename *smb_fname_parent; int ret; smb_fname_parent = synthetic_smb_fname(talloc_tos(), inherit_from_dir, NULL, NULL, 0); if (smb_fname_parent == NULL) { return;...
@@ -640,7 +640,9 @@ static NTSTATUS fd_open_atomic(struct connection_struct *conn, bool *file_created) { NTSTATUS status = NT_STATUS_UNSUCCESSFUL; + NTSTATUS retry_status; bool file_existed = VALID_STAT(fsp->fsp_name->st); + int curr_flags; *file_created = ...
CWE-835
null
null
4,450
NTSTATUS check_parent_access(struct connection_struct *conn, struct smb_filename *smb_fname, uint32_t access_mask) { NTSTATUS status; char *parent_dir = NULL; struct security_descriptor *parent_sd = NULL; uint32_t access_granted = 0; struct smb_filename *parent_smb_fname = NULL; if (!parent_dirname(tallo...
DoS
0
NTSTATUS check_parent_access(struct connection_struct *conn, struct smb_filename *smb_fname, uint32_t access_mask) { NTSTATUS status; char *parent_dir = NULL; struct security_descriptor *parent_sd = NULL; uint32_t access_granted = 0; struct smb_filename *parent_smb_fname = NULL; if (!parent_dirname(tallo...
@@ -640,7 +640,9 @@ static NTSTATUS fd_open_atomic(struct connection_struct *conn, bool *file_created) { NTSTATUS status = NT_STATUS_UNSUCCESSFUL; + NTSTATUS retry_status; bool file_existed = VALID_STAT(fsp->fsp_name->st); + int curr_flags; *file_created = ...
CWE-835
null
null
4,451
NTSTATUS fd_close(files_struct *fsp) { int ret; if (fsp->dptr) { dptr_CloseDir(fsp); } if (fsp->fh->fd == -1) { return NT_STATUS_OK; /* What we used to call a stat open. */ } if (fsp->fh->ref_count > 1) { return NT_STATUS_OK; /* Shared handle. Only close last reference. */ } ret = SMB_VFS_CLOSE(fsp); f...
DoS
0
NTSTATUS fd_close(files_struct *fsp) { int ret; if (fsp->dptr) { dptr_CloseDir(fsp); } if (fsp->fh->fd == -1) { return NT_STATUS_OK; /* What we used to call a stat open. */ } if (fsp->fh->ref_count > 1) { return NT_STATUS_OK; /* Shared handle. Only close last reference. */ } ret = SMB_VFS_CLOSE(fsp); f...
@@ -640,7 +640,9 @@ static NTSTATUS fd_open_atomic(struct connection_struct *conn, bool *file_created) { NTSTATUS status = NT_STATUS_UNSUCCESSFUL; + NTSTATUS retry_status; bool file_existed = VALID_STAT(fsp->fsp_name->st); + int curr_flags; *file_created = ...
CWE-835
null
null
4,452
NTSTATUS fd_open(struct connection_struct *conn, files_struct *fsp, int flags, mode_t mode) { struct smb_filename *smb_fname = fsp->fsp_name; NTSTATUS status = NT_STATUS_OK; #ifdef O_NOFOLLOW /* * Never follow symlinks on a POSIX client. The * client should be doing this. */ if ((fsp->posix_flags ...
DoS
0
NTSTATUS fd_open(struct connection_struct *conn, files_struct *fsp, int flags, mode_t mode) { struct smb_filename *smb_fname = fsp->fsp_name; NTSTATUS status = NT_STATUS_OK; #ifdef O_NOFOLLOW /* * Never follow symlinks on a POSIX client. The * client should be doing this. */ if ((fsp->posix_flags ...
@@ -640,7 +640,9 @@ static NTSTATUS fd_open_atomic(struct connection_struct *conn, bool *file_created) { NTSTATUS status = NT_STATUS_UNSUCCESSFUL; + NTSTATUS retry_status; bool file_existed = VALID_STAT(fsp->fsp_name->st); + int curr_flags; *file_created = ...
CWE-835
null
null
4,453
static bool parent_override_delete(connection_struct *conn, const struct smb_filename *smb_fname, uint32_t access_mask, uint32_t rejected_mask) { if ((access_mask & DELETE_ACCESS) && (rejected_mask & DELETE_ACCESS) && can_delete_file_in_directory(conn, smb_fname)) { return true; } return...
DoS
0
static bool parent_override_delete(connection_struct *conn, const struct smb_filename *smb_fname, uint32_t access_mask, uint32_t rejected_mask) { if ((access_mask & DELETE_ACCESS) && (rejected_mask & DELETE_ACCESS) && can_delete_file_in_directory(conn, smb_fname)) { return true; } return...
@@ -640,7 +640,9 @@ static NTSTATUS fd_open_atomic(struct connection_struct *conn, bool *file_created) { NTSTATUS status = NT_STATUS_UNSUCCESSFUL; + NTSTATUS retry_status; bool file_existed = VALID_STAT(fsp->fsp_name->st); + int curr_flags; *file_created = ...
CWE-835
null
null
4,454
NTSTATUS smbd_check_access_rights(struct connection_struct *conn, const struct smb_filename *smb_fname, bool use_privs, uint32_t access_mask) { /* Check if we have rights to open. */ NTSTATUS status; struct security_descriptor *sd = NULL; uint32_t rejected_share_access; uint32_t rejected_mask = access_...
DoS
0
NTSTATUS smbd_check_access_rights(struct connection_struct *conn, const struct smb_filename *smb_fname, bool use_privs, uint32_t access_mask) { /* Check if we have rights to open. */ NTSTATUS status; struct security_descriptor *sd = NULL; uint32_t rejected_share_access; uint32_t rejected_mask = access_...
@@ -640,7 +640,9 @@ static NTSTATUS fd_open_atomic(struct connection_struct *conn, bool *file_created) { NTSTATUS status = NT_STATUS_UNSUCCESSFUL; + NTSTATUS retry_status; bool file_existed = VALID_STAT(fsp->fsp_name->st); + int curr_flags; *file_created = ...
CWE-835
null
null
4,455
another_hunk (enum diff difftype, bool rev) { char *s; lin context = 0; size_t chars_read; char numbuf0[LINENUM_LENGTH_BOUND + 1]; char numbuf1[LINENUM_LENGTH_BOUND + 1]; char numbuf2[LINENUM_LENGTH_BOUND + 1]; char numbuf3[LINENUM_LENGTH_BOUND + 1]; while (p_end >= 0) { if (p_end == p...
Dir. Trav.
0
another_hunk (enum diff difftype, bool rev) { char *s; lin context = 0; size_t chars_read; char numbuf0[LINENUM_LENGTH_BOUND + 1]; char numbuf1[LINENUM_LENGTH_BOUND + 1]; char numbuf2[LINENUM_LENGTH_BOUND + 1]; char numbuf3[LINENUM_LENGTH_BOUND + 1]; while (p_end >= 0) { if (p_end == p...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986, 1987, 1988 Larry Wall Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2006, 2009, 2010 Free Software Foundation, Inc. + 2002, 2003, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redis...
CWE-22
null
null
4,456
best_name (char *const *name, int const *ignore) { enum nametype i; int components[3]; int components_min = INT_MAX; size_t basename_len[3]; size_t basename_len_min = SIZE_MAX; size_t len[3]; size_t len_min = SIZE_MAX; for (i = OLD; i <= INDEX; i++) if (name[i] && !ignore[i]) { /* Take the...
Dir. Trav.
0
best_name (char *const *name, int const *ignore) { enum nametype i; int components[3]; int components_min = INT_MAX; size_t basename_len[3]; size_t basename_len_min = SIZE_MAX; size_t len[3]; size_t len_min = SIZE_MAX; for (i = OLD; i <= INDEX; i++) if (name[i] && !ignore[i]) { /* Take the...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986, 1987, 1988 Larry Wall Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2006, 2009, 2010 Free Software Foundation, Inc. + 2002, 2003, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redis...
CWE-22
null
null
4,457
do_ed_script (char const *inname, char const *outname, int *outname_needs_removal, FILE *ofp) { static char const editor_program[] = EDITOR_PROGRAM; file_offset beginning_of_this_line; FILE *pipefp = 0; size_t chars_read; if (! dry_run && ! skip_rest_of_patch) { int exclusive = *outname_ne...
Dir. Trav.
0
do_ed_script (char const *inname, char const *outname, int *outname_needs_removal, FILE *ofp) { static char const editor_program[] = EDITOR_PROGRAM; file_offset beginning_of_this_line; FILE *pipefp = 0; size_t chars_read; if (! dry_run && ! skip_rest_of_patch) { int exclusive = *outname_ne...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986, 1987, 1988 Larry Wall Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2006, 2009, 2010 Free Software Foundation, Inc. + 2002, 2003, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redis...
CWE-22
null
null
4,458
open_patch_file (char const *filename) { file_offset file_pos = 0; struct stat st; if (!filename || !*filename || strEQ (filename, "-")) { file_offset stdin_pos; #if HAVE_SETMODE_DOS if (binary_transput) { if (isatty (STDIN_FILENO)) fatal ("cannot read binary data from tty on this pla...
Dir. Trav.
0
open_patch_file (char const *filename) { file_offset file_pos = 0; struct stat st; if (!filename || !*filename || strEQ (filename, "-")) { file_offset stdin_pos; #if HAVE_SETMODE_DOS if (binary_transput) { if (isatty (STDIN_FILENO)) fatal ("cannot read binary data from tty on this pla...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986, 1987, 1988 Larry Wall Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2006, 2009, 2010 Free Software Foundation, Inc. + 2002, 2003, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redis...
CWE-22
null
null
4,459
pch_normalize (enum diff format) { lin old = 1; lin new = p_ptrn_lines + 1; while (p_Char[new] == '=' || p_Char[new] == '\n') new++; if (format == UNI_DIFF) { /* Convert '!' markers into '-' and '+' as defined by the Unified Format. */ for (; old <= p_ptrn_lines; old++) if (p_C...
Dir. Trav.
0
pch_normalize (enum diff format) { lin old = 1; lin new = p_ptrn_lines + 1; while (p_Char[new] == '=' || p_Char[new] == '\n') new++; if (format == UNI_DIFF) { /* Convert '!' markers into '-' and '+' as defined by the Unified Format. */ for (; old <= p_ptrn_lines; old++) if (p_C...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986, 1987, 1988 Larry Wall Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2006, 2009, 2010 Free Software Foundation, Inc. + 2002, 2003, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redis...
CWE-22
null
null
4,460
bool pch_rename (void) { return p_rename[OLD] && p_rename[NEW] && p_name[OLD] && p_name[NEW]; }
Dir. Trav.
0
bool pch_rename (void) { return p_rename[OLD] && p_rename[NEW] && p_name[OLD] && p_name[NEW]; }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986, 1987, 1988 Larry Wall Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2006, 2009, 2010 Free Software Foundation, Inc. + 2002, 2003, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redis...
CWE-22
null
null
4,461
pch_swap (void) { char **tp_line; /* the text of the hunk */ size_t *tp_len; /* length of each line */ char *tp_char; /* +, -, and ! */ lin i; lin n; bool blankline = false; char *s; i = p_first; p_first = p_newfirst; p_newfirst = i; /* make a scratch copy */ tp_lin...
Dir. Trav.
0
pch_swap (void) { char **tp_line; /* the text of the hunk */ size_t *tp_len; /* length of each line */ char *tp_char; /* +, -, and ! */ lin i; lin n; bool blankline = false; char *s; i = p_first; p_first = p_newfirst; p_newfirst = i; /* make a scratch copy */ tp_lin...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986, 1987, 1988 Larry Wall Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2006, 2009, 2010 Free Software Foundation, Inc. + 2002, 2003, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redis...
CWE-22
null
null
4,462
sha1_says_nonexistent(char const *sha1, char const *end) { char const *empty_sha1 = "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"; char const *s; /* Nonexisting files have an all-zero checksum. */ for (s = sha1; s != end; s++) if (*s != '0') break; if (s == end) return 2; /* Empty files have e...
Dir. Trav.
0
sha1_says_nonexistent(char const *sha1, char const *end) { char const *empty_sha1 = "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"; char const *s; /* Nonexisting files have an all-zero checksum. */ for (s = sha1; s != end; s++) if (*s != '0') break; if (s == end) return 2; /* Empty files have e...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986, 1987, 1988 Larry Wall Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2006, 2009, 2010 Free Software Foundation, Inc. + 2002, 2003, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redis...
CWE-22
null
null
4,463
there_is_another_patch (bool need_header, mode_t *file_type) { if (p_base != 0 && p_base >= p_filesize) { if (verbosity == VERBOSE) say ("done\n"); return false; } if (verbosity == VERBOSE) say ("Hmm..."); diff_type = intuit_diff_type (need_header, file_type); if (diff_type == NO_DIFF) { if...
Dir. Trav.
0
there_is_another_patch (bool need_header, mode_t *file_type) { if (p_base != 0 && p_base >= p_filesize) { if (verbosity == VERBOSE) say ("done\n"); return false; } if (verbosity == VERBOSE) say ("Hmm..."); diff_type = intuit_diff_type (need_header, file_type); if (diff_type == NO_DIFF) { if...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986, 1987, 1988 Larry Wall Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2006, 2009, 2010 Free Software Foundation, Inc. + 2002, 2003, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redis...
CWE-22
null
null
4,464
append_to_file (char const *from, char const *to) { int tofd; if ((tofd = open (to, O_WRONLY | O_BINARY | O_APPEND)) < 0) pfatal ("Can't reopen file %s", quotearg (to)); copy_to_fd (from, tofd); if (close (tofd) != 0) write_fatal (); }
Dir. Trav.
0
append_to_file (char const *from, char const *to) { int tofd; if ((tofd = open (to, O_WRONLY | O_BINARY | O_APPEND)) < 0) pfatal ("Can't reopen file %s", quotearg (to)); copy_to_fd (from, tofd); if (close (tofd) != 0) write_fatal (); }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,465
ask (char const *format, ...) { static int ttyfd = -2; ssize_t r; va_list args; va_start (args, format); vfprintf (stdout, format, args); va_end (args); fflush (stdout); if (ttyfd == -2) { /* If standard output is not a tty, don't bother opening /dev/tty, since it's unlikely that stdout wi...
Dir. Trav.
0
ask (char const *format, ...) { static int ttyfd = -2; ssize_t r; va_list args; va_start (args, format); vfprintf (stdout, format, args); va_end (args); fflush (stdout); if (ttyfd == -2) { /* If standard output is not a tty, don't bother opening /dev/tty, since it's unlikely that stdout wi...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,466
copy_attr_error (struct error_context *ctx, char const *fmt, ...) { int err = errno; va_list ap; /* use verror module to print error message */ va_start (ap, fmt); verror (0, err, fmt, ap); va_end (ap); }
Dir. Trav.
0
copy_attr_error (struct error_context *ctx, char const *fmt, ...) { int err = errno; va_list ap; /* use verror module to print error message */ va_start (ap, fmt); verror (0, err, fmt, ap); va_end (ap); }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,467
copy_file (char const *from, char const *to, struct stat *tost, int to_flags, mode_t mode, bool to_dir_known_to_exist) { int tofd; if (debug & 4) say ("Copying %s %s to %s\n", S_ISLNK (mode) ? "symbolic link" : "file", quotearg_n (0, from), quotearg_n (1, to)); if (S_ISLNK (mode)) { char *...
Dir. Trav.
0
copy_file (char const *from, char const *to, struct stat *tost, int to_flags, mode_t mode, bool to_dir_known_to_exist) { int tofd; if (debug & 4) say ("Copying %s %s to %s\n", S_ISLNK (mode) ? "symbolic link" : "file", quotearg_n (0, from), quotearg_n (1, to)); if (S_ISLNK (mode)) { char *...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,468
copy_to_fd (const char *from, int tofd) { int fromfd; ssize_t i; if ((fromfd = open (from, O_RDONLY | O_BINARY)) < 0) pfatal ("Can't reopen file %s", quotearg (from)); while ((i = read (fromfd, buf, bufsize)) != 0) { if (i == (ssize_t) -1) read_fatal (); if (full_write (tofd, buf, i) != i)...
Dir. Trav.
0
copy_to_fd (const char *from, int tofd) { int fromfd; ssize_t i; if ((fromfd = open (from, O_RDONLY | O_BINARY)) < 0) pfatal ("Can't reopen file %s", quotearg (from)); while ((i = read (fromfd, buf, bufsize)) != 0) { if (i == (ssize_t) -1) read_fatal (); if (full_write (tofd, buf, i) != i)...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,469
create_backup (char const *to, struct stat *to_st, int *to_errno, bool leave_original, bool remember_backup) { struct stat tmp_st; int tmp_errno; /* When the input to patch modifies the same file more than once, patch only backs up the initial version of each file. To figure out which files ha...
Dir. Trav.
0
create_backup (char const *to, struct stat *to_st, int *to_errno, bool leave_original, bool remember_backup) { struct stat tmp_st; int tmp_errno; /* When the input to patch modifies the same file more than once, patch only backs up the initial version of each file. To figure out which files ha...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,470
create_file (char const *file, int open_flags, mode_t mode, bool to_dir_known_to_exist) { int try_makedirs_errno = to_dir_known_to_exist ? 0 : ENOENT; int fd; mode |= S_IRUSR | S_IWUSR; mode &= ~ (S_IXUSR | S_IXGRP | S_IXOTH); do { if (! (O_CREAT && O_TRUNC)) close (creat (file, mode)); ...
Dir. Trav.
0
create_file (char const *file, int open_flags, mode_t mode, bool to_dir_known_to_exist) { int try_makedirs_errno = to_dir_known_to_exist ? 0 : ENOENT; int fd; mode |= S_IRUSR | S_IWUSR; mode &= ~ (S_IXUSR | S_IXGRP | S_IXOTH); do { if (! (O_CREAT && O_TRUNC)) close (creat (file, mode)); ...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,471
exit_with_signal (int sig) { sigset_t s; signal (sig, SIG_DFL); sigemptyset (&s); sigaddset (&s, sig); sigprocmask (SIG_UNBLOCK, &s, (sigset_t *) 0); raise (sig); exit (2); }
Dir. Trav.
0
exit_with_signal (int sig) { sigset_t s; signal (sig, SIG_DFL); sigemptyset (&s); sigaddset (&s, sig); sigprocmask (SIG_UNBLOCK, &s, (sigset_t *) 0); raise (sig); exit (2); }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,472
fatal_exit_handler (int sig) { signal (sig, SIG_IGN); fatal_exit (sig); }
Dir. Trav.
0
fatal_exit_handler (int sig) { signal (sig, SIG_IGN); fatal_exit (sig); }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,473
file_id_comparator (void const *entry1, void const *entry2) { file_id const *e1 = entry1; file_id const *e2 = entry2; return (e1->ino == e2->ino && e1->dev == e2->dev); }
Dir. Trav.
0
file_id_comparator (void const *entry1, void const *entry2) { file_id const *e1 = entry1; file_id const *e2 = entry2; return (e1->ino == e2->ino && e1->dev == e2->dev); }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,474
format_linenum (char numbuf[LINENUM_LENGTH_BOUND + 1], lin n) { char *p = numbuf + LINENUM_LENGTH_BOUND; *p = '\0'; if (n < 0) { do *--p = '0' - (int) (n % 10); while ((n /= 10) != 0); *--p = '-'; } else { do *--p = '0' + (int) (n % 10); while ((n /= 10) != 0); ...
Dir. Trav.
0
format_linenum (char numbuf[LINENUM_LENGTH_BOUND + 1], lin n) { char *p = numbuf + LINENUM_LENGTH_BOUND; *p = '\0'; if (n < 0) { do *--p = '0' - (int) (n % 10); while ((n /= 10) != 0); *--p = '-'; } else { do *--p = '0' + (int) (n % 10); while ((n /= 10) != 0); ...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,475
ignore_signals (void) { #if HAVE_SIGPROCMASK || HAVE_SIGSETMASK sigprocmask (SIG_BLOCK, &signals_to_block, &initial_signal_mask); #else int i; for (i = 0; i < NUM_SIGS; i++) if (sigismember (&signals_to_block, sigs[i])) signal (sigs[i], SIG_IGN); #endif }
Dir. Trav.
0
ignore_signals (void) { #if HAVE_SIGPROCMASK || HAVE_SIGSETMASK sigprocmask (SIG_BLOCK, &signals_to_block, &initial_signal_mask); #else int i; for (i = 0; i < NUM_SIGS; i++) if (sigismember (&signals_to_block, sigs[i])) signal (sigs[i], SIG_IGN); #endif }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,476
init_backup_hash_table (void) { file_id_table = hash_initialize (0, NULL, file_id_hasher, file_id_comparator, free); if (!file_id_table) xalloc_die (); }
Dir. Trav.
0
init_backup_hash_table (void) { file_id_table = hash_initialize (0, NULL, file_id_hasher, file_id_comparator, free); if (!file_id_table) xalloc_die (); }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,477
init_time (void) { gettime (&initial_time); }
Dir. Trav.
0
init_time (void) { gettime (&initial_time); }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,478
insert_file (struct stat const *st) { file_id *p; static file_id *next_slot; if (!next_slot) next_slot = xmalloc (sizeof *next_slot); next_slot->dev = st->st_dev; next_slot->ino = st->st_ino; p = hash_insert (file_id_table, next_slot); if (!p) xalloc_die (); if (p == next_slot) n...
Dir. Trav.
0
insert_file (struct stat const *st) { file_id *p; static file_id *next_slot; if (!next_slot) next_slot = xmalloc (sizeof *next_slot); next_slot->dev = st->st_dev; next_slot->ino = st->st_ino; p = hash_insert (file_id_table, next_slot); if (!p) xalloc_die (); if (p == next_slot) n...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,479
makedirs (char const *name) { char *filename = xstrdup (name); char *f; char *flim = replace_slashes (filename); if (flim) { /* Create any missing directories, replacing NULs by '/'s. Ignore errors. We may have to keep going even after an EEXIST, since the path may contain ".."s; and when there ...
Dir. Trav.
0
makedirs (char const *name) { char *filename = xstrdup (name); char *f; char *flim = replace_slashes (filename); if (flim) { /* Create any missing directories, replacing NULs by '/'s. Ignore errors. We may have to keep going even after an EEXIST, since the path may contain ".."s; and when there ...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,480
move_file (char const *from, int *from_needs_removal, struct stat const *fromst, char const *to, mode_t mode, bool backup) { struct stat to_st; int to_errno = -1; if (backup) create_backup (to, &to_st, &to_errno, false, from == NULL); if (from) { if (S_ISLNK (mode)) { bool to_dir_kno...
Dir. Trav.
0
move_file (char const *from, int *from_needs_removal, struct stat const *fromst, char const *to, mode_t mode, bool backup) { struct stat to_st; int to_errno = -1; if (backup) create_backup (to, &to_st, &to_errno, false, from == NULL); if (from) { if (S_ISLNK (mode)) { bool to_dir_kno...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,481
ok_to_reverse (char const *format, ...) { bool r = false; if (noreverse || ! (force && verbosity == SILENT)) { va_list args; va_start (args, format); vsay (format, args); va_end (args); } if (noreverse) { say (" Skipping patch.\n"); skip_rest_of_patch = true; ...
Dir. Trav.
0
ok_to_reverse (char const *format, ...) { bool r = false; if (noreverse || ! (force && verbosity == SILENT)) { va_list args; va_start (args, format); vsay (format, args); va_end (args); } if (noreverse) { say (" Skipping patch.\n"); skip_rest_of_patch = true; ...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,482
pfatal (char const *format, ...) { int errnum = errno; va_list args; fprintf (stderr, "%s: **** ", program_name); va_start (args, format); vfprintf (stderr, format, args); va_end (args); fflush (stderr); /* perror bypasses stdio on some hosts. */ errno = errnum; perror (" "); fflush (stderr); fat...
Dir. Trav.
0
pfatal (char const *format, ...) { int errnum = errno; va_list args; fprintf (stderr, "%s: **** ", program_name); va_start (args, format); vfprintf (stderr, format, args); va_end (args); fflush (stderr); /* perror bypasses stdio on some hosts. */ errno = errnum; perror (" "); fflush (stderr); fat...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,483
read_fatal (void) { pfatal ("read error"); }
Dir. Trav.
0
read_fatal (void) { pfatal ("read error"); }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,484
remove_prefix (char *p, size_t prefixlen) { char const *s = p + prefixlen; while ((*p++ = *s++)) /* do nothing */ ; }
Dir. Trav.
0
remove_prefix (char *p, size_t prefixlen) { char const *s = p + prefixlen; while ((*p++ = *s++)) /* do nothing */ ; }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,485
removedirs (char const *name) { char *filename = xstrdup (name); size_t i; for (i = strlen (filename); i != 0; i--) if (ISSLASH (filename[i]) && ! (ISSLASH (filename[i - 1]) || (filename[i - 1] == '.' && (i == 1 || ISSLASH (filename[i - 2]) || (filename[i - 2] == '.' && (i ...
Dir. Trav.
0
removedirs (char const *name) { char *filename = xstrdup (name); size_t i; for (i = strlen (filename); i != 0; i--) if (ISSLASH (filename[i]) && ! (ISSLASH (filename[i - 1]) || (filename[i - 1] == '.' && (i == 1 || ISSLASH (filename[i - 2]) || (filename[i - 2] == '.' && (i ...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,486
replace_slashes (char *filename) { char *f; char *last_location_replaced = 0; char const *component_start; for (f = filename + FILE_SYSTEM_PREFIX_LEN (filename); ISSLASH (*f); f++) /* do nothing */ ; component_start = f; for (; *f; f++) if (ISSLASH (*f)) { char *slash = f; /* Treat mul...
Dir. Trav.
0
replace_slashes (char *filename) { char *f; char *last_location_replaced = 0; char const *component_start; for (f = filename + FILE_SYSTEM_PREFIX_LEN (filename); ISSLASH (*f); f++) /* do nothing */ ; component_start = f; for (; *f; f++) if (ISSLASH (*f)) { char *slash = f; /* Treat mul...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,487
savebuf (char const *s, size_t size) { char *rv; if (! size) return NULL; rv = malloc (size); if (! rv) { if (! using_plan_a) xalloc_die (); } else memcpy (rv, s, size); return rv; }
Dir. Trav.
0
savebuf (char const *s, size_t size) { char *rv; if (! size) return NULL; rv = malloc (size); if (! rv) { if (! using_plan_a) xalloc_die (); } else memcpy (rv, s, size); return rv; }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,488
savestr (char const *s) { return savebuf (s, strlen (s) + 1); }
Dir. Trav.
0
savestr (char const *s) { return savebuf (s, strlen (s) + 1); }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,489
say (char const *format, ...) { va_list args; va_start (args, format); vsay (format, args); va_end (args); }
Dir. Trav.
0
say (char const *format, ...) { va_list args; va_start (args, format); vsay (format, args); va_end (args); }
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,490
set_signals (bool reset) { int i; #if HAVE_SIGACTION struct sigaction initial_act, fatal_act; fatal_act.sa_handler = fatal_exit; sigemptyset (&fatal_act.sa_mask); fatal_act.sa_flags = 0; #define setup_handler(sig) sigaction (sig, &fatal_act, (struct sigaction *) 0) #else #define setup_handler(sig) signal (sig...
Dir. Trav.
0
set_signals (bool reset) { int i; #if HAVE_SIGACTION struct sigaction initial_act, fatal_act; fatal_act.sa_handler = fatal_exit; sigemptyset (&fatal_act.sa_mask); fatal_act.sa_flags = 0; #define setup_handler(sig) sigaction (sig, &fatal_act, (struct sigaction *) 0) #else #define setup_handler(sig) signal (sig...
@@ -3,7 +3,7 @@ /* Copyright (C) 1986 Larry Wall Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2006, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms ...
CWE-22
null
null
4,491
static const char *event_name(XHCIEvent *event) { return lookup_name(event->ccode, TRBCCode_names, ARRAY_SIZE(TRBCCode_names)); }
DoS
0
static const char *event_name(XHCIEvent *event) { return lookup_name(event->ccode, TRBCCode_names, ARRAY_SIZE(TRBCCode_names)); }
@@ -390,6 +390,7 @@ struct XHCIEPContext { dma_addr_t pctx; unsigned int max_psize; uint32_t state; + uint32_t kick_active; /* streams */ unsigned int max_pstreams; @@ -2131,6 +2132,9 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, return; } + if (epctx...
CWE-835
null
null
4,492
static const char *lookup_name(uint32_t index, const char **list, uint32_t llen) { if (index >= llen || list[index] == NULL) { return "???"; } return list[index]; }
DoS
0
static const char *lookup_name(uint32_t index, const char **list, uint32_t llen) { if (index >= llen || list[index] == NULL) { return "???"; } return list[index]; }
@@ -390,6 +390,7 @@ struct XHCIEPContext { dma_addr_t pctx; unsigned int max_psize; uint32_t state; + uint32_t kick_active; /* streams */ unsigned int max_pstreams; @@ -2131,6 +2132,9 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, return; } + if (epctx...
CWE-835
null
null
4,493
static uint32_t rotl(uint32_t v, unsigned count) { count &= 31; return (v << count) | (v >> (32 - count)); }
DoS
0
static uint32_t rotl(uint32_t v, unsigned count) { count &= 31; return (v << count) | (v >> (32 - count)); }
@@ -390,6 +390,7 @@ struct XHCIEPContext { dma_addr_t pctx; unsigned int max_psize; uint32_t state; + uint32_t kick_active; /* streams */ unsigned int max_pstreams; @@ -2131,6 +2132,9 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, return; } + if (epctx...
CWE-835
null
null
4,494
static const char *trb_name(XHCITRB *trb) { return lookup_name(TRB_TYPE(*trb), TRBType_names, ARRAY_SIZE(TRBType_names)); }
DoS
0
static const char *trb_name(XHCITRB *trb) { return lookup_name(TRB_TYPE(*trb), TRBType_names, ARRAY_SIZE(TRBType_names)); }
@@ -390,6 +390,7 @@ struct XHCIEPContext { dma_addr_t pctx; unsigned int max_psize; uint32_t state; + uint32_t kick_active; /* streams */ unsigned int max_pstreams; @@ -2131,6 +2132,9 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, return; } + if (epctx...
CWE-835
null
null
4,495
static void usb_xhci_exit(PCIDevice *dev) { int i; XHCIState *xhci = XHCI(dev); trace_usb_xhci_exit(); for (i = 0; i < xhci->numslots; i++) { xhci_disable_slot(xhci, i + 1); } if (xhci->mfwrap_timer) { timer_del(xhci->mfwrap_timer); timer_free(xhci->mfwrap_timer); ...
DoS
0
static void usb_xhci_exit(PCIDevice *dev) { int i; XHCIState *xhci = XHCI(dev); trace_usb_xhci_exit(); for (i = 0; i < xhci->numslots; i++) { xhci_disable_slot(xhci, i + 1); } if (xhci->mfwrap_timer) { timer_del(xhci->mfwrap_timer); timer_free(xhci->mfwrap_timer); ...
@@ -390,6 +390,7 @@ struct XHCIEPContext { dma_addr_t pctx; unsigned int max_psize; uint32_t state; + uint32_t kick_active; /* streams */ unsigned int max_pstreams; @@ -2131,6 +2132,9 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, return; } + if (epctx...
CWE-835
null
null
4,496
static void usb_xhci_init(XHCIState *xhci) { DeviceState *dev = DEVICE(xhci); XHCIPort *port; int i, usbports, speedmask; xhci->usbsts = USBSTS_HCH; if (xhci->numports_2 > MAXPORTS_2) { xhci->numports_2 = MAXPORTS_2; } if (xhci->numports_3 > MAXPORTS_3) { xhci->numports_3 =...
DoS
0
static void usb_xhci_init(XHCIState *xhci) { DeviceState *dev = DEVICE(xhci); XHCIPort *port; int i, usbports, speedmask; xhci->usbsts = USBSTS_HCH; if (xhci->numports_2 > MAXPORTS_2) { xhci->numports_2 = MAXPORTS_2; } if (xhci->numports_3 > MAXPORTS_3) { xhci->numports_3 =...
@@ -390,6 +390,7 @@ struct XHCIEPContext { dma_addr_t pctx; unsigned int max_psize; uint32_t state; + uint32_t kick_active; /* streams */ unsigned int max_pstreams; @@ -2131,6 +2132,9 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, return; } + if (epctx...
CWE-835
null
null
4,497
static int usb_xhci_post_load(void *opaque, int version_id) { XHCIState *xhci = opaque; PCIDevice *pci_dev = PCI_DEVICE(xhci); XHCISlot *slot; XHCIEPContext *epctx; dma_addr_t dcbaap, pctx; uint32_t slot_ctx[4]; uint32_t ep_ctx[5]; int slotid, epid, state, intr; dcbaap = xhci_addr64...
DoS
0
static int usb_xhci_post_load(void *opaque, int version_id) { XHCIState *xhci = opaque; PCIDevice *pci_dev = PCI_DEVICE(xhci); XHCISlot *slot; XHCIEPContext *epctx; dma_addr_t dcbaap, pctx; uint32_t slot_ctx[4]; uint32_t ep_ctx[5]; int slotid, epid, state, intr; dcbaap = xhci_addr64...
@@ -390,6 +390,7 @@ struct XHCIEPContext { dma_addr_t pctx; unsigned int max_psize; uint32_t state; + uint32_t kick_active; /* streams */ unsigned int max_pstreams; @@ -2131,6 +2132,9 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, return; } + if (epctx...
CWE-835
null
null
4,498
static inline dma_addr_t xhci_addr64(uint32_t low, uint32_t high) { if (sizeof(dma_addr_t) == 4) { return low; } else { return low | (((dma_addr_t)high << 16) << 16); } }
DoS
0
static inline dma_addr_t xhci_addr64(uint32_t low, uint32_t high) { if (sizeof(dma_addr_t) == 4) { return low; } else { return low | (((dma_addr_t)high << 16) << 16); } }
@@ -390,6 +390,7 @@ struct XHCIEPContext { dma_addr_t pctx; unsigned int max_psize; uint32_t state; + uint32_t kick_active; /* streams */ unsigned int max_pstreams; @@ -2131,6 +2132,9 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, return; } + if (epctx...
CWE-835
null
null
4,499
static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid, uint64_t pictx, bool bsr) { XHCISlot *slot; USBPort *uport; USBDevice *dev; dma_addr_t ictx, octx, dcbaap; uint64_t poctx; uint32_t ictl_ctx[2]; uint32_t slot_ctx[4]; uint32_t ep0_ct...
DoS
0
static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid, uint64_t pictx, bool bsr) { XHCISlot *slot; USBPort *uport; USBDevice *dev; dma_addr_t ictx, octx, dcbaap; uint64_t poctx; uint32_t ictl_ctx[2]; uint32_t slot_ctx[4]; uint32_t ep0_ct...
@@ -390,6 +390,7 @@ struct XHCIEPContext { dma_addr_t pctx; unsigned int max_psize; uint32_t state; + uint32_t kick_active; /* streams */ unsigned int max_pstreams; @@ -2131,6 +2132,9 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, return; } + if (epctx...
CWE-835
null
null