prompt stringclasses 1
value | completions listlengths 2 1.33k | labels listlengths 2 1.33k | source stringclasses 1
value | other_info dict | index int64 0 719 | cwe stringclasses 9
values | language stringclasses 6
values |
|---|---|---|---|---|---|---|---|
Determine whether the {function_name} code is vulnerable or not. | [
"long dd_get_item_size(struct dump_dir *dd, const char *name)\n{",
"",
" long size = -1;\n char *iname = concat_path_file(dd->dd_dirname, name);\n struct stat statbuf;",
" if (lstat(iname, &statbuf) == 0 && S_ISREG(statbuf.st_mode))\n size = statbuf.st_size;\n else\n {\n if (er... | [
1,
0,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 196,
"char_start": 67,
"chars": "if (!str_is_correct_filename(name))\n error_msg_and_die(\"Cannot get item size. '%s' is not a valid file name\", name);\n\n "
}
],
"deleted": []
},
"commit_link": "github.com/abr... | 0 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"long dd_get_item_size(struct dump_dir *dd, const char *name)\n{",
" if (!str_is_correct_filename(name))\n error_msg_and_die(\"Cannot get item size. '%s' is not a valid file name\", name);\n",
" long size = -1;\n char *iname = concat_path_file(dd->dd_dirname, name);\n struct stat statbuf;",
... | [
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 196,
"char_start": 67,
"chars": "if (!str_is_correct_filename(name))\n error_msg_and_die(\"Cannot get item size. '%s' is not a valid file name\", name);\n\n "
}
],
"deleted": []
},
"commit_link": "github.com/abr... | 0 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"def zmi_page_request(self, *args, **kwargs):\r\n request = self.REQUEST\r\n RESPONSE = request.RESPONSE\r\n SESSION = request.SESSION\r\n self._zmi_page_request()\r\n RESPONSE.setHeader('Expires',DateTime(request['ZMI_TIME']-10000).toZone('GMT+1').rfc822())\r\n RESPONSE.setHeader('Cac... | [
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1363,
"char_start": 1322,
"chars": "self.getDocumentElement().id in path and "
}
],
"deleted": []
},
"commit_link": "github.com/zms-publishing/zms4/commit/3f28620d475220dfdb06f79787158ac50727c61a",
"file_name": "ZMSItem... | 1 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def zmi_page_request(self, *args, **kwargs):\r\n request = self.REQUEST\r\n RESPONSE = request.RESPONSE\r\n SESSION = request.SESSION\r\n self._zmi_page_request()\r\n RESPONSE.setHeader('Expires',DateTime(request['ZMI_TIME']-10000).toZone('GMT+1').rfc822())\r\n RESPONSE.setHeader('Cac... | [
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1363,
"char_start": 1322,
"chars": "self.getDocumentElement().id in path and "
}
],
"deleted": []
},
"commit_link": "github.com/zms-publishing/zms4/commit/3f28620d475220dfdb06f79787158ac50727c61a",
"file_name": "ZMSItem... | 1 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"static int nntp_hcache_namer(const char *path, char *dest, size_t destlen)\n{",
" return snprintf(dest, destlen, \"%s.hcache\", path);",
"}"
] | [
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 81,
"char_start": 79,
"chars": "in"
},
{
"char_end": 85,
"char_start": 82,
"chars": " co"
},
{
"char_end": 90,
"char_start": 87,
"chars": "t ="
},
{
... | 2 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"static int nntp_hcache_namer(const char *path, char *dest, size_t destlen)\n{",
" int count = snprintf(dest, destlen, \"%s.hcache\", path);",
" /* Strip out any directories in the path */\n char *first = strchr(dest, '/');\n char *last = strrchr(dest, '/');\n if (first && last && (last > first))\n {\n ... | [
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 81,
"char_start": 79,
"chars": "in"
},
{
"char_end": 85,
"char_start": 82,
"chars": " co"
},
{
"char_end": 90,
"char_start": 87,
"chars": "t ="
},
{
... | 2 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"std::string TarFileReader::extract(const string &_path) {\n if (_path.empty()) THROW(\"path cannot be empty\");\n if (!hasMore()) THROW(\"No more tar files\");",
" string path = _path;",
" if (SystemUtilities::isDirectory(path)) path += \"/\" + getFilename();",
"\n LOG_DEBUG(5, \"Extracting: \" << path)... | [
1,
1,
0,
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 228,
"char_start": 222,
"chars": "{\n "
},
{
"char_end": 544,
"char_start": 260,
"chars": " // Check that path is under the target directory\n string a = SystemUtilities::getCanonicalPath(_path);\... | 3 | cwe-022 | cpp |
Determine whether the {function_name} code is vulnerable or not. | [
"std::string TarFileReader::extract(const string &_path) {\n if (_path.empty()) THROW(\"path cannot be empty\");\n if (!hasMore()) THROW(\"No more tar files\");",
" string path = _path;",
" if (SystemUtilities::isDirectory(path)) {\n path += \"/\" + getFilename();",
" // Check that path is under the... | [
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 228,
"char_start": 222,
"chars": "{\n "
},
{
"char_end": 544,
"char_start": 260,
"chars": " // Check that path is under the target directory\n string a = SystemUtilities::getCanonicalPath(_path);\... | 3 | cwe-022 | cpp |
Determine whether the {function_name} code is vulnerable or not. | [
"static void handle_method_call(GDBusConnection *connection,\n const gchar *caller,\n const gchar *object_path,\n const gchar *interface_name,\n const gchar *method_name,\n GVariant *parameters,\n ... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | SVEN | {
"char_changes": {
"added": [
{
"char_end": 9241,
"char_start": 9086,
"chars": "allowed_problem_dir(problem_id))\n {\n return_InvalidProblemDir_error(invocation, problem_id);\n return;\n }\n\n if (!"
},
{
"char_end": 118... | 4 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"static void handle_method_call(GDBusConnection *connection,\n const gchar *caller,\n const gchar *object_path,\n const gchar *interface_name,\n const gchar *method_name,\n GVariant *parameters,\n ... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | SVEN | {
"char_changes": {
"added": [
{
"char_end": 9241,
"char_start": 9086,
"chars": "allowed_problem_dir(problem_id))\n {\n return_InvalidProblemDir_error(invocation, problem_id);\n return;\n }\n\n if (!"
},
{
"char_end": 118... | 4 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"def _inject_file_into_fs(fs, path, contents):\n absolute_path = os.path.join(fs, path.lstrip('/'))",
" parent_dir = os.path.dirname(absolute_path)\n utils.execute('mkdir', '-p', parent_dir, run_as_root=True)",
" utils.execute('tee', absolute_path, process_input=contents,\n run_as_root=True... | [
0,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 57,
"char_start": 43,
"chars": ", append=False"
},
{
"char_end": 82,
"char_start": 80,
"chars": "_j"
},
{
"char_end": 96,
"char_start": 83,
"chars": "in_and_check_"
... | 5 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _inject_file_into_fs(fs, path, contents, append=False):\n absolute_path = _join_and_check_path_within_fs(fs, path.lstrip('/'))\n",
" parent_dir = os.path.dirname(absolute_path)\n utils.execute('mkdir', '-p', parent_dir, run_as_root=True)",
"\n args = []\n if append:\n args.append('-a'... | [
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 57,
"char_start": 43,
"chars": ", append=False"
},
{
"char_end": 82,
"char_start": 80,
"chars": "_j"
},
{
"char_end": 96,
"char_start": 83,
"chars": "in_and_check_"
... | 5 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"set_interface_var(const char *iface,\n\t\t const char *var, const char *name,\n\t\t uint32_t val)\n{\n\tFILE *fp;\n\tchar spath[64+IFNAMSIZ];\t/* XXX: magic constant */\n\tif (snprintf(spath, sizeof(spath), var, iface) >= sizeof(spath))",
"",
"\t\treturn -1;",
"\tif (access(spath, F_OK) != 0)\n\t\treturn -... | [
1,
0,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 325,
"char_start": 240,
"chars": "/* No path traversal */\n\tif (strstr(name, \"..\") || strchr(name, '/'))\n\t\treturn -1;\n\n\t"
}
],
"deleted": []
},
"commit_link": "github.com/reubenhwk/radvd/commit/92e22ca23e52066da2... | 6 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"set_interface_var(const char *iface,\n\t\t const char *var, const char *name,\n\t\t uint32_t val)\n{\n\tFILE *fp;\n\tchar spath[64+IFNAMSIZ];\t/* XXX: magic constant */\n\tif (snprintf(spath, sizeof(spath), var, iface) >= sizeof(spath))",
"\t\treturn -1;",
"\t/* No path traversal */\n\tif (strstr(name, \"..\... | [
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 325,
"char_start": 240,
"chars": "/* No path traversal */\n\tif (strstr(name, \"..\") || strchr(name, '/'))\n\t\treturn -1;\n\n\t"
}
],
"deleted": []
},
"commit_link": "github.com/reubenhwk/radvd/commit/92e22ca23e52066da2... | 6 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"def cut(self, key):\n try:",
" self.etcd.delete(os.path.join(self.namespace, key))",
" except etcd.EtcdKeyNotFound:\n return False\n except etcd.EtcdException as err:\n log_error(\"Error removing key %s: [%r]\" % (key, repr(err)))\n raise CSStore... | [
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 72,
"char_start": 71,
"chars": "_"
},
{
"char_end": 79,
"char_start": 73,
"chars": "bsolut"
},
{
"char_end": 82,
"char_start": 80,
"chars": "_k"
},
{
... | 7 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def cut(self, key):\n try:",
" self.etcd.delete(self._absolute_key(key))",
" except etcd.EtcdKeyNotFound:\n return False\n except etcd.EtcdException as err:\n log_error(\"Error removing key %s: [%r]\" % (key, repr(err)))\n raise CSStoreError('Err... | [
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 72,
"char_start": 71,
"chars": "_"
},
{
"char_end": 79,
"char_start": 73,
"chars": "bsolut"
},
{
"char_end": 82,
"char_start": 80,
"chars": "_k"
},
{
... | 7 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"wiki_handle_http_request(HttpRequest *req)\n{\n HttpResponse *res = http_response_new(req);\n char *page = http_request_get_path_info(req); \n char *command = http_request_get_query_string(req); \n char *wikitext = \"\";",
" util_dehttpize(page); \t/* remove any encoding on... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1368,
"char_start": 1356,
"chars": "!page_name_i"
},
{
"char_end": 1374,
"char_start": 1369,
"chars": "_good"
}
],
"deleted": [
{
"char_end": 1362,
"char_start": 1357,... | 8 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"wiki_handle_http_request(HttpRequest *req)\n{\n HttpResponse *res = http_response_new(req);\n char *page = http_request_get_path_info(req); \n char *command = http_request_get_query_string(req); \n char *wikitext = \"\";",
" util_dehttpize(page); \t/* remove any encoding on... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1368,
"char_start": 1356,
"chars": "!page_name_i"
},
{
"char_end": 1374,
"char_start": 1369,
"chars": "_good"
}
],
"deleted": [
{
"char_end": 1362,
"char_start": 1357,... | 8 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"def candidate_paths_for_url(self, url):\n for root, prefix in self.directories:\n if url.startswith(prefix):",
" yield os.path.join(root, url[len(prefix):])"
] | [
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 151,
"char_start": 145,
"chars": "path ="
},
{
"char_end": 283,
"char_start": 189,
"chars": "\n if os.path.commonprefix((root, path)) == root:\n yield path"
}
... | 9 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def candidate_paths_for_url(self, url):\n for root, prefix in self.directories:\n if url.startswith(prefix):",
" path = os.path.join(root, url[len(prefix):])\n if os.path.commonprefix((root, path)) == root:\n yield path"
] | [
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 151,
"char_start": 145,
"chars": "path ="
},
{
"char_end": 283,
"char_start": 189,
"chars": "\n if os.path.commonprefix((root, path)) == root:\n yield path"
}
... | 9 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def updateKey(client):\n\t\"\"\"Updates the contents of a key that already exists in our system.\n\tReturns an error if the specified key doesn't exist for the specified user.\n\t\"\"\"\n\tglobal NOT_FOUND\n\tglobal CREATED",
"\tvalidateClient(client)",
"",
"\tclient_pub_key = loadClientRSAKey(client)\n\ttok... | [
1,
1,
0,
1,
0,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 406,
"char_start": 369,
"chars": ")\n\tvalidateKeyName(token_data['name']"
}
],
"deleted": [
{
"char_end": 234,
"char_start": 233,
"chars": "\n"
}
]
},
"commit_link": "github.com/Mi... | 10 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def updateKey(client):\n\t\"\"\"Updates the contents of a key that already exists in our system.\n\tReturns an error if the specified key doesn't exist for the specified user.\n\t\"\"\"\n\tglobal NOT_FOUND\n\tglobal CREATED",
"\tvalidateClient(client)",
"",
"\tclient_pub_key = loadClientRSAKey(client)\n\ttok... | [
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 406,
"char_start": 369,
"chars": ")\n\tvalidateKeyName(token_data['name']"
}
],
"deleted": [
{
"char_end": 234,
"char_start": 233,
"chars": "\n"
}
]
},
"commit_link": "github.com/Mi... | 10 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def create_basename_core(basename):\n try:\n basename = basename.casefold()\n except Exception:\n basename = basename.lower()\n",
" basename = basename.replace(' ', '-')",
" basename = re.sub(r'<[^>]*>', r'', basename)\n basename = re.sub(r'[^a-z0-9\\-]', r'', basename)\n basena... | [
1,
0,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 159,
"char_start": 158,
"chars": "r"
},
{
"char_end": 164,
"char_start": 161,
"chars": "sub"
},
{
"char_end": 166,
"char_start": 165,
"chars": "r"
},
{
... | 11 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def create_basename_core(basename):\n try:\n basename = basename.casefold()\n except Exception:\n basename = basename.lower()\n",
" basename = re.sub(r'[ \\./]', r'-', basename)",
" basename = re.sub(r'<[^>]*>', r'', basename)\n basename = re.sub(r'[^a-z0-9\\-]', r'', basename)\n ... | [
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 159,
"char_start": 158,
"chars": "r"
},
{
"char_end": 164,
"char_start": 161,
"chars": "sub"
},
{
"char_end": 166,
"char_start": 165,
"chars": "r"
},
{
... | 11 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def get(self, key):\n try:",
" result = self.etcd.get(os.path.join(self.namespace, key))",
" except etcd.EtcdException as err:\n log_error(\"Error fetching key %s: [%r]\" % (key, repr(err)))\n raise CSStoreError('Error occurred while trying to get key')\n r... | [
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 78,
"char_start": 77,
"chars": "_"
},
{
"char_end": 85,
"char_start": 79,
"chars": "bsolut"
},
{
"char_end": 88,
"char_start": 86,
"chars": "_k"
},
{
... | 12 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def get(self, key):\n try:",
" result = self.etcd.get(self._absolute_key(key))",
" except etcd.EtcdException as err:\n log_error(\"Error fetching key %s: [%r]\" % (key, repr(err)))\n raise CSStoreError('Error occurred while trying to get key')\n return resu... | [
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 78,
"char_start": 77,
"chars": "_"
},
{
"char_end": 85,
"char_start": 79,
"chars": "bsolut"
},
{
"char_end": 88,
"char_start": 86,
"chars": "_k"
},
{
... | 12 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"PHYSICALPATH_FUNC(mod_alias_physical_handler) {\n\tplugin_data *p = p_d;\n\tint uri_len, basedir_len;\n\tchar *uri_ptr;\n\tsize_t k;",
"\tif (buffer_is_empty(con->physical.path)) return HANDLER_GO_ON;",
"\tmod_alias_patch_connection(srv, con, p);",
"\t/* not to include the tailing slash */\n\tbasedir_len = b... | [
1,
1,
1,
1,
1,
1,
1,
0,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1449,
"char_start": 931,
"chars": "/* check for path traversal in url-path following alias if key\n\t\t\t * does not end in slash, but replacement value ends in slash */\n\t\t\tif (uri_ptr[alias_len] == '.') {\n\t\t\t\tchar *s = uri_ptr + ... | 13 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"PHYSICALPATH_FUNC(mod_alias_physical_handler) {\n\tplugin_data *p = p_d;\n\tint uri_len, basedir_len;\n\tchar *uri_ptr;\n\tsize_t k;",
"\tif (buffer_is_empty(con->physical.path)) return HANDLER_GO_ON;",
"\tmod_alias_patch_connection(srv, con, p);",
"\t/* not to include the tailing slash */\n\tbasedir_len = b... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1449,
"char_start": 931,
"chars": "/* check for path traversal in url-path following alias if key\n\t\t\t * does not end in slash, but replacement value ends in slash */\n\t\t\tif (uri_ptr[alias_len] == '.') {\n\t\t\t\tchar *s = uri_ptr + ... | 13 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"def download_check_files(self, filelist):\n # only admins and allowed users may download\n if not cherrypy.session['admin']:\n uo = self.useroptions.forUser(self.getUserId())\n if not uo.getOptionValue('media.may_download'):\n return 'not_permitted'\n # mak... | [
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 455,
"char_start": 395,
"chars": "# don't allow to traverse up in the file system\n "
},
{
"char_end": 625,
"char_start": 469,
"chars": " or f.startswith('../'):\n return 'inval... | 14 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def download_check_files(self, filelist):\n # only admins and allowed users may download\n if not cherrypy.session['admin']:\n uo = self.useroptions.forUser(self.getUserId())\n if not uo.getOptionValue('media.may_download'):\n return 'not_permitted'\n # mak... | [
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 455,
"char_start": 395,
"chars": "# don't allow to traverse up in the file system\n "
},
{
"char_end": 625,
"char_start": 469,
"chars": " or f.startswith('../'):\n return 'inval... | 14 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def get_files(self, submit_id, password=None, astree=False):\n \"\"\"\n Returns files from a submitted analysis.\n @param password: The password to unlock container archives with\n @param astree: sflock option; determines the format in which the files are returned\n @return: A tr... | [
1,
1,
0,
1,
0,
1,
1,
0,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 638,
"char_start": 637,
"chars": "m"
},
{
"char_end": 718,
"char_start": 717,
"chars": "p"
},
{
"char_end": 721,
"char_start": 720,
"chars": "h"
},
{
... | 15 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def get_files(self, submit_id, password=None, astree=False):\n \"\"\"\n Returns files from a submitted analysis.\n @param password: The password to unlock container archives with\n @param astree: sflock option; determines the format in which the files are returned\n @return: A tr... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 638,
"char_start": 637,
"chars": "m"
},
{
"char_end": 718,
"char_start": 717,
"chars": "p"
},
{
"char_end": 721,
"char_start": 720,
"chars": "h"
},
{
... | 15 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def handle(self, keepalive=True, initial_timeout=None):\n # we are requested to skip processing and keep the previous values\n if self.skip:\n return self.response.handle()",
" # default to no keepalive in case something happens while even trying ensure we have a request\n ... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1890,
"char_start": 1827,
"chars": ")\n self.resource = urllib.parse.unquote(resource"
}
],
"deleted": [
{
"char_end": 1778,
"char_start": 1773,
"chars": "self."
}
]
},... | 16 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def handle(self, keepalive=True, initial_timeout=None):\n # we are requested to skip processing and keep the previous values\n if self.skip:\n return self.response.handle()",
" # default to no keepalive in case something happens while even trying ensure we have a request\n ... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1890,
"char_start": 1827,
"chars": ")\n self.resource = urllib.parse.unquote(resource"
}
],
"deleted": [
{
"char_end": 1778,
"char_start": 1773,
"chars": "self."
}
]
},... | 16 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"int dd_delete_item(struct dump_dir *dd, const char *name)\n{\n if (!dd->locked)\n error_msg_and_die(\"dump_dir is not opened\"); /* bug */",
"",
"\n char *path = concat_path_file(dd->dd_dirname, name);\n int res = unlink(path);",
" if (res < 0)\n {\n if (errno == ENOENT)\n ... | [
1,
0,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 276,
"char_start": 149,
"chars": "if (!str_is_correct_filename(name))\n error_msg_and_die(\"Cannot delete item. '%s' is not a valid file name\", name);\n\n "
}
],
"deleted": []
},
"commit_link": "github.com/abrt... | 17 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"int dd_delete_item(struct dump_dir *dd, const char *name)\n{\n if (!dd->locked)\n error_msg_and_die(\"dump_dir is not opened\"); /* bug */",
"\n if (!str_is_correct_filename(name))\n error_msg_and_die(\"Cannot delete item. '%s' is not a valid file name\", name);",
"\n char *path = concat... | [
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 276,
"char_start": 149,
"chars": "if (!str_is_correct_filename(name))\n error_msg_and_die(\"Cannot delete item. '%s' is not a valid file name\", name);\n\n "
}
],
"deleted": []
},
"commit_link": "github.com/abrt... | 17 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"def render(self, request):\n\t\taction = \"download\"\n\t\tif \"action\" in request.args:\n\t\t\taction = request.args[\"action\"][0]",
"\t\tif \"file\" in request.args:",
"\t\t\tfilename = request.args[\"file\"][0].decode('utf-8', 'ignore').encode('utf-8')\n\t\t\tfilename = re.sub(\"^/+\", \"/\", os.path.real... | [
1,
1,
0,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 183,
"char_start": 163,
"chars": "lenient_force_utf_8("
},
{
"char_end": 238,
"char_start": 222,
"chars": "sanitise_filenam"
},
{
"char_end": 240,
"char_start": 239,
"... | 18 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def render(self, request):\n\t\taction = \"download\"\n\t\tif \"action\" in request.args:\n\t\t\taction = request.args[\"action\"][0]",
"\t\tif \"file\" in request.args:",
"\t\t\tfilename = lenient_force_utf_8(request.args[\"file\"][0])\n\t\t\tfilename = sanitise_filename_slashes(os.path.realpath(filename))",
... | [
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 183,
"char_start": 163,
"chars": "lenient_force_utf_8("
},
{
"char_end": 238,
"char_start": 222,
"chars": "sanitise_filenam"
},
{
"char_end": 240,
"char_start": 239,
"... | 18 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _inject_net_into_fs(net, fs, execute=None):\n \"\"\"Inject /etc/network/interfaces into the filesystem rooted at fs.",
" net is the contents of /etc/network/interfaces.\n \"\"\"",
" netdir = os.path.join(os.path.join(fs, 'etc'), 'network')",
" utils.execute('mkdir', '-p', netdir, run_as_ro... | [
1,
1,
0,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 196,
"char_start": 194,
"chars": "_j"
},
{
"char_end": 210,
"char_start": 197,
"chars": "in_and_check_"
},
{
"char_end": 216,
"char_start": 214,
"chars": "_w"
},... | 19 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _inject_net_into_fs(net, fs, execute=None):\n \"\"\"Inject /etc/network/interfaces into the filesystem rooted at fs.",
" net is the contents of /etc/network/interfaces.\n \"\"\"",
" netdir = _join_and_check_path_within_fs(fs, 'etc', 'network')",
" utils.execute('mkdir', '-p', netdir, run_a... | [
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 196,
"char_start": 194,
"chars": "_j"
},
{
"char_end": 210,
"char_start": 197,
"chars": "in_and_check_"
},
{
"char_end": 216,
"char_start": 214,
"chars": "_w"
},... | 19 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def canonicalize(self):\n \"\"\"::",
" path = path.canonicalize()\n",
" Canonicalize path. ::",
"\n # \"/foo/baz\"\n Pyjo.Path.new('/foo/./bar/../baz').canonicalize()",
" # \"/../baz\"\n Pyjo.Path.new('/foo/../bar/../../baz').canonicalize... | [
1,
1,
0,
1,
1,
0,
1,
0,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 124,
"char_start": 108,
"chars": " by resolving ``"
},
{
"char_end": 171,
"char_start": 125,
"chars": "`` and ``..``, in addition ``...`` will be\n "
},
{
"char_end": 232,
"... | 20 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def canonicalize(self):\n \"\"\"::",
" path = path.canonicalize()\n",
" Canonicalize path by resolving ``.`` and ``..``, in addition ``...`` will be\n treated as ``.`` to protect from path traversal attacks.",
"\n # \"/foo/baz\"\n Pyjo.Path.new('/foo/./ba... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 124,
"char_start": 108,
"chars": " by resolving ``"
},
{
"char_end": 171,
"char_start": 125,
"chars": "`` and ``..``, in addition ``...`` will be\n "
},
{
"char_end": 232,
"... | 20 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"CString CWebSock::GetSkinPath(const CString& sSkinName) {",
" CString sRet = CZNC::Get().GetZNCPath() + \"/webskins/\" + sSkinName;",
"\n if (!CFile::IsDir(sRet)) {",
" sRet = CZNC::Get().GetCurPath() + \"/webskins/\" + sSkinName;",
"\n if (!CFile::IsDir(sRet)) {",
" sRet =... | [
1,
0,
1,
0,
1,
0,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 140,
"char_start": 62,
"chars": "const CString sSkin = sSkinName.Replace_n(\"/\", \"_\").Replace_n(\".\", \"_\");\n\n "
}
],
"deleted": [
{
"char_end": 128,
"char_start": 124,
"chars": "Name"
... | 21 | cwe-022 | cpp |
Determine whether the {function_name} code is vulnerable or not. | [
"CString CWebSock::GetSkinPath(const CString& sSkinName) {",
" const CString sSkin = sSkinName.Replace_n(\"/\", \"_\").Replace_n(\".\", \"_\");",
" CString sRet = CZNC::Get().GetZNCPath() + \"/webskins/\" + sSkin;",
"\n if (!CFile::IsDir(sRet)) {",
" sRet = CZNC::Get().GetCurPath() + \"/webs... | [
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 140,
"char_start": 62,
"chars": "const CString sSkin = sSkinName.Replace_n(\"/\", \"_\").Replace_n(\".\", \"_\");\n\n "
}
],
"deleted": [
{
"char_end": 128,
"char_start": 124,
"chars": "Name"
... | 21 | cwe-022 | cpp |
Determine whether the {function_name} code is vulnerable or not. | [
"def addKey(client):\n\t\"\"\"Adds a new key with the specified name and contents.\n\tReturns an error if a key with the specified name already exists.\n\t\"\"\"\n\tglobal BAD_REQUEST\n\tglobal CREATED",
"\tvalidateClient(client)",
"",
"\tclient_pub_key = loadClientRSAKey(client)\n\ttoken_data = decodeRequest... | [
1,
1,
0,
1,
0,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 383,
"char_start": 346,
"chars": ")\n\tvalidateKeyName(token_data['name']"
}
],
"deleted": [
{
"char_end": 211,
"char_start": 210,
"chars": "\n"
}
]
},
"commit_link": "github.com/Mi... | 22 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def addKey(client):\n\t\"\"\"Adds a new key with the specified name and contents.\n\tReturns an error if a key with the specified name already exists.\n\t\"\"\"\n\tglobal BAD_REQUEST\n\tglobal CREATED",
"\tvalidateClient(client)",
"",
"\tclient_pub_key = loadClientRSAKey(client)\n\ttoken_data = decodeRequest... | [
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 383,
"char_start": 346,
"chars": ")\n\tvalidateKeyName(token_data['name']"
}
],
"deleted": [
{
"char_end": 211,
"char_start": 210,
"chars": "\n"
}
]
},
"commit_link": "github.com/Mi... | 22 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"void dd_save_text(struct dump_dir *dd, const char *name, const char *data)\n{\n if (!dd->locked)\n error_msg_and_die(\"dump_dir is not opened\"); /* bug */\n",
"",
" char *full_path = concat_path_file(dd->dd_dirname, name);\n save_binary_file(full_path, data, strlen(data), dd->dd_uid, dd->dd_gi... | [
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 291,
"char_start": 166,
"chars": "if (!str_is_correct_filename(name))\n error_msg_and_die(\"Cannot save text. '%s' is not a valid file name\", name);\n\n "
}
],
"deleted": []
},
"commit_link": "github.com/abrt/l... | 23 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"void dd_save_text(struct dump_dir *dd, const char *name, const char *data)\n{\n if (!dd->locked)\n error_msg_and_die(\"dump_dir is not opened\"); /* bug */\n",
" if (!str_is_correct_filename(name))\n error_msg_and_die(\"Cannot save text. '%s' is not a valid file name\", name);\n",
" char... | [
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 291,
"char_start": 166,
"chars": "if (!str_is_correct_filename(name))\n error_msg_and_die(\"Cannot save text. '%s' is not a valid file name\", name);\n\n "
}
],
"deleted": []
},
"commit_link": "github.com/abrt/l... | 23 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"def misc_file_checks(self):",
" print_header(\"MISC FILE CHECKS\")",
" #\n # Check for recommended and mandatory files\n #",
" filenames = (\"manifest.json\", \"LICENSE\", \"README.md\",\n \"scripts/install\", \"scripts/remove\",\n \"... | [
1,
1,
1,
1,
1,
1,
1,
1,
0,
1,
1,
0,
1,
0,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1184,
"char_start": 1153,
"chars": "Analyze nginx conf\n # - "
},
{
"char_end": 1292,
"char_start": 1240,
"chars": " - Spot path traversal issue vulnerability\n #"
},
{
... | 24 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def misc_file_checks(self):",
" print_header(\"MISC FILE CHECKS\")",
" #\n # Check for recommended and mandatory files\n #",
" filenames = (\"manifest.json\", \"LICENSE\", \"README.md\",\n \"scripts/install\", \"scripts/remove\",\n \"... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1184,
"char_start": 1153,
"chars": "Analyze nginx conf\n # - "
},
{
"char_end": 1292,
"char_start": 1240,
"chars": " - Spot path traversal issue vulnerability\n #"
},
{
... | 24 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"void dd_save_binary(struct dump_dir* dd, const char* name, const char* data, unsigned size)\n{\n if (!dd->locked)\n error_msg_and_die(\"dump_dir is not opened\"); /* bug */\n",
"",
" char *full_path = concat_path_file(dd->dd_dirname, name);\n save_binary_file(full_path, data, size, dd->dd_uid, ... | [
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 310,
"char_start": 183,
"chars": "if (!str_is_correct_filename(name))\n error_msg_and_die(\"Cannot save binary. '%s' is not a valid file name\", name);\n\n "
}
],
"deleted": []
},
"commit_link": "github.com/abrt... | 25 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"void dd_save_binary(struct dump_dir* dd, const char* name, const char* data, unsigned size)\n{\n if (!dd->locked)\n error_msg_and_die(\"dump_dir is not opened\"); /* bug */\n",
" if (!str_is_correct_filename(name))\n error_msg_and_die(\"Cannot save binary. '%s' is not a valid file name\", nam... | [
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 310,
"char_start": 183,
"chars": "if (!str_is_correct_filename(name))\n error_msg_and_die(\"Cannot save binary. '%s' is not a valid file name\", name);\n\n "
}
],
"deleted": []
},
"commit_link": "github.com/abrt... | 25 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"def pascal_case(value: str) -> str:",
" return stringcase.pascalcase(value)"
] | [
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 79,
"char_start": 69,
"chars": "_sanitize("
},
{
"char_end": 86,
"char_start": 85,
"chars": ")"
}
],
"deleted": []
},
"commit_link": "github.com/openapi-generators/openapi-python-client... | 26 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def pascal_case(value: str) -> str:",
" return stringcase.pascalcase(_sanitize(value))"
] | [
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 79,
"char_start": 69,
"chars": "_sanitize("
},
{
"char_end": 86,
"char_start": 85,
"chars": ")"
}
],
"deleted": []
},
"commit_link": "github.com/openapi-generators/openapi-python-client... | 26 | cwe-022 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"cleanup_pathname(struct archive_write_disk *a)\n{\n\tchar *dest, *src;\n\tchar separator = '\\0';",
"\tdest = src = a->name;\n\tif (*src == '\\0') {\n\t\tarchive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,\n\t\t \"Invalid empty pathname\");\n\t\treturn (ARCHIVE_FAILED);\n\t}",
"#if defined(__CYGWIN__)\n\tcle... | [
1,
1,
1,
0,
1,
0,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 543,
"char_start": 353,
"chars": " {\n\t\tif (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {\n\t\t\tarchive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,\n\t\t\t \"Path is absolute\");\n\t\t\treturn (ARCHIVE_FAILED);\n\... | 27 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"cleanup_pathname(struct archive_write_disk *a)\n{\n\tchar *dest, *src;\n\tchar separator = '\\0';",
"\tdest = src = a->name;\n\tif (*src == '\\0') {\n\t\tarchive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,\n\t\t \"Invalid empty pathname\");\n\t\treturn (ARCHIVE_FAILED);\n\t}",
"#if defined(__CYGWIN__)\n\tcle... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 543,
"char_start": 353,
"chars": " {\n\t\tif (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {\n\t\t\tarchive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,\n\t\t\t \"Path is absolute\");\n\t\t\treturn (ARCHIVE_FAILED);\n\... | 27 | cwe-022 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"struct dump_dir *create_dump_dir_from_problem_data(problem_data_t *problem_data, const char *base_dir_name)\n{\n INITIALIZE_LIBREPORT();",
" char *type = problem_data_get_content_or_NULL(problem_data, FILENAME_ANALYZER);",
" if (!type)\n {\n error_msg(_(\"Missing required item: '%s'\"), FILE... | [
1,
1,
1,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
1,
0,
0,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 497,
"char_start": 349,
"chars": "if (!str_is_correct_filename(type))\n {\n error_msg(_(\"'%s' is not correct file name\"), FILENAME_ANALYZER);\n return NULL;\n }\n\n "
},
{
"char_end": 2558,
... | 28 | cwe-022 | c |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 11