Dataset Viewer
Auto-converted to Parquet Duplicate
idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
0
static bool check_rodc_critical_attribute(struct ldb_message *msg) { uint32_t schemaFlagsEx, searchFlags, rodc_filtered_flags; schemaFlagsEx = ldb_msg_find_attr_as_uint(msg, "schemaFlagsEx", 0); searchFlags = ldb_msg_find_attr_as_uint(msg, "searchFlags", 0); rodc_filtered_flags = (SEARCH_FLAG_RODC_ATTRIBUTE ...
Bypass
0
static bool check_rodc_critical_attribute(struct ldb_message *msg) { uint32_t schemaFlagsEx, searchFlags, rodc_filtered_flags; schemaFlagsEx = ldb_msg_find_attr_as_uint(msg, "schemaFlagsEx", 0); searchFlags = ldb_msg_find_attr_as_uint(msg, "searchFlags", 0); rodc_filtered_flags = (SEARCH_FLAG_RODC_ATTRIBUTE ...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
1
static int samldb_add_entry(struct samldb_ctx *ac) { struct ldb_context *ldb; struct ldb_request *req; int ret; ldb = ldb_module_get_ctx(ac->module); ret = ldb_build_add_req(&req, ldb, ac, ac->msg, ac->req->controls, ac, samldb_add_entry_callback, ac->req); LDB_REQ_SET_LOCATION(req); if (ret !=...
Bypass
0
static int samldb_add_entry(struct samldb_ctx *ac) { struct ldb_context *ldb; struct ldb_request *req; int ret; ldb = ldb_module_get_ctx(ac->module); ret = ldb_build_add_req(&req, ldb, ac, ac->msg, ac->req->controls, ac, samldb_add_entry_callback, ac->req); LDB_REQ_SET_LOCATION(req); if (ret !=...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
2
static int samldb_add_entry_callback(struct ldb_request *req, struct ldb_reply *ares) { struct ldb_context *ldb; struct samldb_ctx *ac; int ret; ac = talloc_get_type(req->context, struct samldb_ctx); ldb = ldb_module_get_ctx(ac->module); if (!ares) { return ldb_module_done(ac->req, NULL, NULL, LDB_E...
Bypass
0
static int samldb_add_entry_callback(struct ldb_request *req, struct ldb_reply *ares) { struct ldb_context *ldb; struct samldb_ctx *ac; int ret; ac = talloc_get_type(req->context, struct samldb_ctx); ldb = ldb_module_get_ctx(ac->module); if (!ares) { return ldb_module_done(ac->req, NULL, NULL, LDB_E...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
3
static int samldb_add_handle_msDS_IntId(struct samldb_ctx *ac) { int ret; bool id_exists; uint32_t msds_intid; int32_t system_flags; struct ldb_context *ldb; struct ldb_result *ldb_res; struct ldb_dn *schema_dn; struct samldb_msds_intid_persistant *msds_intid_struct; struct dsdb_schema *schema; ldb = ldb_mod...
Bypass
0
static int samldb_add_handle_msDS_IntId(struct samldb_ctx *ac) { int ret; bool id_exists; uint32_t msds_intid; int32_t system_flags; struct ldb_context *ldb; struct ldb_result *ldb_res; struct ldb_dn *schema_dn; struct samldb_msds_intid_persistant *msds_intid_struct; struct dsdb_schema *schema; ldb = ldb_mod...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
4
static int samldb_add_step(struct samldb_ctx *ac, samldb_step_fn_t fn) { struct samldb_step *step, *stepper; step = talloc_zero(ac, struct samldb_step); if (step == NULL) { return ldb_oom(ldb_module_get_ctx(ac->module)); } step->fn = fn; if (ac->steps == NULL) { ac->steps = step; ac->curstep = step; } e...
Bypass
0
static int samldb_add_step(struct samldb_ctx *ac, samldb_step_fn_t fn) { struct samldb_step *step, *stepper; step = talloc_zero(ac, struct samldb_step); if (step == NULL) { return ldb_oom(ldb_module_get_ctx(ac->module)); } step->fn = fn; if (ac->steps == NULL) { ac->steps = step; ac->curstep = step; } e...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
5
static int samldb_check_sAMAccountName(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); const char *name; int ret; struct ldb_result *res; const char * const noattrs[] = { NULL }; if (ldb_msg_find_element(ac->msg, "sAMAccountName") == NULL) { ret = samldb_generate_sAMAccountNa...
Bypass
0
static int samldb_check_sAMAccountName(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); const char *name; int ret; struct ldb_result *res; const char * const noattrs[] = { NULL }; if (ldb_msg_find_element(ac->msg, "sAMAccountName") == NULL) { ret = samldb_generate_sAMAccountNa...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
6
static int samldb_check_user_account_control_invariants(struct samldb_ctx *ac, uint32_t user_account_control) { int i, ret = 0; bool need_check = false; const struct uac_to_guid { uint32_t uac; bool never; uint32_t needs; uint32_t not_with; const char *error_string; } map[] = { { .uac = UF_...
Bypass
0
static int samldb_check_user_account_control_invariants(struct samldb_ctx *ac, uint32_t user_account_control) { int i, ret = 0; bool need_check = false; const struct uac_to_guid { uint32_t uac; bool never; uint32_t needs; uint32_t not_with; const char *error_string; } map[] = { { .uac = UF_...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
7
static struct samldb_ctx *samldb_ctx_init(struct ldb_module *module, struct ldb_request *req) { struct ldb_context *ldb; struct samldb_ctx *ac; ldb = ldb_module_get_ctx(module); ac = talloc_zero(req, struct samldb_ctx); if (ac == NULL) { ldb_oom(ldb); return NULL; } ac->module = module; ac->req = ...
Bypass
0
static struct samldb_ctx *samldb_ctx_init(struct ldb_module *module, struct ldb_request *req) { struct ldb_context *ldb; struct samldb_ctx *ac; ldb = ldb_module_get_ctx(module); ac = talloc_zero(req, struct samldb_ctx); if (ac == NULL) { ldb_oom(ldb); return NULL; } ac->module = module; ac->req = ...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
8
static int samldb_fill_foreignSecurityPrincipal_object(struct samldb_ctx *ac) { struct ldb_context *ldb; const struct ldb_val *rdn_value; struct dom_sid *sid; int ret; ldb = ldb_module_get_ctx(ac->module); sid = samdb_result_dom_sid(ac->msg, ac->msg, "objectSid"); if (sid == NULL) { rdn_value = ldb_dn_get_rd...
Bypass
0
static int samldb_fill_foreignSecurityPrincipal_object(struct samldb_ctx *ac) { struct ldb_context *ldb; const struct ldb_val *rdn_value; struct dom_sid *sid; int ret; ldb = ldb_module_get_ctx(ac->module); sid = samdb_result_dom_sid(ac->msg, ac->msg, "objectSid"); if (sid == NULL) { rdn_value = ldb_dn_get_rd...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
9
static int samldb_find_for_defaultObjectCategory(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); struct ldb_result *res; const char * const no_attrs[] = { NULL }; int ret; ac->res_dn = NULL; ret = dsdb_module_search(ac->module, ac, &res, ac->dn, LDB_SCOPE_BASE, no_attrs, ...
Bypass
0
static int samldb_find_for_defaultObjectCategory(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); struct ldb_result *res; const char * const no_attrs[] = { NULL }; int ret; ac->res_dn = NULL; ret = dsdb_module_search(ac->module, ac, &res, ac->dn, LDB_SCOPE_BASE, no_attrs, ...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
10
static bool samldb_krbtgtnumber_available(struct samldb_ctx *ac, uint32_t krbtgt_number) { TALLOC_CTX *tmp_ctx = talloc_new(ac); struct ldb_result *res; const char * const no_attrs[] = { NULL }; int ret; ret = dsdb_module_search(ac->module, tmp_ctx, &res, ldb_get_default_basedn(ldb_module_get_ctx(ac->...
Bypass
0
static bool samldb_krbtgtnumber_available(struct samldb_ctx *ac, uint32_t krbtgt_number) { TALLOC_CTX *tmp_ctx = talloc_new(ac); struct ldb_result *res; const char * const no_attrs[] = { NULL }; int ret; ret = dsdb_module_search(ac->module, tmp_ctx, &res, ldb_get_default_basedn(ldb_module_get_ctx(ac->...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
11
static int samldb_next_step(struct samldb_ctx *ac) { if (ac->curstep->next) { ac->curstep = ac->curstep->next; return ac->curstep->fn(ac); } /* We exit the samldb module here. If someone set an "ares" to forward * controls and response back to the caller, use them. */ if (ac->ares) { return ldb_module_done...
Bypass
0
static int samldb_next_step(struct samldb_ctx *ac) { if (ac->curstep->next) { ac->curstep = ac->curstep->next; return ac->curstep->fn(ac); } /* We exit the samldb module here. If someone set an "ares" to forward * controls and response back to the caller, use them. */ if (ac->ares) { return ldb_module_done...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
12
static int samldb_objectclass_trigger(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); void *skip_allocate_sids = ldb_get_opaque(ldb, "skip_allocate_sids"); struct ldb_message_element *el, *el2; struct dom_sid *sid; int ret; /* make sure that "sAMAccountType" is not spec...
Bypass
0
static int samldb_objectclass_trigger(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); void *skip_allocate_sids = ldb_get_opaque(ldb, "skip_allocate_sids"); struct ldb_message_element *el, *el2; struct dom_sid *sid; int ret; /* make sure that "sAMAccountType" is not spec...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
13
static int samldb_prim_group_set(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); uint32_t rid; rid = ldb_msg_find_attr_as_uint(ac->msg, "primaryGroupID", (uint32_t) -1); if (rid == (uint32_t) -1) { /* we aren't affected of any primary group set */ return LDB_SUCCESS; } else...
Bypass
0
static int samldb_prim_group_set(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); uint32_t rid; rid = ldb_msg_find_attr_as_uint(ac->msg, "primaryGroupID", (uint32_t) -1); if (rid == (uint32_t) -1) { /* we aren't affected of any primary group set */ return LDB_SUCCESS; } else...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
14
static int samldb_prim_group_tester(struct samldb_ctx *ac, uint32_t rid) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); struct dom_sid *sid; struct ldb_result *res; int ret; const char * const noattrs[] = { NULL }; sid = dom_sid_add_rid(ac, samdb_domain_sid(ldb), rid); if (sid == NULL) { return l...
Bypass
0
static int samldb_prim_group_tester(struct samldb_ctx *ac, uint32_t rid) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); struct dom_sid *sid; struct ldb_result *res; int ret; const char * const noattrs[] = { NULL }; sid = dom_sid_add_rid(ac, samdb_domain_sid(ldb), rid); if (sid == NULL) { return l...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
15
static int samldb_prim_group_trigger(struct samldb_ctx *ac) { int ret; if (ac->req->operation == LDB_ADD) { ret = samldb_prim_group_set(ac); } else { ret = samldb_prim_group_change(ac); } return ret; }
Bypass
0
static int samldb_prim_group_trigger(struct samldb_ctx *ac) { int ret; if (ac->req->operation == LDB_ADD) { ret = samldb_prim_group_set(ac); } else { ret = samldb_prim_group_change(ac); } return ret; }
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
16
static int samldb_rodc_add(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); uint32_t krbtgt_number, i_start, i; int ret; char *newpass; struct ldb_val newpass_utf16; /* find a unused msDC-SecondaryKrbTgtNumber */ i_start = generate_random() & 0xFFFF; if (i_start == 0) { i_st...
Bypass
0
static int samldb_rodc_add(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); uint32_t krbtgt_number, i_start, i; int ret; char *newpass; struct ldb_val newpass_utf16; /* find a unused msDC-SecondaryKrbTgtNumber */ i_start = generate_random() & 0xFFFF; if (i_start == 0) { i_st...
@@ -1558,12 +1558,15 @@ static int samldb_check_user_account_control_acl(struct samldb_ctx *ac, struct security_token *user_token; struct security_descriptor *domain_sd; struct ldb_dn *domain_dn = ldb_get_default_basedn(ldb_module_get_ctx(ac->module)); + struct ldb_context *ldb = ldb_modul...
CWE-264
null
null
17
acl_get_file_mode(const char *path_p) { struct stat st; if (stat(path_p, &st) != 0) return NULL; return acl_from_mode(st.st_mode); }
null
0
acl_get_file_mode(const char *path_p) { struct stat st; if (stat(path_p, &st) != 0) return NULL; return acl_from_mode(st.st_mode); }
@@ -1,3 +1,6 @@+* Make sure that getfacl -R only calls stat(2) on symlinks when it needs to.+ This fixes http://oss.sgi.com/bugzilla/show_bug.cgi?id=790 "getfacl follows+ symlinks, even without -L". * Stop quoting nonprintable characters in the getfacl output: what is printable or not depends on the locale settings...
CWE-264
null
null
18
void acl_mask_perm_str(acl_t acl, char *str) { acl_entry_t entry; str[0] = '\0'; if (acl_get_entry(acl, ACL_FIRST_ENTRY, &entry) != 1) return; for(;;) { acl_tag_t tag; acl_get_tag_type(entry, &tag); if (tag == ACL_MASK) { acl_perm_str(entry, str); return; } if (acl_get_entry(acl, ACL_NEXT_ENTRY,...
null
0
void acl_mask_perm_str(acl_t acl, char *str) { acl_entry_t entry; str[0] = '\0'; if (acl_get_entry(acl, ACL_FIRST_ENTRY, &entry) != 1) return; for(;;) { acl_tag_t tag; acl_get_tag_type(entry, &tag); if (tag == ACL_MASK) { acl_perm_str(entry, str); return; } if (acl_get_entry(acl, ACL_NEXT_ENTRY,...
@@ -1,3 +1,6 @@+* Make sure that getfacl -R only calls stat(2) on symlinks when it needs to.+ This fixes http://oss.sgi.com/bugzilla/show_bug.cgi?id=790 "getfacl follows+ symlinks, even without -L". * Stop quoting nonprintable characters in the getfacl output: what is printable or not depends on the locale settings...
CWE-264
null
null
19
void apply_mask(char *perm, const char *mask) { while (*perm) { if (*mask == '-' && *perm >= 'a' && *perm <= 'z') *perm = *perm - 'a' + 'A'; perm++; if (*mask) mask++; } }
null
0
void apply_mask(char *perm, const char *mask) { while (*perm) { if (*mask == '-' && *perm >= 'a' && *perm <= 'z') *perm = *perm - 'a' + 'A'; perm++; if (*mask) mask++; } }
@@ -1,3 +1,6 @@+* Make sure that getfacl -R only calls stat(2) on symlinks when it needs to.+ This fixes http://oss.sgi.com/bugzilla/show_bug.cgi?id=790 "getfacl follows+ symlinks, even without -L". * Stop quoting nonprintable characters in the getfacl output: what is printable or not depends on the locale settings...
CWE-264
null
null
20
int do_show(FILE *stream, const char *path_p, const struct stat *st, acl_t acl, acl_t dacl) { struct name_list *acl_names = get_list(st, acl), *first_acl_name = acl_names; struct name_list *dacl_names = get_list(st, dacl), *first_dacl_name = dacl_names; int acl_names...
null
0
int do_show(FILE *stream, const char *path_p, const struct stat *st, acl_t acl, acl_t dacl) { struct name_list *acl_names = get_list(st, acl), *first_acl_name = acl_names; struct name_list *dacl_names = get_list(st, dacl), *first_dacl_name = dacl_names; int acl_names...
@@ -1,3 +1,6 @@+* Make sure that getfacl -R only calls stat(2) on symlinks when it needs to.+ This fixes http://oss.sgi.com/bugzilla/show_bug.cgi?id=790 "getfacl follows+ symlinks, even without -L". * Stop quoting nonprintable characters in the getfacl output: what is printable or not depends on the locale settings...
CWE-264
null
null
21
void free_list(struct name_list *names) { struct name_list *next; while (names) { next = names->next; free(names); names = next; } }
null
0
void free_list(struct name_list *names) { struct name_list *next; while (names) { next = names->next; free(names); names = next; } }
@@ -1,3 +1,6 @@+* Make sure that getfacl -R only calls stat(2) on symlinks when it needs to.+ This fixes http://oss.sgi.com/bugzilla/show_bug.cgi?id=790 "getfacl follows+ symlinks, even without -L". * Stop quoting nonprintable characters in the getfacl output: what is printable or not depends on the locale settings...
CWE-264
null
null
22
struct name_list *get_list(const struct stat *st, acl_t acl) { struct name_list *first = NULL, *last = NULL; acl_entry_t ent; int ret = 0; if (acl != NULL) ret = acl_get_entry(acl, ACL_FIRST_ENTRY, &ent); if (ret != 1) return NULL; while (ret > 0) { acl_tag_t e_type; const id_t *id_p; const char *name ...
null
0
struct name_list *get_list(const struct stat *st, acl_t acl) { struct name_list *first = NULL, *last = NULL; acl_entry_t ent; int ret = 0; if (acl != NULL) ret = acl_get_entry(acl, ACL_FIRST_ENTRY, &ent); if (ret != 1) return NULL; while (ret > 0) { acl_tag_t e_type; const id_t *id_p; const char *name ...
@@ -1,3 +1,6 @@+* Make sure that getfacl -R only calls stat(2) on symlinks when it needs to.+ This fixes http://oss.sgi.com/bugzilla/show_bug.cgi?id=790 "getfacl follows+ symlinks, even without -L". * Stop quoting nonprintable characters in the getfacl output: what is printable or not depends on the locale settings...
CWE-264
null
null
23
void help(void) { printf(_("%s %s -- get file access control lists\n"), progname, VERSION); printf(_("Usage: %s [-%s] file ...\n"), progname, cmd_line_options); #if !POSIXLY_CORRECT if (posixly_correct) { #endif printf(_( " -d, --default display the default access control list\n")); #i...
null
0
void help(void) { printf(_("%s %s -- get file access control lists\n"), progname, VERSION); printf(_("Usage: %s [-%s] file ...\n"), progname, cmd_line_options); #if !POSIXLY_CORRECT if (posixly_correct) { #endif printf(_( " -d, --default display the default access control list\n")); #i...
@@ -1,3 +1,6 @@+* Make sure that getfacl -R only calls stat(2) on symlinks when it needs to.+ This fixes http://oss.sgi.com/bugzilla/show_bug.cgi?id=790 "getfacl follows+ symlinks, even without -L". * Stop quoting nonprintable characters in the getfacl output: what is printable or not depends on the locale settings...
CWE-264
null
null
24
int main(int argc, char *argv[]) { int opt; char *line; progname = basename(argv[0]); #if POSIXLY_CORRECT cmd_line_options = POSIXLY_CMD_LINE_OPTIONS; #else if (getenv(POSIXLY_CORRECT_STR)) posixly_correct = 1; if (!posixly_correct) cmd_line_options = CMD_LINE_OPTIONS; else cmd_line_options = POSIXLY_CMD...
null
0
int main(int argc, char *argv[]) { int opt; char *line; progname = basename(argv[0]); #if POSIXLY_CORRECT cmd_line_options = POSIXLY_CMD_LINE_OPTIONS; #else if (getenv(POSIXLY_CORRECT_STR)) posixly_correct = 1; if (!posixly_correct) cmd_line_options = CMD_LINE_OPTIONS; else cmd_line_options = POSIXLY_CMD...
@@ -1,3 +1,6 @@+* Make sure that getfacl -R only calls stat(2) on symlinks when it needs to.+ This fixes http://oss.sgi.com/bugzilla/show_bug.cgi?id=790 "getfacl follows+ symlinks, even without -L". * Stop quoting nonprintable characters in the getfacl output: what is printable or not depends on the locale settings...
CWE-264
null
null
25
int show_line(FILE *stream, struct name_list **acl_names, acl_t acl, acl_entry_t *acl_ent, const char *acl_mask, struct name_list **dacl_names, acl_t dacl, acl_entry_t *dacl_ent, const char *dacl_mask) { acl_tag_t tag_type; const char *tag, *name; char acl_perm[ACL_PERMS+1], dacl_...
null
0
int show_line(FILE *stream, struct name_list **acl_names, acl_t acl, acl_entry_t *acl_ent, const char *acl_mask, struct name_list **dacl_names, acl_t dacl, acl_entry_t *dacl_ent, const char *dacl_mask) { acl_tag_t tag_type; const char *tag, *name; char acl_perm[ACL_PERMS+1], dacl_...
@@ -1,3 +1,6 @@+* Make sure that getfacl -R only calls stat(2) on symlinks when it needs to.+ This fixes http://oss.sgi.com/bugzilla/show_bug.cgi?id=790 "getfacl follows+ symlinks, even without -L". * Stop quoting nonprintable characters in the getfacl output: what is printable or not depends on the locale settings...
CWE-264
null
null
26
static PHP_FUNCTION(preg_match_all) { php_do_pcre_match(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); }
DoS Overflow +Info
0
static PHP_FUNCTION(preg_match_all) { php_do_pcre_match(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); }
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
27
static PHP_FUNCTION(preg_replace) { preg_replace_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 0); }
DoS Overflow +Info
0
static PHP_FUNCTION(preg_replace) { preg_replace_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 0); }
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
28
static PHP_FUNCTION(preg_replace_callback) { preg_replace_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1, 0); }
DoS Overflow +Info
0
static PHP_FUNCTION(preg_replace_callback) { preg_replace_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1, 0); }
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
29
static PHP_FUNCTION(preg_filter) { preg_replace_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 1); }
DoS Overflow +Info
0
static PHP_FUNCTION(preg_filter) { preg_replace_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0, 1); }
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
30
static PHP_FUNCTION(preg_split) { char *regex; /* Regular expression */ char *subject; /* String to match against */ int regex_len; int subject_len; long limit_val = -1;/* Integer value of limit */ long flags = 0; /* Match control flags */ pcre_cache_entry *pce; /* Compiled regular ...
DoS Overflow +Info
0
static PHP_FUNCTION(preg_split) { char *regex; /* Regular expression */ char *subject; /* String to match against */ int regex_len; int subject_len; long limit_val = -1;/* Integer value of limit */ long flags = 0; /* Match control flags */ pcre_cache_entry *pce; /* Compiled regular ...
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
31
static PHP_FUNCTION(preg_quote) { int in_str_len; char *in_str; /* Input string argument */ char *in_str_end; /* End of the input string */ int delim_len = 0; char *delim = NULL; /* Additional delimiter argument */ char *out_str, /* Output string with quoted characters */ *p, /* Iterator for input...
DoS Overflow +Info
0
static PHP_FUNCTION(preg_quote) { int in_str_len; char *in_str; /* Input string argument */ char *in_str_end; /* End of the input string */ int delim_len = 0; char *delim = NULL; /* Additional delimiter argument */ char *out_str, /* Output string with quoted characters */ *p, /* Iterator for input...
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
32
static PHP_FUNCTION(preg_grep) { char *regex; /* Regular expression */ int regex_len; zval *input; /* Input array */ long flags = 0; /* Match control flags */ pcre_cache_entry *pce; /* Compiled regular expression */ /* Get arguments and do error checking */ if (zend_parse_parameters(ZEND_...
DoS Overflow +Info
0
static PHP_FUNCTION(preg_grep) { char *regex; /* Regular expression */ int regex_len; zval *input; /* Input array */ long flags = 0; /* Match control flags */ pcre_cache_entry *pce; /* Compiled regular expression */ /* Get arguments and do error checking */ if (zend_parse_parameters(ZEND_...
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
33
static PHP_GINIT_FUNCTION(pcre) /* {{{ */ { zend_hash_init(&pcre_globals->pcre_cache, 0, NULL, php_free_pcre_cache, 1); pcre_globals->backtrack_limit = 0; pcre_globals->recursion_limit = 0; pcre_globals->error_code = PHP_PCRE_NO_ERROR; } /* }}} */
DoS Overflow +Info
0
static PHP_GINIT_FUNCTION(pcre) /* {{{ */ { zend_hash_init(&pcre_globals->pcre_cache, 0, NULL, php_free_pcre_cache, 1); pcre_globals->backtrack_limit = 0; pcre_globals->recursion_limit = 0; pcre_globals->error_code = PHP_PCRE_NO_ERROR; } /* }}} */
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
34
static PHP_GSHUTDOWN_FUNCTION(pcre) /* {{{ */ { zend_hash_destroy(&pcre_globals->pcre_cache); } /* }}} */
DoS Overflow +Info
0
static PHP_GSHUTDOWN_FUNCTION(pcre) /* {{{ */ { zend_hash_destroy(&pcre_globals->pcre_cache); } /* }}} */
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
35
static PHP_MINFO_FUNCTION(pcre) { php_info_print_table_start(); php_info_print_table_row(2, "PCRE (Perl Compatible Regular Expressions) Support", "enabled" ); php_info_print_table_row(2, "PCRE Library Version", pcre_version() ); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); }
DoS Overflow +Info
0
static PHP_MINFO_FUNCTION(pcre) { php_info_print_table_start(); php_info_print_table_row(2, "PCRE (Perl Compatible Regular Expressions) Support", "enabled" ); php_info_print_table_row(2, "PCRE Library Version", pcre_version() ); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); }
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
36
static PHP_MINIT_FUNCTION(pcre) { REGISTER_INI_ENTRIES(); REGISTER_LONG_CONSTANT("PREG_PATTERN_ORDER", PREG_PATTERN_ORDER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("PREG_SET_ORDER", PREG_SET_ORDER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("PREG_OFFSET_CAPTURE", PREG_OFFSET_CAPTURE, CONST_C...
DoS Overflow +Info
0
static PHP_MINIT_FUNCTION(pcre) { REGISTER_INI_ENTRIES(); REGISTER_LONG_CONSTANT("PREG_PATTERN_ORDER", PREG_PATTERN_ORDER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("PREG_SET_ORDER", PREG_SET_ORDER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("PREG_OFFSET_CAPTURE", PREG_OFFSET_CAPTURE, CONST_C...
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
37
static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_DC) { pcre_extra *extra = pce->extra; int name_cnt = 0, name_size, ni = 0; int rc; char *name_table; unsigned short name_idx; char **subpat_names = (char **)ecalloc(num_subpats, sizeof(char *)); rc = pcre_fullinfo(pce->re, extra, PCR...
DoS Overflow +Info
0
static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_DC) { pcre_extra *extra = pce->extra; int name_cnt = 0, name_size, ni = 0; int rc; char *name_table; unsigned short name_idx; char **subpat_names = (char **)ecalloc(num_subpats, sizeof(char *)); rc = pcre_fullinfo(pce->re, extra, PCR...
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
38
static int pcre_clean_cache(void *data, void *arg TSRMLS_DC) { int *num_clean = (int *)arg; if (*num_clean > 0) { (*num_clean)--; return 1; } else { return 0; } }
DoS Overflow +Info
0
static int pcre_clean_cache(void *data, void *arg TSRMLS_DC) { int *num_clean = (int *)arg; if (*num_clean > 0) { (*num_clean)--; return 1; } else { return 0; } }
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
39
PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC) { pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex, strlen(regex) TSRMLS_CC); if (extra) { *extra = pce ? pce->extra : NULL; } if (preg_options) { *preg_options = pce ? pce->preg_options : 0; } re...
DoS Overflow +Info
0
PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC) { pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex, strlen(regex) TSRMLS_CC); if (extra) { *extra = pce ? pce->extra : NULL; } if (preg_options) { *preg_options = pce ? pce->preg_options : 0; } re...
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
40
PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_len TSRMLS_DC) { pcre *re = NULL; pcre_extra *extra; int coptions = 0; int soptions = 0; const char *error; int erroffset; char delimiter; char start_delimiter; char end_delimiter; char *p, *pp; ...
DoS Overflow +Info
0
PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_len TSRMLS_DC) { pcre *re = NULL; pcre_extra *extra; int coptions = 0; int soptions = 0; const char *error; int erroffset; char delimiter; char start_delimiter; char end_delimiter; char *p, *pp; ...
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (glo...
CWE-119
null
null
End of preview. Expand in Data Studio

MSR Data Cleaned - C/C++ Code Vulnerability Dataset

Dataset License

πŸ“Œ Dataset Description

A curated collection of C/C++ code vulnerabilities paired with:

  • CVE details (scores, classifications, exploit status)
  • Code changes (commit messages, added/deleted lines)
  • File-level and function-level diffs

πŸ” Sample Data Structure from original file

+---------------+-----------------+----------------------+---------------------------+
| CVE ID        | Attack Origin   | Publish Date         | Summary                   |
+===============+=================+======================+===========================+
| CVE-2015-8467 | Remote          | 2015-12-29           | "The samldb_check_user..."|
+---------------+-----------------+----------------------+---------------------------+
| CVE-2016-1234 | Local           | 2016-01-15           | "Buffer overflow in..."   |
+---------------+-----------------+----------------------+---------------------------+

Note: This is a simplified preview; the full dataset includes additional fields like commit_id, func_before, etc.

1. Accessing in Colab

!pip install huggingface_hub -q
from huggingface_hub import snapshot_download

repo_id = "starsofchance/MSR_data_cleaned"
dataset_path = snapshot_download(repo_id=repo_id, repo_type="dataset")

2. Extracting the Dataset

!apt-get install unzip -qq
!unzip "/root/.cache/huggingface/.../MSR_data_cleaned.zip" -d "/content/extracted_data"

**Note: Extracted size is 10GB (1.5GB compressed). Ensure sufficient disk space.

3. Creating Splits (Colab Pro Recommended)

We used this memory-efficient approach:

from datasets import load_dataset
dataset = load_dataset("csv", data_files="MSR_data_cleaned.csv", streaming=True)

# Randomly distribute rows (80-10-10)
for row in dataset:
    rand = random.random()
    if rand < 0.8: write_to(train.csv)
    elif rand < 0.9: write_to(validation.csv)
    else: write_to(test.csv)

Hardware Requirements:

  • Minimum 25GB RAM
  • Strong CPU (Colab Pro T4 GPU recommended)

##πŸ“Š Dataset Statistics

  • Number of Rows: 188,636
  • Vulnerability Distribution:
    • Vulnerable (1): 18,863 (~10%)
    • Non-Vulnerable (0): 169,773 (~90%)

##πŸ“‹ Data Fields Description

  • CVE_ID: Unique identifier for the vulnerability (Common Vulnerabilities and Exposures).
  • CWE_ID: Weakness category identifier (Common Weakness Enumeration).
  • Score: CVSS score indicating severity (float, 0-10).
  • Summary: Brief description of the vulnerability.
  • commit_id: Git commit hash linked to the code change.
  • codeLink: URL to the code repository or commit.
  • file_name: Name of the file containing the vulnerability.
  • func_after: Function code after the change.
  • lines_after: Code lines after the change.
  • Access_Gained: Type of access gained by exploiting the vulnerability.
  • Attack_Origin: Source of the attack (e.g., Remote, Local).
  • Authentication_Required: Whether authentication is needed to exploit.
  • Availability: Impact on system availability.
  • CVE_Page: URL to the CVE details page.
  • Complexity: Complexity of exploiting the vulnerability.
  • Confidentiality: Impact on data confidentiality.
  • Integrity: Impact on data integrity.
  • Known_Exploits: Details of known exploits, if any.
  • Publish_Date: Date the vulnerability was published.
  • Update_Date: Date of the last update to the vulnerability data.
  • Vulnerability_Classification: Type or category of the vulnerability.
  • add_lines: Lines added in the commit.
  • del_lines: Lines deleted in the commit.
  • commit_message: Description of the commit.
  • files_changed: List of files modified in the commit.
  • func_before: Function code before the change.
  • lang: Programming language (e.g., C, C++).
  • lines_before: Code lines before the change.

splits file for UltiVul project:

πŸ” Sample Data Structure (from train.csv)

{
 'idx': 0, # Unique ID within the train split
 'func_before': '...', # String containing function code before change
 'Vulnerability Classification': '...', # Original vulnerability type classification
 'vul': 0, # Integer: 0 for non-vulnerable, 1 for vulnerable (target label)
 'func_after': '...', # String containing function code after change
 'patch': '...', # String containing diff patch
 'CWE ID': '...', # String CWE ID, e.g., "CWE-119"
 'lines_before': '...', # String lines before change context
 'lines_after': '...' # String lines after change context
}

**Note: This shows the structure of the final split files (train.csv, validation.csv, test.csv). The original MSR_data_cleaned.csv contains many more metadata fields.

##πŸ“¦ Dataset New Files The dataset is available as three CSV files (specially created for the UltiVul project) hosted on Hugging Face, uploaded via huggingface_hub:

  • train.csv Size: 667 MB Description: Training split with 150,909 samples, approximately 80% of the data.
  • validation.csv Size: 86 MB Description: Validation split with 18,864 samples, approximately 10% of the data.
  • test.csv Size: 84.8 MB Description: Test split with 18,863 samples, approximately 10% of the data.

πŸ™ Acknowledgements Original dataset provided by Fan et al., 2020 Thanks to the Hugging Face team for dataset hosting tools.

πŸ“œ Citation

@inproceedings{fan2020ccode,
  title={A C/C++ Code Vulnerability Dataset with Code Changes and CVE Summaries},
  author={Fan, Jiahao and Li, Yi and Wang, Shaohua and Nguyen, Tien N},
  booktitle={MSR '20: 17th International Conference on Mining Software Repositories},
  pages={1--5},
  year={2020},
  doi={10.1145/3379597.3387501}
}

🌟 Dataset Creation

  • Source: Original data from MSR 2020 Paper
  • Processing:
    • Cleaned and standardized CSV format
    • Stream-based splitting to handle large size
    • Preserved all original metadata
Downloads last month
66