cwe
stringclasses
9 values
func_name
stringlengths
2
53
func_src_before
stringlengths
73
114k
func_src_after
stringlengths
86
114k
line_changes
stringlengths
106
3.56k
char_changes
stringlengths
28
6.45k
commit_link
stringlengths
66
117
file_name
stringlengths
5
72
vul_type
stringclasses
9 values
num_tokens
int64
16
28.1k
cwe-190
perf_cpu_time_max_percent_handler
int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { int ret = proc_dointvec(table, write, buffer, lenp, ppos); if (ret || !write) return ret; if (sysctl_perf_cpu_time_max_percent == 100 || sysctl_perf_cpu_time_max_percent == 0)...
int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { int ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); if (ret || !write) return ret; if (sysctl_perf_cpu_time_max_percent == 100 || sysctl_perf_cpu_time_max_percen...
{'deleted': [{'line_no': 5, 'char_start': 133, 'char_end': 193, 'line': '\tint ret = proc_dointvec(table, write, buffer, lenp, ppos);\n'}], 'added': [{'line_no': 5, 'char_start': 133, 'char_end': 200, 'line': '\tint ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);\n'}]}
{'deleted': [], 'added': [{'char_start': 157, 'char_end': 164, 'chars': '_minmax'}]}
github.com/torvalds/linux/commit/1572e45a924f254d9570093abde46430c3172e3d
kernel/events/core.c
cwe-190
148
cwe-089
get_max_task_id_for_project
@staticmethod def get_max_task_id_for_project(project_id: int): """Gets the nights task id currently in use on a project""" sql = """select max(id) from tasks where project_id = {0} GROUP BY project_id""".format(project_id) result = db.engine.execute(sql) if result.rowcount == 0:...
@staticmethod def get_max_task_id_for_project(project_id: int): """Gets the nights task id currently in use on a project""" sql = """select max(id) from tasks where project_id = :project_id GROUP BY project_id""" result = db.engine.execute(text(sql), project_id=project_id) if res...
{'deleted': [{'line_no': 4, 'char_start': 140, 'char_end': 248, 'line': ' sql = """select max(id) from tasks where project_id = {0} GROUP BY project_id""".format(project_id)\n'}, {'line_no': 5, 'char_start': 248, 'char_end': 288, 'line': ' result = db.engine.execute(sql)\n'}], 'added': [{'line_no': 4, 'ch...
{'deleted': [{'char_start': 202, 'char_end': 205, 'chars': '{0}'}, {'char_start': 228, 'char_end': 247, 'chars': '.format(project_id)'}], 'added': [{'char_start': 202, 'char_end': 213, 'chars': ':project_id'}, {'char_start': 272, 'char_end': 277, 'chars': 'text('}, {'char_start': 280, 'char_end': 304, 'chars': '), proj...
github.com/hotosm/tasking-manager/commit/dee040a2d22b3c4d5e38e2dbf8c6b651ad4c241a
server/models/postgis/task.py
cwe-089
90
cwe-787
NeXTDecode
NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) { static const char module[] = "NeXTDecode"; unsigned char *bp, *op; tmsize_t cc; uint8* row; tmsize_t scanline, n; (void) s; /* * Each scanline is assumed to start off as all * white (we assume a PhotometricInterpretation * of ``min-is-black''). ...
NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) { static const char module[] = "NeXTDecode"; unsigned char *bp, *op; tmsize_t cc; uint8* row; tmsize_t scanline, n; (void) s; /* * Each scanline is assumed to start off as all * white (we assume a PhotometricInterpretation * of ``min-is-black''). ...
{'deleted': [{'line_no': 77, 'char_start': 1882, 'char_end': 1926, 'line': '\t\t\t\twhile (n-- > 0 && npixels < imagewidth)\n'}], 'added': [{'line_no': 61, 'char_start': 1450, 'char_end': 1486, 'line': ' tmsize_t op_offset = 0;\n'}, {'line_no': 78, 'char_start': 1918, 'char_end': 1986, 'line': '\t\t\t\twhile...
{'deleted': [], 'added': [{'char_start': 1450, 'char_end': 1486, 'chars': ' tmsize_t op_offset = 0;\n'}, {'char_start': 1960, 'char_end': 1984, 'chars': ' && op_offset < scanline'}, {'char_start': 2053, 'char_end': 2290, 'chars': '\n if (op_offset >= scanline ) {\n TIFFError...
github.com/vadz/libtiff/commit/b18012dae552f85dcc5c57d3bf4e997a15b1cc1c
libtiff/tif_next.c
cwe-787
780
cwe-078
initHeader
def initHeader(self): """Initialize the IP header according to the IP format definition. """ # Ethernet header # Retrieve remote MAC address dstMacAddr = arpreq.arpreq(self.remoteIP) if dstMacAddr is not None: dstMacAddr = dstMacAddr.replace(':', '') ...
def initHeader(self): """Initialize the IP header according to the IP format definition. """ # Ethernet header # Retrieve remote MAC address dstMacAddr = arpreq.arpreq(self.remoteIP) if dstMacAddr is not None: dstMacAddr = dstMacAddr.replace(':', '') ...
{'deleted': [{'line_no': 15, 'char_start': 423, 'char_end': 505, 'line': ' p = subprocess.Popen("ping -c1 {}".format(self.remoteIP), shell=True)\n'}], 'added': [{'line_no': 15, 'char_start': 423, 'char_end': 493, 'line': ' p = subprocess.Popen(["/bin/ping", "-c1", self.remoteIP])\n'}]}
{'deleted': [{'char_start': 465, 'char_end': 468, 'chars': ' {}'}, {'char_start': 469, 'char_end': 477, 'chars': '.format('}, {'char_start': 490, 'char_end': 503, 'chars': '), shell=True'}], 'added': [{'char_start': 456, 'char_end': 457, 'chars': '['}, {'char_start': 458, 'char_end': 463, 'chars': '/bin/'}, {'char_star...
github.com/netzob/netzob/commit/557abf64867d715497979b029efedbd2777b912e
src/netzob/Simulator/Channels/RawEthernetClient.py
cwe-078
1,073
cwe-078
_formatCredentials
def _formatCredentials(self, data, name): """ Credentials are of the form RCLONE_CONFIG_CURRENT_TYPE=s3 ^ ^ ^ ^ [mandatory ][name ][key][value] """ prefix = "RCLONE_CONFIG_{}".format(name.upper()) credentials = '' cred...
def _formatCredentials(self, data, name): """ Credentials are of the form RCLONE_CONFIG_CURRENT_TYPE=s3 ^ ^ ^ ^ [mandatory ][name ][key][value] """ prefix = "RCLONE_CONFIG_{}".format(name.upper()) credentials = {} cred...
{'deleted': [{'line_no': 11, 'char_start': 283, 'char_end': 308, 'line': " credentials = ''\n"}, {'line_no': 12, 'char_start': 308, 'char_end': 373, 'line': ' credentials += "{}_TYPE=\'{}\' ".format(prefix, data.type)\n'}, {'line_no': 17, 'char_start': 518, 'char_end': 583, 'line': ' creden...
{'deleted': [{'char_start': 305, 'char_end': 307, 'chars': "''"}, {'char_start': 327, 'char_end': 332, 'chars': ' += "'}, {'char_start': 339, 'char_end': 340, 'chars': '='}, {'char_start': 341, 'char_end': 346, 'chars': '{}\' "'}, {'char_start': 360, 'char_end': 361, 'chars': ','}, {'char_start': 371, 'char_end': 372, ...
github.com/FredHutch/motuz/commit/045468cb9bff47bb3bb72268b6d5a3fe44e383db
src/backend/api/utils/rclone_connection.py
cwe-078
599
cwe-125
enc_untrusted_inet_pton
int enc_untrusted_inet_pton(int af, const char *src, void *dst) { if (!src || !dst) { return 0; } MessageWriter input; input.Push<int>(TokLinuxAfFamily(af)); input.PushByReference(Extent{ src, std::min(strlen(src) + 1, static_cast<size_t>(INET6_ADDRSTRLEN))}); MessageReader output; const auto ...
int enc_untrusted_inet_pton(int af, const char *src, void *dst) { if (!src || !dst) { return 0; } MessageWriter input; input.Push<int>(TokLinuxAfFamily(af)); input.PushByReference(Extent{ src, std::min(strlen(src) + 1, static_cast<size_t>(INET6_ADDRSTRLEN))}); MessageReader output; const auto ...
{'deleted': [], 'added': [{'line_no': 26, 'char_start': 747, 'char_end': 810, 'line': ' if (klinux_addr_buffer.size() != sizeof(klinux_in_addr)) {\n'}, {'line_no': 27, 'char_start': 810, 'char_end': 873, 'line': ' ::asylo::primitives::TrustedPrimitives::BestEffortAbort(\n'}, {'line_no': 28, 'char_start': 873, '...
{'deleted': [], 'added': [{'char_start': 751, 'char_end': 945, 'chars': 'if (klinux_addr_buffer.size() != sizeof(klinux_in_addr)) {\n ::asylo::primitives::TrustedPrimitives::BestEffortAbort(\n "enc_untrusted_inet_pton: unexpected output size");\n }\n '}, {'char_start': 1010, 'char_end': 1205, 'chars...
github.com/google/asylo/commit/8fed5e334131abaf9c5e17307642fbf6ce4a57ec
asylo/platform/host_call/trusted/host_calls.cc
cwe-125
280
cwe-089
add_translationname
def add_translationname(self, trname): """Add new translation by item name for an item.""" if self.connection: for item in self.find_item_name([trname[0], '0']): self.cursor.execute('insert into itemtranslation (itemid, itemlanguageid, translation) values ("%s", "%s", "%s...
def add_translationname(self, trname): """Add new translation by item name for an item.""" if self.connection: for item in self.find_item_name([trname[0], '0']): t = (item[0], trname[1], trname[2], ) self.cursor.execute('insert into itemtranslation (itemid...
{'deleted': [{'line_no': 5, 'char_start': 194, 'char_end': 359, 'line': ' self.cursor.execute(\'insert into itemtranslation (itemid, itemlanguageid, translation) values ("%s", "%s", "%s")\' % (item[0], trname[1], trname[2]))\n'}], 'added': [{'line_no': 5, 'char_start': 194, 'char_end': 248, 'line': ' ...
{'deleted': [{'char_start': 305, 'char_end': 309, 'chars': '"%s"'}, {'char_start': 311, 'char_end': 315, 'chars': '"%s"'}, {'char_start': 317, 'char_end': 321, 'chars': '"%s"'}, {'char_start': 323, 'char_end': 334, 'chars': ' % (item[0]'}, {'char_start': 337, 'char_end': 357, 'chars': 'rname[1], trname[2])'}], 'added':...
github.com/ecosl-developers/ecosl/commit/8af050a513338bf68ff2a243e4a2482d24e9aa3a
ecosldb/ecosldb.py
cwe-089
94
cwe-022
_inject_net_into_fs
def _inject_net_into_fs(net, fs, execute=None): """Inject /etc/network/interfaces into the filesystem rooted at fs. net is the contents of /etc/network/interfaces. """ netdir = os.path.join(os.path.join(fs, 'etc'), 'network') utils.execute('mkdir', '-p', netdir, run_as_root=True) utils.execute(...
def _inject_net_into_fs(net, fs, execute=None): """Inject /etc/network/interfaces into the filesystem rooted at fs. net is the contents of /etc/network/interfaces. """ netdir = _join_and_check_path_within_fs(fs, 'etc', 'network') utils.execute('mkdir', '-p', netdir, run_as_root=True) utils.exec...
{'deleted': [{'line_no': 6, 'char_start': 181, 'char_end': 243, 'line': " netdir = os.path.join(os.path.join(fs, 'etc'), 'network')\n"}, {'line_no': 10, 'char_start': 426, 'char_end': 475, 'line': " netfile = os.path.join(netdir, 'interfaces')\n"}, {'line_no': 11, 'char_start': 475, 'char_end': 545, 'line': " ...
{'deleted': [{'char_start': 194, 'char_end': 202, 'chars': 'os.path.'}, {'char_start': 206, 'char_end': 210, 'chars': '(os.'}, {'char_start': 214, 'char_end': 217, 'chars': '.jo'}, {'char_start': 229, 'char_end': 230, 'chars': ')'}, {'char_start': 456, 'char_end': 458, 'chars': 'di'}, {'char_start': 479, 'char_end': 48...
github.com/openstack/nova/commit/2427d4a99bed35baefd8f17ba422cb7aae8dcca7
nova/virt/disk/api.py
cwe-022
146
cwe-079
link_dialog
def link_dialog(request): # list of wiki pages name = request.values.get("pagename", "") if name: from MoinMoin import search # XXX error handling! searchresult = search.searchPages(request, 't:"%s"' % name) pages = [p.page_name for p in searchresult.hits] pages.sort...
def link_dialog(request): # list of wiki pages name = request.values.get("pagename", "") name_escaped = wikiutil.escape(name) if name: from MoinMoin import search # XXX error handling! searchresult = search.searchPages(request, 't:"%s"' % name) pages = [p.page_name for p...
{'deleted': [{'line_no': 100, 'char_start': 3711, 'char_end': 3789, 'line': ' <input id="txtPagename" name="pagename" size="30" value="%(name)s">\n'}], 'added': [{'line_no': 4, 'char_start': 97, 'char_end': 138, 'line': ' name_escaped = wikiutil.escape(name)\n'}, {'line_no': 101, 'char_start': 3752, 'char_e...
{'deleted': [], 'added': [{'char_start': 101, 'char_end': 142, 'chars': 'name_escaped = wikiutil.escape(name)\n '}, {'char_start': 3825, 'char_end': 3833, 'chars': '_escaped'}]}
github.com/moinwiki/moin-1.9/commit/70955a8eae091cc88fd9a6e510177e70289ec024
MoinMoin/action/fckdialog.py
cwe-079
1,565
cwe-416
tcpmss_mangle_packet
tcpmss_mangle_packet(struct sk_buff *skb, const struct xt_action_param *par, unsigned int family, unsigned int tcphoff, unsigned int minlen) { const struct xt_tcpmss_info *info = par->targinfo; struct tcphdr *tcph; int len, tcp_hdrlen; unsigned int i; __be16 oldval; u16 newmss; u8 *op...
tcpmss_mangle_packet(struct sk_buff *skb, const struct xt_action_param *par, unsigned int family, unsigned int tcphoff, unsigned int minlen) { const struct xt_tcpmss_info *info = par->targinfo; struct tcphdr *tcph; int len, tcp_hdrlen; unsigned int i; __be16 oldval; u16 newmss; u8 *op...
{'deleted': [{'line_no': 29, 'char_start': 642, 'char_end': 665, 'line': '\tif (len < tcp_hdrlen)\n'}], 'added': [{'line_no': 29, 'char_start': 642, 'char_end': 703, 'line': '\tif (len < tcp_hdrlen || tcp_hdrlen < sizeof(struct tcphdr))\n'}, {'line_no': 77, 'char_start': 1935, 'char_end': 1985, 'line': '\t/* tcph->doff...
{'deleted': [], 'added': [{'char_start': 663, 'char_end': 701, 'chars': ' || tcp_hdrlen < sizeof(struct tcphdr)'}, {'char_start': 1920, 'char_end': 2010, 'chars': ')\n\t\treturn 0;\n\n\t/* tcph->doff has 4 bits, do not wrap it to 0 */\n\tif (tcp_hdrlen >= 15 * 4'}]}
github.com/torvalds/linux/commit/2638fd0f92d4397884fd991d8f4925cb3f081901
net/netfilter/xt_TCPMSS.c
cwe-416
1,117
cwe-089
new_category
def new_category(category_name): try: conn = check_heroku_db() cur = conn.cursor() cur.execute('''INSERT INTO categories (cat_name) VALUES (%s)''', (category_name,)) conn.commit() conn.close() except psycopg2.DatabaseError as e: print('Error %s' % e) sys....
def new_category(category_name): try: conn = check_heroku_db() cur = conn.cursor() query = "INSERT INTO categories (cat_name) VALUES (%s);" data = (category_name,) cur.execute(query, data) conn.commit() conn.close() except psycopg2.DatabaseError as e: ...
{'deleted': [{'line_no': 5, 'char_start': 103, 'char_end': 194, 'line': " cur.execute('''INSERT INTO categories (cat_name) VALUES (%s)''', (category_name,))\n"}], 'added': [{'line_no': 5, 'char_start': 103, 'char_end': 104, 'line': '\n'}, {'line_no': 6, 'char_start': 104, 'char_end': 169, 'line': ' query ...
{'deleted': [{'char_start': 111, 'char_end': 112, 'chars': 'c'}, {'char_start': 114, 'char_end': 126, 'chars': ".execute('''"}, {'char_start': 171, 'char_end': 175, 'chars': "''',"}], 'added': [{'char_start': 103, 'char_end': 104, 'chars': '\n'}, {'char_start': 112, 'char_end': 113, 'chars': 'q'}, {'char_start': 115, '...
github.com/leeorb321/expenses/commit/f93c0fa4d30787ef16420bfefc52565b98bc7fcf
db.py
cwe-089
78
cwe-476
expand_downwards
int expand_downwards(struct vm_area_struct *vma, unsigned long address) { struct mm_struct *mm = vma->vm_mm; struct vm_area_struct *prev; int error; address &= PAGE_MASK; error = security_mmap_addr(address); if (error) return error; /* Enforce stack_guard_gap */ prev = vma->vm_prev; /* Check that bo...
int expand_downwards(struct vm_area_struct *vma, unsigned long address) { struct mm_struct *mm = vma->vm_mm; struct vm_area_struct *prev; int error = 0; address &= PAGE_MASK; if (address < mmap_min_addr) return -EPERM; /* Enforce stack_guard_gap */ prev = vma->vm_prev; /* Check that both stack segmen...
{'deleted': [{'line_no': 6, 'char_start': 147, 'char_end': 159, 'line': '\tint error;\n'}, {'line_no': 9, 'char_start': 183, 'char_end': 221, 'line': '\terror = security_mmap_addr(address);\n'}, {'line_no': 10, 'char_start': 221, 'char_end': 233, 'line': '\tif (error)\n'}, {'line_no': 11, 'char_start': 233, 'char_end':...
{'deleted': [{'char_start': 185, 'char_end': 189, 'chars': 'rror'}, {'char_start': 190, 'char_end': 191, 'chars': '='}, {'char_start': 192, 'char_end': 201, 'chars': 'security_'}, {'char_start': 210, 'char_end': 231, 'chars': '(address);\n\tif (error'}, {'char_start': 242, 'char_end': 247, 'chars': 'error'}], 'added': ...
github.com/torvalds/linux/commit/0a1d52994d440e21def1c2174932410b4f2a98a1
mm/mmap.c
cwe-476
619
cwe-022
get
def get(self, key): try: result = self.etcd.get(os.path.join(self.namespace, key)) except etcd.EtcdException as err: log_error("Error fetching key %s: [%r]" % (key, repr(err))) raise CSStoreError('Error occurred while trying to get key') return result.valu...
def get(self, key): try: result = self.etcd.get(self._absolute_key(key)) except etcd.EtcdException as err: log_error("Error fetching key %s: [%r]" % (key, repr(err))) raise CSStoreError('Error occurred while trying to get key') return result.value
{'deleted': [{'line_no': 3, 'char_start': 37, 'char_end': 107, 'line': ' result = self.etcd.get(os.path.join(self.namespace, key))\n'}], 'added': [{'line_no': 3, 'char_start': 37, 'char_end': 97, 'line': ' result = self.etcd.get(self._absolute_key(key))\n'}]}
{'deleted': [{'char_start': 72, 'char_end': 85, 'chars': 'os.path.join('}, {'char_start': 90, 'char_end': 91, 'chars': 'n'}, {'char_start': 92, 'char_end': 94, 'chars': 'me'}, {'char_start': 95, 'char_end': 98, 'chars': 'pac'}, {'char_start': 99, 'char_end': 101, 'chars': ', '}], 'added': [{'char_start': 77, 'char_end'...
github.com/latchset/custodia/commit/785fc87f38b4811bc4ce43a0a9b2267ee7d500b4
custodia/store/etcdstore.py
cwe-022
74
cwe-089
post
def post(self): """ Returns JWT upon login verification """ json_data = request.get_json() if not json_data['email']: return jsonify({"msg": "Missing email"}), 400 data = database_utilities.execute_query( f"""select * from admins where email = '{json_data['em...
def post(self): """ Returns JWT upon login verification """ json_data = request.get_json() if not json_data['email']: return jsonify({"msg": "Missing email"}), 400 data = database_utilities.execute_query( f"""select * from admins where email = %s""", (json_da...
{'deleted': [{'line_no': 8, 'char_start': 254, 'char_end': 332, 'line': ' f"""select * from admins where email = \'{json_data[\'email\']}\'""")\n'}], 'added': [{'line_no': 8, 'char_start': 254, 'char_end': 336, 'line': ' f"""select * from admins where email = %s""", (json_data[\'email\'], ))\n'}]}
{'deleted': [{'char_start': 305, 'char_end': 307, 'chars': "'{"}, {'char_start': 325, 'char_end': 330, 'chars': '}\'"""'}], 'added': [{'char_start': 305, 'char_end': 313, 'chars': '%s""", ('}, {'char_start': 331, 'char_end': 334, 'chars': ', )'}]}
github.com/sgosal2/tiger-boards-backend/commit/4670109dd613df2f2fe7e8403ebd149df2b55485
apis/login.py
cwe-089
150
cwe-089
get_roster
def get_roster(self, server_id): sql = """SELECT username, role FROM roles WHERE roles.server_id = {0}; """.format(server_id) self.cur.execute(sql) return self.cur.fetchall()
def get_roster(self, server_id): sql = """ SELECT username, role FROM roles WHERE roles.server_id = %s; """ self.cur.execute(sql, (server_id,)) return self.cur.fetchall()
{'deleted': [{'line_no': 2, 'char_start': 37, 'char_end': 76, 'line': ' sql = """SELECT username, role\n'}, {'line_no': 3, 'char_start': 76, 'char_end': 104, 'line': ' FROM roles\n'}, {'line_no': 4, 'char_start': 104, 'char_end': 150, 'line': ' WHERE roles.server_id = {0};\n'}, {'...
{'deleted': [{'char_start': 76, 'char_end': 77, 'chars': ' '}, {'char_start': 91, 'char_end': 93, 'chars': ' '}, {'char_start': 104, 'char_end': 107, 'chars': ' '}, {'char_start': 145, 'char_end': 148, 'chars': '{0}'}, {'char_start': 150, 'char_end': 153, 'chars': ' '}, {'char_start': 170, 'char_end': 188, 'chars'...
github.com/jgayfer/spirit/commit/01c846c534c8d3cf6763f8b7444a0efe2caa3799
db/dbase.py
cwe-089
50
cwe-022
dd_save_binary
void dd_save_binary(struct dump_dir* dd, const char* name, const char* data, unsigned size) { if (!dd->locked) error_msg_and_die("dump_dir is not opened"); /* bug */ char *full_path = concat_path_file(dd->dd_dirname, name); save_binary_file(full_path, data, size, dd->dd_uid, dd->dd_gid, dd->mode); ...
void dd_save_binary(struct dump_dir* dd, const char* name, const char* data, unsigned size) { if (!dd->locked) error_msg_and_die("dump_dir is not opened"); /* bug */ if (!str_is_correct_filename(name)) error_msg_and_die("Cannot save binary. '%s' is not a valid file name", name); char *full...
{'deleted': [], 'added': [{'line_no': 6, 'char_start': 179, 'char_end': 219, 'line': ' if (!str_is_correct_filename(name))\n'}, {'line_no': 7, 'char_start': 219, 'char_end': 305, 'line': ' error_msg_and_die("Cannot save binary. \'%s\' is not a valid file name", name);\n'}, {'line_no': 8, 'char_start': 305, 'c...
{'deleted': [], 'added': [{'char_start': 183, 'char_end': 310, '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 '}]}
github.com/abrt/libreport/commit/239c4f7d1f47265526b39ad70106767d00805277
src/lib/dump_dir.c
cwe-022
94
cwe-190
read_entry
static int read_entry( git_index_entry **out, size_t *out_size, git_index *index, const void *buffer, size_t buffer_size, const char *last) { size_t path_length, entry_size; const char *path_ptr; struct entry_short source; git_index_entry entry = {{0}}; bool compressed = index->version >= INDEX_VERSION_NUMBE...
static int read_entry( git_index_entry **out, size_t *out_size, git_index *index, const void *buffer, size_t buffer_size, const char *last) { size_t path_length, entry_size; const char *path_ptr; struct entry_short source; git_index_entry entry = {{0}}; bool compressed = index->version >= INDEX_VERSION_NUMBE...
{'deleted': [{'line_no': 67, 'char_start': 2004, 'char_end': 2025, 'line': '\t\tsize_t varint_len;\n'}, {'line_no': 68, 'char_start': 2025, 'char_end': 2097, 'line': '\t\tsize_t strip_len = git_decode_varint((const unsigned char *)path_ptr,\n'}, {'line_no': 69, 'char_start': 2097, 'char_end': 2122, 'line': '\t\t\t\t\t\...
{'deleted': [{'char_start': 2027, 'char_end': 2028, 'chars': 's'}, {'char_start': 2029, 'char_end': 2031, 'chars': 'ze'}, {'char_start': 2096, 'char_end': 2107, 'chars': '\n\t\t\t\t\t\t '}, {'char_start': 2124, 'char_end': 2131, 'chars': 'size_t '}, {'char_start': 2158, 'char_end': 2159, 'chars': 's'}, {'char_start'...
github.com/libgit2/libgit2/commit/3207ddb0103543da8ad2139ec6539f590f9900c1
src/index.c
cwe-190
794
cwe-079
subscribe_for_tags
@csrf.csrf_protect def subscribe_for_tags(request): """process subscription of users by tags""" #todo - use special separator to split tags tag_names = request.REQUEST.get('tags','').strip().split() pure_tag_names, wildcards = forms.clean_marked_tagnames(tag_names) if request.user.is_authenticated()...
@csrf.csrf_protect def subscribe_for_tags(request): """process subscription of users by tags""" #todo - use special separator to split tags tag_names = request.REQUEST.get('tags','').strip().split() pure_tag_names, wildcards = forms.clean_marked_tagnames(tag_names) if request.user.is_authenticated()...
{'deleted': [{'line_no': 22, 'char_start': 905, 'char_end': 984, 'line': " ) % {'url': request.path + '?tags=' + request.REQUEST['tags']}\n"}], 'added': [{'line_no': 22, 'char_start': 905, 'char_end': 992, 'line': " ) % {'url': escape(request.path) + '?tags=' + request.REQUEST['tags']}\n"}...
{'deleted': [], 'added': [{'char_start': 933, 'char_end': 940, 'chars': 'escape('}, {'char_start': 952, 'char_end': 953, 'chars': ')'}]}
github.com/ASKBOT/askbot-devel/commit/a676a86b6b7a5737d4da4f59f71e037406f88d29
askbot/views/commands.py
cwe-079
305
cwe-022
handle_method_call
static void handle_method_call(GDBusConnection *connection, const gchar *caller, const gchar *object_path, const gchar *interface_name, const gchar *method_name, GVariant *parameters, ...
static void handle_method_call(GDBusConnection *connection, const gchar *caller, const gchar *object_path, const gchar *interface_name, const gchar *method_name, GVariant *parameters, ...
{'deleted': [{'line_no': 259, 'char_start': 9073, 'char_end': 9148, 'line': " if (element == NULL || element[0] == '\\0' || strlen(element) > 64)\n"}], 'added': [{'line_no': 259, 'char_start': 9073, 'char_end': 9120, 'line': ' if (!str_is_correct_filename(element))\n'}, {'line_no': 318, 'char_start': 1155...
{'deleted': [{'char_start': 9085, 'char_end': 9126, 'chars': "element == NULL || element[0] == '\\0' || "}, {'char_start': 9141, 'char_end': 9146, 'chars': ' > 64'}], 'added': [{'char_start': 9085, 'char_end': 9097, 'chars': '!str_is_corr'}, {'char_start': 9098, 'char_end': 9103, 'chars': 'ct_fi'}, {'char_start': 9106,...
github.com/abrt/abrt/commit/f3c2a6af3455b2882e28570e8a04f1c2d4500d5b
src/dbus/abrt-dbus.c
cwe-022
3,390
cwe-416
updateDevice
updateDevice(const struct header * headers, time_t t) { struct device ** pp = &devlist; struct device * p = *pp; /* = devlist; */ while(p) { if( p->headers[HEADER_NT].l == headers[HEADER_NT].l && (0==memcmp(p->headers[HEADER_NT].p, headers[HEADER_NT].p, headers[HEADER_NT].l)) && p->headers[HEADER_USN].l ...
updateDevice(const struct header * headers, time_t t) { struct device ** pp = &devlist; struct device * p = *pp; /* = devlist; */ while(p) { if( p->headers[HEADER_NT].l == headers[HEADER_NT].l && (0==memcmp(p->headers[HEADER_NT].p, headers[HEADER_NT].p, headers[HEADER_NT].l)) && p->headers[HEADER_USN].l ...
{'deleted': [], 'added': [{'line_no': 24, 'char_start': 920, 'char_end': 971, 'line': '\t\t\t\t\t*pp = p->next;\t/* remove "p" from the list */\n'}]}
{'deleted': [], 'added': [{'char_start': 925, 'char_end': 976, 'chars': '*pp = p->next;\t/* remove "p" from the list */\n\t\t\t\t\t'}]}
github.com/miniupnp/miniupnp/commit/cd506a67e174a45c6a202eff182a712955ed6d6f
minissdpd/minissdpd.c
cwe-416
624
cwe-089
get_asset_and_volume
@app.route('/get_asset_and_volume') def get_asset_and_volume(): asset_id = request.args.get('asset_id') if not isObject(asset_id): ws.send('{"id":1, "method":"call", "params":[0,"lookup_asset_symbols",[["' + asset_id + '"], 0]]}') result_l = ws.recv() j_l = json.loads(result_l) ...
@app.route('/get_asset_and_volume') def get_asset_and_volume(): asset_id = request.args.get('asset_id') if not isObject(asset_id): ws.send('{"id":1, "method":"call", "params":[0,"lookup_asset_symbols",[["' + asset_id + '"], 0]]}') result_l = ws.recv() j_l = json.loads(result_l) ...
{'deleted': [{'line_no': 40, 'char_start': 1428, 'char_end': 1499, 'line': ' query = "SELECT volume, mcap FROM assets WHERE aid=\'"+asset_id+"\'"\n'}, {'line_no': 41, 'char_start': 1499, 'char_end': 1522, 'line': ' cur.execute(query)\n'}], 'added': [{'line_no': 40, 'char_start': 1428, 'char_end': 1487, 'line': ' ...
{'deleted': [{'char_start': 1483, 'char_end': 1487, 'chars': '\'"+a'}, {'char_start': 1488, 'char_end': 1497, 'chars': 'set_id+"\''}], 'added': [{'char_start': 1483, 'char_end': 1484, 'chars': '%'}, {'char_start': 1508, 'char_end': 1521, 'chars': ', (asset_id,)'}]}
github.com/VinChain/vinchain-python-api-backend/commit/b78088a551fbb712121269c6eb7f43ede120ff60
api.py
cwe-089
534
cwe-089
process_form
def process_form(): # see https://docs.python.org/3.4/library/cgi.html for the basic usage # here. form = cgi.FieldStorage() if "player1" not in form or "player2" not in form or "size" not in form: raise FormError("Invalid parameters.") player1 = form["player1"].value player2 = form["...
def process_form(): # see https://docs.python.org/3.4/library/cgi.html for the basic usage # here. form = cgi.FieldStorage() if "player1" not in form or "player2" not in form or "size" not in form: raise FormError("Invalid parameters.") player1 = form["player1"].value player2 = form["...
{'deleted': [{'line_no': 35, 'char_start': 1148, 'char_end': 1261, 'line': ' cursor.execute("""INSERT INTO games(player1,player2,size) VALUES("%s","%s",%d);""" % (player1,player2,size))\n'}], 'added': [{'line_no': 35, 'char_start': 1148, 'char_end': 1260, 'line': ' cursor.execute("""INSERT INTO games(player1,play...
{'deleted': [{'char_start': 1234, 'char_end': 1236, 'chars': ' %'}], 'added': [{'char_start': 1234, 'char_end': 1235, 'chars': ','}]}
github.com/russ-lewis/ttt_-_python_cgi/commit/6096f43fd4b2d91211eec4614b7960c0816900da
cgi/create_game.py
cwe-089
373
cwe-125
gmc_mmx
static void gmc_mmx(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height) { const int w = 8; const int ix = ox >> (16 + shift); const int iy = oy >> (16 ...
static void gmc_mmx(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height) { const int w = 8; const int ix = ox >> (16 + shift); const int iy = oy >> (16 ...
{'deleted': [{'line_no': 28, 'char_start': 1008, 'char_end': 1060, 'line': ' int need_emu = (unsigned) ix >= width - w ||\n'}, {'line_no': 29, 'char_start': 1060, 'char_end': 1110, 'line': ' (unsigned) iy >= height - h;\n'}], 'added': [{'line_no': 28, 'char_start': 1008, 'char_end': 1073, 'lin...
{'deleted': [], 'added': [{'char_start': 1059, 'char_end': 1072, 'chars': ' width < w ||'}, {'char_start': 1121, 'char_end': 1156, 'chars': ' || height< h\n '}]}
github.com/FFmpeg/FFmpeg/commit/58cf31cee7a456057f337b3102a03206d833d5e8
libavcodec/x86/mpegvideodsp.c
cwe-125
1,806
cwe-089
insertData
def insertData(self,userid,post): sqlText="insert into post(userid,date,comment) \ values(%d,current_timestamp(0),'%s');"%(userid,post); result=sql.insertDB(self.conn,sqlText) return result;
def insertData(self,userid,post): sqlText="insert into post(userid,date,comment) \ values(%s,current_timestamp(0),%s);" params=[userid,post]; result=sql.insertDB(self.conn,sqlText,params) return result;
{'deleted': [{'line_no': 3, 'char_start': 95, 'char_end': 165, 'line': ' values(%d,current_timestamp(0),\'%s\');"%(userid,post);\n'}, {'line_no': 4, 'char_start': 165, 'char_end': 212, 'line': ' result=sql.insertDB(self.conn,sqlText)\n'}], 'added': [{'line_no': 3, 'char_start': 95, 'char_end': 148...
{'deleted': [{'char_start': 119, 'char_end': 120, 'chars': 'd'}, {'char_start': 142, 'char_end': 143, 'chars': "'"}, {'char_start': 145, 'char_end': 146, 'chars': "'"}, {'char_start': 149, 'char_end': 151, 'chars': '%('}, {'char_start': 162, 'char_end': 163, 'chars': ')'}], 'added': [{'char_start': 119, 'char_end': 120...
github.com/ShaominLi/Twitter_project/commit/5329d91f9e569c95184053c8e7ef596949c33ce9
modules/post.py
cwe-089
56
cwe-079
htmlvalue
def htmlvalue(self, val): return self.block.render_basic(val)
def htmlvalue(self, val): """ Return an HTML representation of this block that is safe to be included in comparison views """ return escape(text_from_html(self.block.render_basic(val)))
{'deleted': [{'line_no': 2, 'char_start': 30, 'char_end': 73, 'line': ' return self.block.render_basic(val)\n'}], 'added': [{'line_no': 2, 'char_start': 30, 'char_end': 42, 'line': ' """\n'}, {'line_no': 3, 'char_start': 42, 'char_end': 122, 'line': ' Return an HTML representation of this block tha...
{'deleted': [], 'added': [{'char_start': 38, 'char_end': 68, 'chars': '"""\n Return an HTML rep'}, {'char_start': 70, 'char_end': 73, 'chars': 'sen'}, {'char_start': 74, 'char_end': 117, 'chars': 'ation of this block that is safe to be incl'}, {'char_start': 118, 'char_end': 138, 'chars': 'ded\n in compa'...
github.com/wagtail/wagtail/commit/61045ceefea114c40ac4b680af58990dbe732389
wagtail/admin/compare.py
cwe-079
16
cwe-078
get_ports
def get_ports(self): # First get the active FC ports out = self._cli_run('showport', None) # strip out header # N:S:P,Mode,State,----Node_WWN----,-Port_WWN/HW_Addr-,Type, # Protocol,Label,Partner,FailoverState out = out[1:len(out) - 2] ports = {'FC': [], 'iS...
def get_ports(self): # First get the active FC ports out = self._cli_run(['showport']) # strip out header # N:S:P,Mode,State,----Node_WWN----,-Port_WWN/HW_Addr-,Type, # Protocol,Label,Partner,FailoverState out = out[1:len(out) - 2] ports = {'FC': [], 'iSCSI'...
{'deleted': [{'line_no': 3, 'char_start': 65, 'char_end': 111, 'line': " out = self._cli_run('showport', None)\n"}, {'line_no': 20, 'char_start': 603, 'char_end': 656, 'line': " out = self._cli_run('showport -iscsi', None)\n"}, {'line_no': 34, 'char_start': 1031, 'char_end': 1091, 'line': " result ...
{'deleted': [{'char_start': 103, 'char_end': 109, 'chars': ', None'}, {'char_start': 648, 'char_end': 654, 'chars': ', None'}, {'char_start': 1083, 'char_end': 1089, 'chars': ', None'}], 'added': [{'char_start': 93, 'char_end': 94, 'chars': '['}, {'char_start': 104, 'char_end': 105, 'chars': ']'}, {'char_start': 627, '...
github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f
cinder/volume/drivers/san/hp/hp_3par_common.py
cwe-078
450
cwe-787
ContentLine_Analyzer::DoDeliverOnce
int ContentLine_Analyzer::DoDeliverOnce(int len, const u_char* data) { const u_char* data_start = data; if ( len <= 0 ) return 0; for ( ; len > 0; --len, ++data ) { if ( offset >= buf_len ) InitBuffer(buf_len * 2); int c = data[0]; #define EMIT_LINE \ { \ buf[offset] = '\0'; \ int seq_len = data +...
int ContentLine_Analyzer::DoDeliverOnce(int len, const u_char* data) { const u_char* data_start = data; if ( len <= 0 ) return 0; for ( ; len > 0; --len, ++data ) { if ( offset >= buf_len ) InitBuffer(buf_len * 2); int c = data[0]; #define EMIT_LINE \ { \ buf[offset] = '\0'; \ int seq_len = data +...
{'deleted': [], 'added': [{'line_no': 52, 'char_start': 1101, 'char_end': 1124, 'line': '\t\t\t\tif ( offset == 0 )\n'}, {'line_no': 53, 'char_start': 1124, 'char_end': 1131, 'line': '\t\t\t\t\t{\n'}, {'line_no': 54, 'char_start': 1131, 'char_end': 1151, 'line': '\t\t\t\t\tlast_char = c;\n'}, {'line_no': 55, 'char_star...
{'deleted': [], 'added': [{'char_start': 803, 'char_end': 1174, 'chars': '// Weird corner-case:\n\t\t\t\t// this can happen if we see a \\r at the end of a packet where crlf is\n\t\t\t\t// set to CR_as_EOL | LF_as_EOL, with the packet causing crlf to be set to\n\t\t\t\t// 0 and the next packet beginning with a \\n. In ...
github.com/bro/bro/commit/6c0f101a62489b1c5927b4ed63b0e1d37db40282
src/analyzer/protocol/tcp/ContentLine.cc
cwe-787
476
cwe-089
get_article
def get_article(index): with conn.cursor(cursor_factory=DictCursor) as cur: query = "SELECT * FROM articles WHERE index="+str(index) cur.execute(query) article = cur.fetchone() return article
def get_article(index): with conn.cursor(cursor_factory=DictCursor) as cur: query = "SELECT * FROM articles WHERE index=%s" cur.execute(query, (index, )) article = cur.fetchone() return article
{'deleted': [{'line_no': 3, 'char_start': 80, 'char_end': 145, 'line': ' query = "SELECT * FROM articles WHERE index="+str(index)\n'}, {'line_no': 4, 'char_start': 145, 'char_end': 172, 'line': ' cur.execute(query)\n'}], 'added': [{'line_no': 3, 'char_start': 80, 'char_end': 136, 'line': ' query = ...
{'deleted': [{'char_start': 132, 'char_end': 134, 'chars': '"+'}, {'char_start': 135, 'char_end': 144, 'chars': 'tr(index)'}], 'added': [{'char_start': 132, 'char_end': 133, 'chars': '%'}, {'char_start': 134, 'char_end': 135, 'chars': '"'}, {'char_start': 161, 'char_end': 172, 'chars': ', (index, )'}]}
github.com/sepehr125/arxiv-doc2vec-recommender/commit/f23a4c32e6192b145017f64734b0a9a384c9123a
app.py
cwe-089
46
cwe-089
get_monthly_ranks_for_scene
def get_monthly_ranks_for_scene(db, scene, tag): sql = "SELECT date, rank FROM ranks WHERE scene='{}' AND player='{}'".format(scene, tag) res = db.exec(sql) res = [r for r in res if played_during_month(db, scene, tag, get_previous_month(r[0]))] # Build up a dict of {date: rank} ranks = {} for...
def get_monthly_ranks_for_scene(db, scene, tag): sql = "SELECT date, rank FROM ranks WHERE scene='{scene}' AND player='{tag}'" args = {'scene': scene, 'tag': tag} res = db.exec(sql, args) res = [r for r in res if played_during_month(db, scene, tag, get_previous_month(r[0]))] # Build up a dict of ...
{'deleted': [{'line_no': 3, 'char_start': 50, 'char_end': 143, 'line': ' sql = "SELECT date, rank FROM ranks WHERE scene=\'{}\' AND player=\'{}\'".format(scene, tag)\n'}, {'line_no': 4, 'char_start': 143, 'char_end': 166, 'line': ' res = db.exec(sql)\n'}], 'added': [{'line_no': 3, 'char_start': 50, 'char_end': 13...
{'deleted': [{'char_start': 123, 'char_end': 126, 'chars': '.fo'}, {'char_start': 127, 'char_end': 131, 'chars': 'mat('}, {'char_start': 141, 'char_end': 142, 'chars': ')'}], 'added': [{'char_start': 104, 'char_end': 109, 'chars': 'scene'}, {'char_start': 125, 'char_end': 128, 'chars': 'tag'}, {'char_start': 131, 'char...
github.com/DKelle/Smash_stats/commit/4bb83f3f6ce7d6bebbeb512cd015f9e72cf36d63
bracket_utils.py
cwe-089
111
cwe-078
_modify_3par_fibrechan_host
def _modify_3par_fibrechan_host(self, hostname, wwn): # when using -add, you can not send the persona or domain options out = self.common._cli_run('createhost -add %s %s' % (hostname, " ".join(wwn)), None)
def _modify_3par_fibrechan_host(self, hostname, wwns): # when using -add, you can not send the persona or domain options command = ['createhost', '-add', hostname] for wwn in wwns: command.append(wwn) out = self.common._cli_run(command)
{'deleted': [{'line_no': 1, 'char_start': 0, 'char_end': 58, 'line': ' def _modify_3par_fibrechan_host(self, hostname, wwn):\n'}, {'line_no': 3, 'char_start': 132, 'char_end': 191, 'line': " out = self.common._cli_run('createhost -add %s %s'\n"}, {'line_no': 4, 'char_start': 191, 'char_end': 260, 'line': ' ...
{'deleted': [{'char_start': 58, 'char_end': 58, 'chars': ''}, {'char_start': 140, 'char_end': 151, 'chars': 'out = self.'}, {'char_start': 155, 'char_end': 156, 'chars': 'o'}, {'char_start': 157, 'char_end': 167, 'chars': '._cli_run('}, {'char_start': 184, 'char_end': 188, 'chars': '%s %'}, {'char_start': 189, 'char_en...
github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f
cinder/volume/drivers/san/hp/hp_3par_fc.py
cwe-078
67
cwe-125
SMB2_negotiate
SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) { struct smb_rqst rqst; struct smb2_negotiate_req *req; struct smb2_negotiate_rsp *rsp; struct kvec iov[1]; struct kvec rsp_iov; int rc = 0; int resp_buftype; struct TCP_Server_Info *server = ses->server; int blob_offset, blob_length; char *security...
SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) { struct smb_rqst rqst; struct smb2_negotiate_req *req; struct smb2_negotiate_rsp *rsp; struct kvec iov[1]; struct kvec rsp_iov; int rc = 0; int resp_buftype; struct TCP_Server_Info *server = ses->server; int blob_offset, blob_length; char *security...
{'deleted': [{'line_no': 116, 'char_start': 3733, 'char_end': 3799, 'line': '\t\t} else if (rsp->DialectRevision == cpu_to_le16(SMB311_PROT_ID))\n'}], 'added': [{'line_no': 116, 'char_start': 3733, 'char_end': 3771, 'line': '\t\t\tses->server->vals = &smb21_values;\n'}, {'line_no': 117, 'char_start': 3771, 'char_end': ...
{'deleted': [], 'added': [{'char_start': 3735, 'char_end': 3773, 'chars': '\tses->server->vals = &smb21_values;\n\t\t'}, {'char_start': 3836, 'char_end': 3838, 'chars': ' {'}, {'char_start': 3880, 'char_end': 3923, 'chars': '\n\t\t\tses->server->vals = &smb311_values;\n\t\t}'}]}
github.com/torvalds/linux/commit/b57a55e2200ede754e4dc9cce4ba9402544b9365
fs/cifs/smb2pdu.c
cwe-125
2,266
cwe-079
action_save_user
def action_save_user(request: HttpRequest, default_forward_url: str = "/admin/users"): """ This functions saves the changes to the user or adds a new one. It completely creates the HttpResponse :param request: the HttpRequest :param default_forward_url: The URL to forward to if nothing was specified ...
def action_save_user(request: HttpRequest, default_forward_url: str = "/admin/users"): """ This functions saves the changes to the user or adds a new one. It completely creates the HttpResponse :param request: the HttpRequest :param default_forward_url: The URL to forward to if nothing was specified ...
{'deleted': [{'line_no': 27, 'char_start': 1188, 'char_end': 1231, 'line': ' user.displayName = displayname\n'}, {'line_no': 29, 'char_start': 1260, 'char_end': 1291, 'line': ' user.notes = notes\n'}, {'line_no': 40, 'char_start': 1855, 'char_end': 1883, 'line': ' au.email = mail\n'}, {...
{'deleted': [], 'added': [{'char_start': 1219, 'char_end': 1226, 'chars': 'escape('}, {'char_start': 1237, 'char_end': 1238, 'chars': ')'}, {'char_start': 1293, 'char_end': 1300, 'chars': 'escape('}, {'char_start': 1305, 'char_end': 1306, 'chars': ')'}, {'char_start': 1894, 'char_end': 1901, 'chars': 'escape('}, {'char...
github.com/Technikradio/C3FOCSite/commit/6e330d4d44bbfdfce9993dffea97008276771600
c3shop/frontpage/management/edit_user.py
cwe-079
622
cwe-190
ring_buffer_resize
int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size, int cpu_id) { struct ring_buffer_per_cpu *cpu_buffer; unsigned long nr_pages; int cpu, err = 0; /* * Always succeed at resizing a non-existent buffer: */ if (!buffer) return size; /* Make sure the requested buffer exists */ if (cpu...
int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size, int cpu_id) { struct ring_buffer_per_cpu *cpu_buffer; unsigned long nr_pages; int cpu, err = 0; /* * Always succeed at resizing a non-existent buffer: */ if (!buffer) return size; /* Make sure the requested buffer exists */ if (cpu...
{'deleted': [{'line_no': 19, 'char_start': 416, 'char_end': 459, 'line': '\tsize = DIV_ROUND_UP(size, BUF_PAGE_SIZE);\n'}, {'line_no': 20, 'char_start': 459, 'char_end': 483, 'line': '\tsize *= BUF_PAGE_SIZE;\n'}, {'line_no': 23, 'char_start': 522, 'char_end': 553, 'line': '\tif (size < BUF_PAGE_SIZE * 2)\n'}, {'line_n...
{'deleted': [{'char_start': 417, 'char_end': 420, 'chars': 'siz'}, {'char_start': 459, 'char_end': 483, 'chars': '\tsize *= BUF_PAGE_SIZE;\n'}, {'char_start': 527, 'char_end': 530, 'chars': 'siz'}, {'char_start': 534, 'char_end': 550, 'chars': 'BUF_PAGE_SIZE * '}, {'char_start': 555, 'char_end': 558, 'chars': 'siz'}, {...
github.com/torvalds/linux/commit/59643d1535eb220668692a5359de22545af579f6
kernel/trace/ring_buffer.c
cwe-190
1,218
cwe-787
opj_j2k_set_cinema_parameters
static void opj_j2k_set_cinema_parameters(opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager) { /* Configure cinema parameters */ int i; /* No tiling */ parameters->tile_size_on = OPJ_FALSE; parameters->cp_tdx = 1; parameters->cp_tdy = 1; /* One tile part...
static void opj_j2k_set_cinema_parameters(opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager) { /* Configure cinema parameters */ int i; /* No tiling */ parameters->tile_size_on = OPJ_FALSE; parameters->cp_tdx = 1; parameters->cp_tdy = 1; /* One tile part...
{'deleted': [{'line_no': 87, 'char_start': 3193, 'char_end': 3251, 'line': ' parameters->res_spec = parameters->numresolution - 1;\n'}, {'line_no': 88, 'char_start': 3251, 'char_end': 3300, 'line': ' for (i = 0; i < parameters->res_spec; i++) {\n'}, {'line_no': 89, 'char_start': 3300, 'char_end': 3340, 'line': ' ...
{'deleted': [], 'added': [{'char_start': 3197, 'char_end': 3370, 'chars': 'if (parameters->numresolution == 1) {\n parameters->res_spec = 1;\n parameters->prcw_init[0] = 128;\n parameters->prch_init[0] = 128;\n } else {\n '}, {'char_start': 3424, 'char_end': 3428, 'chars': ' '}, {'char...
github.com/uclouvain/openjpeg/commit/4241ae6fbbf1de9658764a80944dc8108f2b4154
src/lib/openjp2/j2k.c
cwe-787
1,569
cwe-078
_modify_3par_iscsi_host
def _modify_3par_iscsi_host(self, hostname, iscsi_iqn): # when using -add, you can not send the persona or domain options self.common._cli_run('createhost -iscsi -add %s %s' % (hostname, iscsi_iqn), None)
def _modify_3par_iscsi_host(self, hostname, iscsi_iqn): # when using -add, you can not send the persona or domain options command = ['createhost', '-iscsi', '-add', hostname, iscsi_iqn] self.common._cli_run(command)
{'deleted': [{'line_no': 3, 'char_start': 134, 'char_end': 194, 'line': " self.common._cli_run('createhost -iscsi -add %s %s'\n"}, {'line_no': 4, 'char_start': 194, 'char_end': 253, 'line': ' % (hostname, iscsi_iqn), None)\n'}], 'added': [{'line_no': 3, 'char_start': 134, 'char_end': ...
{'deleted': [{'char_start': 142, 'char_end': 147, 'chars': 'self.'}, {'char_start': 151, 'char_end': 152, 'chars': 'o'}, {'char_start': 153, 'char_end': 163, 'chars': '._cli_run('}, {'char_start': 186, 'char_end': 192, 'chars': ' %s %s'}, {'char_start': 193, 'char_end': 222, 'chars': '\n '}, ...
github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f
cinder/volume/drivers/san/hp/hp_3par_iscsi.py
cwe-078
68
cwe-476
avpriv_ac3_parse_header
int avpriv_ac3_parse_header(AC3HeaderInfo **phdr, const uint8_t *buf, size_t size) { GetBitContext gb; AC3HeaderInfo *hdr; int err; if (!*phdr) *phdr = av_mallocz(sizeof(AC3HeaderInfo)); if (!*phdr) return AVERROR(ENOMEM); hdr = *phdr; init_get_b...
int avpriv_ac3_parse_header(AC3HeaderInfo **phdr, const uint8_t *buf, size_t size) { GetBitContext gb; AC3HeaderInfo *hdr; int err; if (!*phdr) *phdr = av_mallocz(sizeof(AC3HeaderInfo)); if (!*phdr) return AVERROR(ENOMEM); hdr = *phdr; err = init...
{'deleted': [{'line_no': 14, 'char_start': 306, 'char_end': 342, 'line': ' init_get_bits8(&gb, buf, size);\n'}], 'added': [{'line_no': 14, 'char_start': 306, 'char_end': 348, 'line': ' err = init_get_bits8(&gb, buf, size);\n'}, {'line_no': 15, 'char_start': 348, 'char_end': 365, 'line': ' if (err < 0)\n'}, {'l...
{'deleted': [], 'added': [{'char_start': 310, 'char_end': 316, 'chars': 'err = '}, {'char_start': 346, 'char_end': 399, 'chars': ';\n if (err < 0)\n return AVERROR_INVALIDDATA'}]}
github.com/FFmpeg/FFmpeg/commit/00e8181bd97c834fe60751b0c511d4bb97875f78
libavcodec/ac3_parser.c
cwe-476
139
cwe-089
retrieve_playlist_by_id
def retrieve_playlist_by_id(id, db): db.execute( "SELECT id, name, video_position from playlist WHERE id={id};".format(id=id)) row = db.fetchone() return row
def retrieve_playlist_by_id(id, db): db.execute( "SELECT id, name, video_position from playlist WHERE id=%s;", (id,)) row = db.fetchone() return row
{'deleted': [{'line_no': 3, 'char_start': 53, 'char_end': 139, 'line': ' "SELECT id, name, video_position from playlist WHERE id={id};".format(id=id))\n'}], 'added': [{'line_no': 3, 'char_start': 53, 'char_end': 130, 'line': ' "SELECT id, name, video_position from playlist WHERE id=%s;", (id,))\n'}]}
{'deleted': [{'char_start': 117, 'char_end': 121, 'chars': '{id}'}, {'char_start': 123, 'char_end': 130, 'chars': '.format'}, {'char_start': 133, 'char_end': 136, 'chars': '=id'}], 'added': [{'char_start': 117, 'char_end': 119, 'chars': '%s'}, {'char_start': 121, 'char_end': 123, 'chars': ', '}, {'char_start': 126, 'ch...
github.com/Madmous/playlist/commit/666e52c5f0b8c1f4296e84471637033d9542a7a6
playlist/playlist_repository.py
cwe-089
43
cwe-089
get_login
@bot.message_handler(commands =['login']) def get_login(message): settings = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\bases\\settings.db") conn = settings.cursor() conn.execute("select * from users where chat_id = '" + str(message.chat.id) + "'") name = conn.fetchone() if name...
@bot.message_handler(commands =['login']) def get_login(message): settings = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\bases\\settings.db") conn = settings.cursor() conn.execute("select * from users where chat_id = ?", (str(message.chat.id),)) name = conn.fetchone() if name != ...
{'deleted': [{'line_no': 5, 'char_start': 195, 'char_end': 282, 'line': ' conn.execute("select * from users where chat_id = \'" + str(message.chat.id) + "\'")\n'}], 'added': [{'line_no': 5, 'char_start': 195, 'char_end': 278, 'line': ' conn.execute("select * from users where chat_id = ?", (str(message.chat.id),))...
{'deleted': [{'char_start': 249, 'char_end': 250, 'chars': "'"}, {'char_start': 251, 'char_end': 253, 'chars': ' +'}, {'char_start': 274, 'char_end': 280, 'chars': ' + "\'"'}], 'added': [{'char_start': 249, 'char_end': 250, 'chars': '?'}, {'char_start': 251, 'char_end': 252, 'chars': ','}, {'char_start': 253, 'char_end...
github.com/lissrbay/codeforces_bot/commit/cc7f5143445a0030b1149ac60a65b1b1b9c92a90
bot.py
cwe-089
144
cwe-022
dd_delete_item
int dd_delete_item(struct dump_dir *dd, const char *name) { if (!dd->locked) error_msg_and_die("dump_dir is not opened"); /* bug */ char *path = concat_path_file(dd->dd_dirname, name); int res = unlink(path); if (res < 0) { if (errno == ENOENT) errno = res = 0; ...
int dd_delete_item(struct dump_dir *dd, const char *name) { if (!dd->locked) error_msg_and_die("dump_dir is not opened"); /* bug */ if (!str_is_correct_filename(name)) error_msg_and_die("Cannot delete item. '%s' is not a valid file name", name); char *path = concat_path_file(dd->dd_dirname...
{'deleted': [], 'added': [{'line_no': 6, 'char_start': 145, 'char_end': 185, 'line': ' if (!str_is_correct_filename(name))\n'}, {'line_no': 7, 'char_start': 185, 'char_end': 271, 'line': ' error_msg_and_die("Cannot delete item. \'%s\' is not a valid file name", name);\n'}, {'line_no': 8, 'char_start': 271, 'c...
{'deleted': [], 'added': [{'char_start': 149, 'char_end': 276, '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 '}]}
github.com/abrt/libreport/commit/239c4f7d1f47265526b39ad70106767d00805277
src/lib/dump_dir.c
cwe-022
115
cwe-787
decode_frame
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { PicContext *s = avctx->priv_data; AVFrame *frame = data; uint32_t *palette; int bits_per_plane, bpp, etype, esize, npal, pos_after_pal; int i, x, y, plane, tm...
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { PicContext *s = avctx->priv_data; AVFrame *frame = data; uint32_t *palette; int bits_per_plane, bpp, etype, esize, npal, pos_after_pal; int i, x, y, plane, tm...
{'deleted': [{'line_no': 46, 'char_start': 1512, 'char_end': 1578, 'line': ' if (s->width != avctx->width && s->height != avctx->height) {\n'}], 'added': [{'line_no': 46, 'char_start': 1512, 'char_end': 1578, 'line': ' if (s->width != avctx->width || s->height != avctx->height) {\n'}]}
{'deleted': [{'char_start': 1545, 'char_end': 1547, 'chars': '&&'}], 'added': [{'char_start': 1545, 'char_end': 1547, 'chars': '||'}]}
github.com/FFmpeg/FFmpeg/commit/8c2ea3030af7b40a3c4275696fb5c76cdb80950a
libavcodec/pictordec.c
cwe-787
1,779
cwe-089
findNPC
def findNPC(race, classe, sex,level): c, conn = getConnection() date = now() #select image, SUM(legit) as l FROM npc WHERE race='Elf' AND class='Bard' AND sex='Male' GROUP BY image HAVING l>5 ORDER BY SUM(legit) DESC; c.execute("select image, avg(legit) as l FROM npc WHERE race='"+race+"' AND class='"+classe+"' AND...
def findNPC(race, classe, sex,level): c, conn = getConnection() date = now() #select image, SUM(legit) as l FROM npc WHERE race='Elf' AND class='Bard' AND sex='Male' GROUP BY image HAVING l>5 ORDER BY SUM(legit) DESC; c.execute("select image, avg(legit) as l FROM npc WHERE race=(?) AND class=(?) AND sex=(?) GROUP B...
{'deleted': [{'line_no': 5, 'char_start': 221, 'char_end': 391, 'line': '\tc.execute("select image, avg(legit) as l FROM npc WHERE race=\'"+race+"\' AND class=\'"+classe+"\' AND sex=\'"+sex+"\' GROUP BY image HAVING l > 5 ORDER BY SUM(legit) DESC;")\n'}], 'added': [{'line_no': 5, 'char_start': 221, 'char_end': 386, 'li...
{'deleted': [{'char_start': 283, 'char_end': 293, 'chars': '\'"+race+"\''}, {'char_start': 304, 'char_end': 316, 'chars': '\'"+classe+"\''}, {'char_start': 325, 'char_end': 334, 'chars': '\'"+sex+"\''}, {'char_start': 387, 'char_end': 388, 'chars': ';'}], 'added': [{'char_start': 283, 'char_end': 286, 'chars': '(?)'}, ...
github.com/DangerBlack/DungeonsAndDragonsMasterBot/commit/63f980c6dff746f5fcf3005d0646b6c24f81cdc0
database.py
cwe-089
134
cwe-089
delete
@mod.route('/delete/<int:cmt_id>', methods=['GET', 'POST']) def delete(cmt_id): if request.method == 'GET': sql = "SELECT msg_id FROM comment where cmt_id = %d;" % (cmt_id) cursor.execute(sql) m = cursor.fetchone() sql = "DELETE FROM comment where cmt_id = '%d';" % (cmt_id) c...
@mod.route('/delete/<int:cmt_id>', methods=['GET', 'POST']) def delete(cmt_id): if request.method == 'GET': cursor.execute("SELECT msg_id FROM comment where cmt_id = %s;", (cmt_id,)) m = cursor.fetchone() cursor.execute("DELETE FROM comment where cmt_id = %s;", (cmt_id,)) conn.commit...
{'deleted': [{'line_no': 4, 'char_start': 112, 'char_end': 185, 'line': ' sql = "SELECT msg_id FROM comment where cmt_id = %d;" % (cmt_id)\n'}, {'line_no': 5, 'char_start': 185, 'char_end': 213, 'line': ' cursor.execute(sql)\n'}, {'line_no': 7, 'char_start': 243, 'char_end': 311, 'line': ' sql = "D...
{'deleted': [{'char_start': 121, 'char_end': 126, 'chars': 'ql = '}, {'char_start': 170, 'char_end': 171, 'chars': 'd'}, {'char_start': 173, 'char_end': 175, 'chars': ' %'}, {'char_start': 184, 'char_end': 211, 'chars': '\n cursor.execute(sql'}, {'char_start': 252, 'char_end': 257, 'chars': 'ql = '}, {'char_star...
github.com/ulyssetsd/bjtu-sql/commit/17d7b21864b72ba5666f15236474a93268b32ec9
flaskr/flaskr/views/comment.py
cwe-089
118
cwe-125
HPHP::exif_scan_JPEG_header
static int exif_scan_JPEG_header(image_info_type *ImageInfo) { int section, sn; int marker = 0, last_marker = M_PSEUDO, comment_correction=1; int ll, lh; unsigned char *Data; size_t fpos, size, got, itemlen; jpeg_sof_info sof_info; for(section=0;;section++) { // get marker byte, swallowing possible ...
static int exif_scan_JPEG_header(image_info_type *ImageInfo) { int section, sn; int marker = 0, last_marker = M_PSEUDO, comment_correction=1; int ll, lh; unsigned char *Data; size_t fpos, size, got, itemlen; jpeg_sof_info sof_info; for(section=0;;section++) { // get marker byte, swallowing possible ...
{'deleted': [], 'added': [{'line_no': 137, 'char_start': 4277, 'char_end': 4310, 'line': ' if ((itemlen - 2) < 6) {\n'}, {'line_no': 138, 'char_start': 4310, 'char_end': 4330, 'line': ' return 0;\n'}, {'line_no': 139, 'char_start': 4330, 'char_end': 4340, 'line': ' }\n'}, {'line_no': 140, 'char_s...
{'deleted': [], 'added': [{'char_start': 4285, 'char_end': 4349, 'chars': 'if ((itemlen - 2) < 6) {\n return 0;\n }\n\n '}]}
github.com/facebook/hhvm/commit/f9680d21beaa9eb39d166e8810e29fbafa51ad15
hphp/runtime/ext/gd/ext_gd.cpp
cwe-125
1,269
cwe-787
flb_gzip_compress
int flb_gzip_compress(void *in_data, size_t in_len, void **out_data, size_t *out_len) { int flush; int status; int footer_start; uint8_t *pb; size_t out_size; void *out_buf; z_stream strm; mz_ulong crc; out_size = in_len + 32; out_buf = flb_malloc(out_size)...
int flb_gzip_compress(void *in_data, size_t in_len, void **out_data, size_t *out_len) { int flush; int status; int footer_start; uint8_t *pb; size_t out_size; void *out_buf; z_stream strm; mz_ulong crc; /* * GZIP relies on an algorithm with worst-case exp...
{'deleted': [{'line_no': 13, 'char_start': 258, 'char_end': 286, 'line': ' out_size = in_len + 32;\n'}], 'added': [{'line_no': 13, 'char_start': 258, 'char_end': 259, 'line': '\n'}, {'line_no': 14, 'char_start': 259, 'char_end': 266, 'line': ' /*\n'}, {'line_no': 15, 'char_start': 266, 'char_end': 327, 'line': ' ...
{'deleted': [{'char_start': 276, 'char_end': 277, 'chars': 'l'}, {'char_start': 282, 'char_end': 284, 'chars': '32'}], 'added': [{'char_start': 258, 'char_end': 259, 'chars': '\n'}, {'char_start': 263, 'char_end': 324, 'chars': '/*\n * GZIP relies on an algorithm with worst-case expansi'}, {'char_start': 325, 'char...
github.com/fluent/fluent-bit/commit/cadff53c093210404aed01c4cf586adb8caa07af
src/flb_gzip.c
cwe-787
698
cwe-079
add_article_action
def add_article_action(request: HttpRequest, default_foreward_url: str): forward_url: str = default_foreward_url if request.GET.get("redirect"): forward_url = request.GET["redirect"] else: forward_url = "/admin" if "rid" not in request.GET: return HttpResponseRedirect("/admin?err...
def add_article_action(request: HttpRequest, default_foreward_url: str): forward_url: str = default_foreward_url if request.GET.get("redirect"): forward_url = request.GET["redirect"] else: forward_url = "/admin" if "rid" not in request.GET: return HttpResponseRedirect("/admin?err...
{'deleted': [{'line_no': 20, 'char_start': 954, 'char_end': 997, 'line': ' notes: str = request.POST["notes"]\n'}, {'line_no': 45, 'char_start': 2195, 'char_end': 2269, 'line': ' ar.notes = str(request.POST[str("notes_" + str(art.id))])\n'}], 'added': [{'line_no': 20, 'char_start': 954, 'char_end'...
{'deleted': [], 'added': [{'char_start': 975, 'char_end': 982, 'chars': 'escape('}, {'char_start': 1003, 'char_end': 1004, 'chars': ')'}, {'char_start': 2230, 'char_end': 2237, 'chars': 'escape('}, {'char_start': 2282, 'char_end': 2283, 'chars': ')'}]}
github.com/Technikradio/C3FOCSite/commit/6e330d4d44bbfdfce9993dffea97008276771600
c3shop/frontpage/management/reservation_actions.py
cwe-079
581
cwe-416
archive_read_format_rar_read_data
archive_read_format_rar_read_data(struct archive_read *a, const void **buff, size_t *size, int64_t *offset) { struct rar *rar = (struct rar *)(a->format->data); int ret; if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) { rar->has_encrypted_entries =...
archive_read_format_rar_read_data(struct archive_read *a, const void **buff, size_t *size, int64_t *offset) { struct rar *rar = (struct rar *)(a->format->data); int ret; if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) { rar->has_encrypted_entries =...
{'deleted': [{'line_no': 38, 'char_start': 1072, 'char_end': 1122, 'line': ' if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN)\n'}], 'added': [{'line_no': 38, 'char_start': 1072, 'char_end': 1124, 'line': ' if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) {\n'}, {'line_no': 40, 'char_start': 1189, 'char_end': 1221, 'lin...
{'deleted': [], 'added': [{'char_start': 1121, 'char_end': 1123, 'chars': ' {'}, {'char_start': 1188, 'char_end': 1226, 'chars': '\n rar->start_new_table = 1;\n }'}]}
github.com/libarchive/libarchive/commit/b8592ecba2f9e451e1f5cb7ab6dcee8b8e7b3f60
libarchive/archive_read_support_format_rar.c
cwe-416
387
cwe-476
dnxhd_find_frame_end
static int dnxhd_find_frame_end(DNXHDParserContext *dctx, const uint8_t *buf, int buf_size) { ParseContext *pc = &dctx->pc; uint64_t state = pc->state64; int pic_found = pc->frame_start_found; int i = 0; if (!pic_found) { for (i = 0; i < buf_size; i++) { ...
static int dnxhd_find_frame_end(DNXHDParserContext *dctx, const uint8_t *buf, int buf_size) { ParseContext *pc = &dctx->pc; uint64_t state = pc->state64; int pic_found = pc->frame_start_found; int i = 0; if (!pic_found) { for (i = 0; i < buf_size; i++) { ...
{'deleted': [{'line_no': 39, 'char_start': 1200, 'char_end': 1268, 'line': ' dctx->remaining = avpriv_dnxhd_get_frame_size(cid);\n'}, {'line_no': 40, 'char_start': 1268, 'char_end': 1312, 'line': ' if (dctx->remaining <= 0) {\n'}, {'line_no': 41, 'char_start': 1312, 'char_end': 1398, 'line...
{'deleted': [{'char_start': 1216, 'char_end': 1222, 'chars': 'dctx->'}, {'char_start': 1288, 'char_end': 1294, 'chars': 'dctx->'}, {'char_start': 1332, 'char_end': 1338, 'chars': 'dctx->'}, {'char_start': 1422, 'char_end': 1428, 'chars': 'dctx->'}, {'char_start': 1468, 'char_end': 1476, 'chars': 'return d'}, {'char_sta...
github.com/FFmpeg/FFmpeg/commit/0a709e2a10b8288a0cc383547924ecfe285cef89
libavcodec/dnxhd_parser.c
cwe-476
622
cwe-125
ndpi_search_oracle
void ndpi_search_oracle(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &flow->packet; u_int16_t dport = 0, sport = 0; NDPI_LOG_DBG(ndpi_struct, "search ORACLE\n"); if(packet->tcp != NULL) { sport = ntohs(packet->tcp->source), dport = ...
void ndpi_search_oracle(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &flow->packet; u_int16_t dport = 0, sport = 0; NDPI_LOG_DBG(ndpi_struct, "search ORACLE\n"); if(packet->tcp != NULL) { sport = ntohs(packet->tcp->source), dport = ...
{'deleted': [{'line_no': 13, 'char_start': 489, 'char_end': 590, 'line': '\t&& (((packet->payload[0] == 0x07) && (packet->payload[1] == 0xff) && (packet->payload[2] == 0x00))\n'}], 'added': [{'line_no': 13, 'char_start': 489, 'char_end': 625, 'line': '\t&& (((packet->payload_packet_len >= 3 && packet->payload[0] == 0...
{'deleted': [], 'added': [{'char_start': 512, 'char_end': 547, 'chars': '_packet_len >= 3 && packet->payload'}]}
github.com/ntop/nDPI/commit/b69177be2fbe01c2442239a61832c44e40136c05
src/lib/protocols/oracle.c
cwe-125
442
cwe-078
handle_message
def handle_message(self, ch, method, properties, body): """ this is a pika.basic_consumer callback handles client inputs, runs appropriate workflows and views Args: ch: amqp channel method: amqp method properties: body: message body ...
def handle_message(self, ch, method, properties, body): """ this is a pika.basic_consumer callback handles client inputs, runs appropriate workflows and views Args: ch: amqp channel method: amqp method properties: body: message body ...
{'deleted': [{'line_no': 28, 'char_start': 867, 'char_end': 929, 'line': " headers = {'remote_ip': input['_zops_remote_ip']}\n"}], 'added': [{'line_no': 13, 'char_start': 349, 'char_end': 370, 'line': ' headers = {}\n'}, {'line_no': 29, 'char_start': 889, 'char_end': 951, 'line': " headers ...
{'deleted': [], 'added': [{'char_start': 357, 'char_end': 378, 'chars': 'headers = {}\n '}, {'char_start': 597, 'char_end': 598, 'chars': ' '}, {'char_start': 947, 'char_end': 1003, 'chars': "'],\n 'source': input['_zops_source"}]}
github.com/zetaops/zengine/commit/52eafbee90f8ddf78be0c7452828d49423246851
zengine/wf_daemon.py
cwe-078
453
cwe-079
get_list_context
def get_list_context(context=None): list_context = frappe._dict( template = "templates/includes/blog/blog.html", get_list = get_blog_list, hide_filters = True, children = get_children(), # show_search = True, title = _('Blog') ) category = frappe.local.form_dict.blog_category or frappe.local.form_dict.c...
def get_list_context(context=None): list_context = frappe._dict( template = "templates/includes/blog/blog.html", get_list = get_blog_list, hide_filters = True, children = get_children(), # show_search = True, title = _('Blog') ) category = sanitize_html(frappe.local.form_dict.blog_category or frappe.loc...
{'deleted': [{'line_no': 11, 'char_start': 244, 'char_end': 328, 'line': '\tcategory = frappe.local.form_dict.blog_category or frappe.local.form_dict.category\n'}, {'line_no': 23, 'char_start': 768, 'char_end': 853, 'line': '\t\tlist_context.sub_title = _(\'Filtered by "{0}"\').format(frappe.local.form_dict.txt)\n'}], ...
{'deleted': [], 'added': [{'char_start': 256, 'char_end': 270, 'chars': 'sanitize_html('}, {'char_start': 341, 'char_end': 342, 'chars': ')'}, {'char_start': 840, 'char_end': 854, 'chars': 'sanitize_html('}, {'char_start': 880, 'char_end': 881, 'chars': ')'}]}
github.com/omirajkar/bench_frappe/commit/2fa19c25066ed17478d683666895e3266936aee6
frappe/website/doctype/blog_post/blog_post.py
cwe-079
290
cwe-089
reportMatch._checkPairing
def _checkPairing(): if winner == loser: raise ValueError('Attempt to match player against self') q = ''' SELECT COUNT(*) FROM matches WHERE (matches.winner_id = %s AND matches.loser_id = %s) OR (matches.winner_id = %s AND matches.loser_id = %s); ''...
def _checkPairing(): if winner == loser: raise ValueError('Attempt to match player against self') q = ''' SELECT COUNT(*) FROM matches WHERE (matches.winner_id = %s AND matches.loser_id = %s) OR (matches.winner_id = %s AND matches.loser_id = %s); ''...
{'deleted': [{'line_no': 9, 'char_start': 310, 'char_end': 355, 'line': " ''' % (winner, loser, loser, winner)\n"}, {'line_no': 10, 'char_start': 355, 'char_end': 378, 'line': ' cur.execute(q)\n'}], 'added': [{'line_no': 9, 'char_start': 310, 'char_end': 322, 'line': " '''\n"}, {'line_no': 10, 'cha...
{'deleted': [{'char_start': 322, 'char_end': 323, 'chars': '%'}, {'char_start': 354, 'char_end': 376, 'chars': '\n cur.execute(q'}], 'added': [{'char_start': 321, 'char_end': 327, 'chars': '\n '}, {'char_start': 328, 'char_end': 344, 'chars': ' cur.execute(q,'}]}
github.com/juanchopanza/Tournament/commit/5799aee52d2cabb685800b88977257bd0964d0da
vagrant/tournament/tournament.py
cwe-089
121
cwe-787
MultiPartInputFile::Data::chunkOffsetReconstruction
MultiPartInputFile::Data::chunkOffsetReconstruction(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is, const vector<InputPartData*>& parts) { // // Reconstruct broken chunk offset tables. Stop once we received any exception. // Int64 position = is.tellg(); // // check we understand all the part...
MultiPartInputFile::Data::chunkOffsetReconstruction(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is, const vector<InputPartData*>& parts) { // // Reconstruct broken chunk offset tables. Stop once we received any exception. // Int64 position = is.tellg(); // // check we understand all the part...
{'deleted': [{'line_no': 103, 'char_start': 3326, 'char_end': 3401, 'line': ' if(partNumber<0 || partNumber> static_cast<int>(parts.size()))\n'}], 'added': [{'line_no': 103, 'char_start': 3326, 'char_end': 3402, 'line': ' if(partNumber<0 || partNumber>= static_cast<int>(parts.size()))\n'}]}
{'deleted': [], 'added': [{'char_start': 3368, 'char_end': 3369, 'chars': '='}]}
github.com/AcademySoftwareFoundation/openexr/commit/8b5370c688a7362673c3a5256d93695617a4cd9a
OpenEXR/IlmImf/ImfMultiPartInputFile.cpp
cwe-787
1,892
cwe-190
HPHP::StringUtil::Implode
String StringUtil::Implode(const Variant& items, const String& delim, const bool checkIsContainer /* = true */) { if (checkIsContainer && !isContainer(items)) { throw_param_is_not_container(); } int size = getContainerSize(items); if (size == 0) return empty_string(); req::vect...
String StringUtil::Implode(const Variant& items, const String& delim, const bool checkIsContainer /* = true */) { if (checkIsContainer && !isContainer(items)) { throw_param_is_not_container(); } int size = getContainerSize(items); if (size == 0) return empty_string(); req::vect...
{'deleted': [{'line_no': 11, 'char_start': 363, 'char_end': 378, 'line': ' int len = 0;\n'}, {'line_no': 12, 'char_start': 378, 'char_end': 409, 'line': ' int lenDelim = delim.size();\n'}], 'added': [{'line_no': 11, 'char_start': 363, 'char_end': 381, 'line': ' size_t len = 0;\n'}, {'line_no': 12, 'char_start': 381,...
{'deleted': [{'char_start': 366, 'char_end': 367, 'chars': 'n'}, {'char_start': 381, 'char_end': 382, 'chars': 'n'}], 'added': [{'char_start': 365, 'char_end': 366, 'chars': 's'}, {'char_start': 367, 'char_end': 370, 'chars': 'ze_'}, {'char_start': 383, 'char_end': 384, 'chars': 's'}, {'char_start': 385, 'char_end': 38...
github.com/facebook/hhvm/commit/2c9a8fcc73a151608634d3e712973d192027c271
hphp/runtime/base/string-util.cpp
cwe-190
328
cwe-125
store_versioninfo_gnu_verneed
static Sdb *store_versioninfo_gnu_verneed(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { ut8 *end, *need = NULL; const char *section_name = ""; Elf_(Shdr) *link_shdr = NULL; const char *link_section_name = ""; Sdb *sdb_vernaux = NULL; Sdb *sdb_version = NULL; Sdb *sdb = NULL; int i, cnt; if (!bin || !bin->dynstr) {...
static Sdb *store_versioninfo_gnu_verneed(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { ut8 *end, *need = NULL; const char *section_name = ""; Elf_(Shdr) *link_shdr = NULL; const char *link_section_name = ""; Sdb *sdb_vernaux = NULL; Sdb *sdb_version = NULL; Sdb *sdb = NULL; int i, cnt; if (!bin || !bin->dynstr) {...
{'deleted': [{'line_no': 85, 'char_start': 2490, 'char_end': 2517, 'line': '\t\tvstart += entry->vn_aux;\n'}], 'added': [{'line_no': 85, 'char_start': 2490, 'char_end': 2520, 'line': '\t\tst32 vnaux = entry->vn_aux;\n'}, {'line_no': 86, 'char_start': 2520, 'char_end': 2539, 'line': '\t\tif (vnaux < 1) {\n'}, {'line_no'...
{'deleted': [{'char_start': 2492, 'char_end': 2493, 'chars': 'v'}, {'char_start': 2496, 'char_end': 2498, 'chars': 'rt'}, {'char_start': 2499, 'char_end': 2500, 'chars': '+'}], 'added': [{'char_start': 2494, 'char_end': 2499, 'chars': '32 vn'}, {'char_start': 2500, 'char_end': 2502, 'chars': 'ux'}, {'char_start': 2515,...
github.com/radare/radare2/commit/c6d0076c924891ad9948a62d89d0bcdaf965f0cd
libr/bin/format/elf/elf.c
cwe-125
1,547
cwe-125
usbhid_parse
static int usbhid_parse(struct hid_device *hid) { struct usb_interface *intf = to_usb_interface(hid->dev.parent); struct usb_host_interface *interface = intf->cur_altsetting; struct usb_device *dev = interface_to_usbdev (intf); struct hid_descriptor *hdesc; u32 quirks = 0; unsigned int rsize = 0; char *rdesc; i...
static int usbhid_parse(struct hid_device *hid) { struct usb_interface *intf = to_usb_interface(hid->dev.parent); struct usb_host_interface *interface = intf->cur_altsetting; struct usb_device *dev = interface_to_usbdev (intf); struct hid_descriptor *hdesc; u32 quirks = 0; unsigned int rsize = 0; char *rdesc; i...
{'deleted': [{'line_no': 36, 'char_start': 1218, 'char_end': 1264, 'line': '\tfor (n = 0; n < hdesc->bNumDescriptors; n++)\n'}], 'added': [{'line_no': 11, 'char_start': 331, 'char_end': 353, 'line': '\tint num_descriptors;\n'}, {'line_no': 12, 'char_start': 353, 'char_end': 409, 'line': '\tsize_t offset = offsetof(stru...
{'deleted': [{'char_start': 1219, 'char_end': 1220, 'chars': 'f'}, {'char_start': 1226, 'char_end': 1227, 'chars': '='}, {'char_start': 1228, 'char_end': 1230, 'chars': '0;'}, {'char_start': 1231, 'char_end': 1232, 'chars': 'n'}, {'char_start': 1233, 'char_end': 1234, 'chars': '<'}, {'char_start': 1243, 'char_end': 124...
github.com/torvalds/linux/commit/f043bfc98c193c284e2cd768fefabe18ac2fed9b
drivers/hid/usbhid/hid-core.c
cwe-125
581
cwe-476
nfc_genl_deactivate_target
static int nfc_genl_deactivate_target(struct sk_buff *skb, struct genl_info *info) { struct nfc_dev *dev; u32 device_idx, target_idx; int rc; if (!info->attrs[NFC_ATTR_DEVICE_INDEX]) return -EINVAL; device_idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]); dev = nfc_get_device(device_idx); if ...
static int nfc_genl_deactivate_target(struct sk_buff *skb, struct genl_info *info) { struct nfc_dev *dev; u32 device_idx, target_idx; int rc; if (!info->attrs[NFC_ATTR_DEVICE_INDEX] || !info->attrs[NFC_ATTR_TARGET_INDEX]) return -EINVAL; device_idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX...
{'deleted': [{'line_no': 8, 'char_start': 156, 'char_end': 198, 'line': '\tif (!info->attrs[NFC_ATTR_DEVICE_INDEX])\n'}], 'added': [{'line_no': 8, 'char_start': 156, 'char_end': 200, 'line': '\tif (!info->attrs[NFC_ATTR_DEVICE_INDEX] ||\n'}, {'line_no': 9, 'char_start': 200, 'char_end': 242, 'line': '\t !info->attrs...
{'deleted': [], 'added': [{'char_start': 196, 'char_end': 240, 'chars': ' ||\n\t !info->attrs[NFC_ATTR_TARGET_INDEX]'}]}
github.com/torvalds/linux/commit/385097a3675749cbc9e97c085c0e5dfe4269ca51
net/nfc/netlink.c
cwe-476
141
cwe-416
ffs_user_copy_worker
static void ffs_user_copy_worker(struct work_struct *work) { struct ffs_io_data *io_data = container_of(work, struct ffs_io_data, work); int ret = io_data->req->status ? io_data->req->status : io_data->req->actual; if (io_data->read && ret > 0) { use_mm(io_data->mm); ret = copy_to_iter(io_data->b...
static void ffs_user_copy_worker(struct work_struct *work) { struct ffs_io_data *io_data = container_of(work, struct ffs_io_data, work); int ret = io_data->req->status ? io_data->req->status : io_data->req->actual; bool kiocb_has_eventfd = io_data->kiocb->ki_flags & IOCB_EVENTFD; if (io_data->read &...
{'deleted': [{'line_no': 18, 'char_start': 488, 'char_end': 522, 'line': '\tif (io_data->ffs->ffs_eventfd &&\n'}, {'line_no': 19, 'char_start': 522, 'char_end': 571, 'line': '\t !(io_data->kiocb->ki_flags & IOCB_EVENTFD))\n'}, {'line_no': 24, 'char_start': 670, 'char_end': 703, 'line': '\tio_data->kiocb->private = N...
{'deleted': [{'char_start': 521, 'char_end': 526, 'chars': '\n\t '}, {'char_start': 528, 'char_end': 538, 'chars': '(io_data->'}, {'char_start': 543, 'char_end': 547, 'chars': '->ki'}, {'char_start': 548, 'char_end': 550, 'chars': 'fl'}, {'char_start': 551, 'char_end': 552, 'chars': 'g'}, {'char_start': 553, 'char_en...
github.com/torvalds/linux/commit/38740a5b87d53ceb89eb2c970150f6e94e00373a
drivers/usb/gadget/function/f_fs.c
cwe-416
250
cwe-022
_inject_file_into_fs
def _inject_file_into_fs(fs, path, contents): absolute_path = os.path.join(fs, path.lstrip('/')) parent_dir = os.path.dirname(absolute_path) utils.execute('mkdir', '-p', parent_dir, run_as_root=True) utils.execute('tee', absolute_path, process_input=contents, run_as_root=True)
def _inject_file_into_fs(fs, path, contents, append=False): absolute_path = _join_and_check_path_within_fs(fs, path.lstrip('/')) parent_dir = os.path.dirname(absolute_path) utils.execute('mkdir', '-p', parent_dir, run_as_root=True) args = [] if append: args.append('-a') args.append(abs...
{'deleted': [{'line_no': 5, 'char_start': 212, 'char_end': 276, 'line': " utils.execute('tee', absolute_path, process_input=contents,\n"}, {'line_no': 6, 'char_start': 276, 'char_end': 303, 'line': ' run_as_root=True)\n'}], 'added': [{'line_no': 1, 'char_start': 0, 'char_end': 60, 'line': 'def _inject_file_...
{'deleted': [{'char_start': 67, 'char_end': 69, 'chars': 's.'}, {'char_start': 73, 'char_end': 76, 'chars': '.jo'}, {'char_start': 216, 'char_end': 218, 'chars': 'ut'}, {'char_start': 219, 'char_end': 220, 'chars': 'l'}, {'char_start': 222, 'char_end': 224, 'chars': 'ex'}, {'char_start': 225, 'char_end': 229, 'chars': ...
github.com/openstack/nova/commit/2427d4a99bed35baefd8f17ba422cb7aae8dcca7
nova/virt/disk/api.py
cwe-022
74
cwe-787
tcos_decipher
static int tcos_decipher(sc_card_t *card, const u8 * crgram, size_t crgram_len, u8 * out, size_t outlen) { sc_context_t *ctx; sc_apdu_t apdu; u8 rbuf[SC_MAX_APDU_BUFFER_SIZE]; u8 sbuf[SC_MAX_APDU_BUFFER_SIZE]; tcos_data *data; int tcos3, r; assert(card != NULL && crgram != NULL && out != NULL); ctx = card->ctx...
static int tcos_decipher(sc_card_t *card, const u8 * crgram, size_t crgram_len, u8 * out, size_t outlen) { sc_context_t *ctx; sc_apdu_t apdu; u8 rbuf[SC_MAX_APDU_BUFFER_SIZE]; u8 sbuf[SC_MAX_APDU_BUFFER_SIZE]; tcos_data *data; int tcos3, r; assert(card != NULL && crgram != NULL && out != NULL); ctx = card->ctx...
{'deleted': [], 'added': [{'line_no': 28, 'char_start': 852, 'char_end': 887, 'line': '\tif (sizeof sbuf - 1 < crgram_len)\n'}, {'line_no': 29, 'char_start': 887, 'char_end': 924, 'line': '\t\treturn SC_ERROR_INVALID_ARGUMENTS;\n'}]}
{'deleted': [], 'added': [{'char_start': 853, 'char_end': 925, 'chars': 'if (sizeof sbuf - 1 < crgram_len)\n\t\treturn SC_ERROR_INVALID_ARGUMENTS;\n\t'}]}
github.com/OpenSC/OpenSC/commit/9d294de90d1cc66956389856e60b6944b27b4817
src/libopensc/card-tcos.c
cwe-787
553
cwe-022
get
def get(self, path): return static_file(path, self.get_base_path())
def get(self, path): path = self.sanitize_path(path) base_paths = self.get_base_paths() if hasattr(base_paths, 'split'): # String, so go simple base_path = base_paths else: base_path = self.get_first_base(base_paths, path) return static_fil...
{'deleted': [{'line_no': 2, 'char_start': 25, 'char_end': 79, 'line': ' return static_file(path, self.get_base_path())\n'}], 'added': [{'line_no': 2, 'char_start': 25, 'char_end': 65, 'line': ' path = self.sanitize_path(path)\n'}, {'line_no': 3, 'char_start': 65, 'char_end': 108, 'line': ' base_pat...
{'deleted': [{'char_start': 36, 'char_end': 37, 'chars': 'u'}, {'char_start': 44, 'char_end': 49, 'chars': 'ic_fi'}, {'char_start': 51, 'char_end': 52, 'chars': '('}, {'char_start': 56, 'char_end': 57, 'chars': ','}, {'char_start': 77, 'char_end': 78, 'chars': ')'}], 'added': [{'char_start': 33, 'char_end': 76, 'chars'...
github.com/foxbunny/seagull/commit/1fb790712fe0c1d1957b31e34a8e0e6593af87a7
seagull/routes/app.py
cwe-022
18
cwe-125
WriteHDRImage
static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { char header[MagickPathExtent]; const char *property; MagickBooleanType status; register const Quantum *p; register ssize_t i, x; size_t length; ssize_t count...
static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { char header[MagickPathExtent]; const char *property; MagickBooleanType status; register const Quantum *p; register ssize_t i, x; size_t length; ssize_t count...
{'deleted': [{'line_no': 69, 'char_start': 1901, 'char_end': 1984, 'line': ' count=FormatLocaleString(header,MagickPathExtent,"GAMMA=%g\\n",image->gamma);\n'}, {'line_no': 87, 'char_start': 2886, 'char_end': 2952, 'line': ' pixels=(unsigned char *) AcquireQuantumMemory(image->columns,4*\n'}], 'added': [{'line_no'...
{'deleted': [], 'added': [{'char_start': 1969, 'char_end': 1978, 'chars': '\n '}, {'char_start': 2957, 'char_end': 2961, 'chars': '+128'}, {'char_start': 3095, 'char_end': 3172, 'chars': ');\n (void) ResetMagickMemory(pixels,0,4*(image->columns+128)*sizeof(*pixels)'}]}
github.com/ImageMagick/ImageMagick/commit/14e606db148d6ebcaae20f1e1d6d71903ca4a556
coders/hdr.c
cwe-125
1,522
cwe-190
jpc_dec_process_siz
static int jpc_dec_process_siz(jpc_dec_t *dec, jpc_ms_t *ms) { jpc_siz_t *siz = &ms->parms.siz; int compno; int tileno; jpc_dec_tile_t *tile; jpc_dec_tcomp_t *tcomp; int htileno; int vtileno; jpc_dec_cmpt_t *cmpt; dec->xstart = siz->xoff; dec->ystart = siz->yoff; dec->xend = siz->width; dec->yend = siz->he...
static int jpc_dec_process_siz(jpc_dec_t *dec, jpc_ms_t *ms) { jpc_siz_t *siz = &ms->parms.siz; int compno; int tileno; jpc_dec_tile_t *tile; jpc_dec_tcomp_t *tcomp; int htileno; int vtileno; jpc_dec_cmpt_t *cmpt; size_t size; dec->xstart = siz->xoff; dec->ystart = siz->yoff; dec->xend = siz->width; dec->...
{'deleted': [{'line_no': 47, 'char_start': 1312, 'char_end': 1362, 'line': '\tdec->numtiles = dec->numhtiles * dec->numvtiles;\n'}], 'added': [{'line_no': 11, 'char_start': 222, 'char_end': 236, 'line': '\tsize_t size;\n'}, {'line_no': 48, 'char_start': 1326, 'char_end': 1392, 'line': '\tif (!jas_safe_size_mul(dec->num...
{'deleted': [{'char_start': 1326, 'char_end': 1328, 'chars': ' ='}, {'char_start': 1337, 'char_end': 1338, 'chars': 'h'}, {'char_start': 1344, 'char_end': 1345, 'chars': '*'}, {'char_start': 1354, 'char_end': 1355, 'chars': 'v'}], 'added': [{'char_start': 222, 'char_end': 236, 'chars': '\tsize_t size;\n'}, {'char_start...
github.com/mdadams/jasper/commit/d91198abd00fc435a397fe6bad906a4c1748e9cf
src/libjasper/jpc/jpc_dec.c
cwe-190
1,166
cwe-079
__init__
def __init__(self, *args, **kwargs): """ Takes two additional keyword arguments: :param cartpos: The cart position the form should be for :param event: The event this belongs to """ cartpos = self.cartpos = kwargs.pop('cartpos', None) orderpos = self.orderpos...
def __init__(self, *args, **kwargs): """ Takes two additional keyword arguments: :param cartpos: The cart position the form should be for :param event: The event this belongs to """ cartpos = self.cartpos = kwargs.pop('cartpos', None) orderpos = self.orderpos...
{'deleted': [{'line_no': 55, 'char_start': 2264, 'char_end': 2323, 'line': ' label=q.question, required=q.required,\n'}, {'line_no': 61, 'char_start': 2531, 'char_end': 2590, 'line': ' label=q.question, required=q.required,\n'}, {'line_no': 68, 'char_start': 2853, 'char_end': 2912,...
{'deleted': [{'char_start': 1759, 'char_end': 1759, 'chars': ''}, {'char_start': 2290, 'char_end': 2294, 'chars': 'q.qu'}, {'char_start': 2295, 'char_end': 2300, 'chars': 'stion'}, {'char_start': 2557, 'char_end': 2561, 'chars': 'q.qu'}, {'char_start': 2562, 'char_end': 2567, 'chars': 'stion'}, {'char_start': 2879, 'ch...
github.com/pretix/pretix/commit/affc6254a8316643d4afe9e8b7f8cd288c86ca1f
src/pretix/base/forms/questions.py
cwe-079
1,143
cwe-022
handle
def handle(self, keepalive=True, initial_timeout=None): # we are requested to skip processing and keep the previous values if self.skip: return self.response.handle() # default to no keepalive in case something happens while even trying ensure we have a request self.keep...
def handle(self, keepalive=True, initial_timeout=None): # we are requested to skip processing and keep the previous values if self.skip: return self.response.handle() # default to no keepalive in case something happens while even trying ensure we have a request self.keep...
{'deleted': [{'line_no': 53, 'char_start': 1744, 'char_end': 1834, 'line': ' self.method, self.resource, self.request_http = self.request_line.split()\n'}], 'added': [{'line_no': 53, 'char_start': 1744, 'char_end': 1829, 'line': ' self.method, resource, self.request_http = self.request_lin...
{'deleted': [{'char_start': 1773, 'char_end': 1778, 'chars': 'self.'}], 'added': [{'char_start': 1827, 'char_end': 1890, 'chars': ')\n self.resource = urllib.parse.unquote(resource'}]}
github.com/fkmclane/python-fooster-web/commit/80202a6d3788ad1212a162d19785c600025e6aa4
fooster/web/web.py
cwe-022
761
cwe-022
deleteKey
def deleteKey(client): """Deletes the specified key. Returns an error if the key doesn't exist """ global BAD_REQUEST global NOT_FOUND validateClient(client) client_pub_key = loadClientRSAKey(client) token_data = decodeRequestToken(request.data, client_pub_key) if re.search('[^a-zA-Z0-9]', token_data['key']...
def deleteKey(client): """Deletes the specified key. Returns an error if the key doesn't exist """ global NOT_FOUND validateClient(client) client_pub_key = loadClientRSAKey(client) token_data = decodeRequestToken(request.data, client_pub_key) validateKeyName(token_data['key']) try: os.remove('keys/%s/%s.ke...
{'deleted': [{'line_no': 5, 'char_start': 102, 'char_end': 122, 'line': '\tglobal BAD_REQUEST\n'}, {'line_no': 9, 'char_start': 165, 'char_end': 166, 'line': '\n'}, {'line_no': 12, 'char_start': 272, 'char_end': 273, 'line': '\n'}, {'line_no': 13, 'char_start': 273, 'char_end': 323, 'line': "\tif re.search('[^a-zA-Z0-9...
{'deleted': [{'char_start': 110, 'char_end': 130, 'chars': 'BAD_REQUEST\n\tglobal '}, {'char_start': 165, 'char_end': 166, 'chars': '\n'}, {'char_start': 272, 'char_end': 273, 'chars': '\n'}, {'char_start': 275, 'char_end': 278, 'chars': 'f r'}, {'char_start': 279, 'char_end': 281, 'chars': '.s'}, {'char_start': 283, '...
github.com/Mimickal/FoxLock/commit/7c665e556987f4e2c1a75e143a1e80ae066ad833
impl.py
cwe-022
154
cwe-787
enc_untrusted_create_wait_queue
int32_t *enc_untrusted_create_wait_queue() { MessageWriter input; MessageReader output; input.Push<uint64_t>(sizeof(int32_t)); const auto status = NonSystemCallDispatcher( ::asylo::host_call::kLocalLifetimeAllocHandler, &input, &output); CheckStatusAndParamCount(status, output, "enc_untrusted_create_wai...
int32_t *enc_untrusted_create_wait_queue() { MessageWriter input; MessageReader output; input.Push<uint64_t>(sizeof(int32_t)); const auto status = NonSystemCallDispatcher( ::asylo::host_call::kLocalLifetimeAllocHandler, &input, &output); CheckStatusAndParamCount(status, output, "enc_untrusted_create_wai...
{'deleted': [], 'added': [{'line_no': 10, 'char_start': 435, 'char_end': 505, 'line': ' if (!TrustedPrimitives::IsOutsideEnclave(queue, sizeof(int32_t))) {\n'}, {'line_no': 11, 'char_start': 505, 'char_end': 545, 'line': ' TrustedPrimitives::BestEffortAbort(\n'}, {'line_no': 12, 'char_start': 545, 'char_end': 626, ...
{'deleted': [], 'added': [{'char_start': 438, 'char_end': 633, 'chars': 'f (!TrustedPrimitives::IsOutsideEnclave(queue, sizeof(int32_t))) {\n TrustedPrimitives::BestEffortAbort(\n "enc_untrusted_create_wait_queue: queue should be in untrusted memory");\n }\n i'}]}
github.com/google/asylo/commit/a37fb6a0e7daf30134dbbf357c9a518a1026aa02
asylo/platform/host_call/trusted/concurrency.cc
cwe-787
155
cwe-476
CompileKeymap
CompileKeymap(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge) { bool ok; XkbFile *files[LAST_KEYMAP_FILE_TYPE + 1] = { NULL }; enum xkb_file_type type; struct xkb_context *ctx = keymap->ctx; /* Collect section files and check for duplicates. */ for (file = (XkbFile *) file->def...
CompileKeymap(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge) { bool ok; XkbFile *files[LAST_KEYMAP_FILE_TYPE + 1] = { NULL }; enum xkb_file_type type; struct xkb_context *ctx = keymap->ctx; /* Collect section files and check for duplicates. */ for (file = (XkbFile *) file->def...
{'deleted': [{'line_no': 13, 'char_start': 489, 'char_end': 553, 'line': ' log_err(ctx, "Cannot define %s in a keymap file\\n",\n'}, {'line_no': 14, 'char_start': 553, 'char_end': 616, 'line': ' xkb_file_type_to_string(file->file_type));\n'}], 'added': [{'line_no': 13, 'char_start': 489, '...
{'deleted': [], 'added': [{'char_start': 501, 'char_end': 691, 'chars': 'if (file->file_type == FILE_TYPE_GEOMETRY) {\n log_vrb(ctx, 1,\n "Geometry sections are not supported; ignoring\\n");\n } else {\n '}, {'char_start': 763, 'char_end': 767, 'chars': ' ...
github.com/xkbcommon/libxkbcommon/commit/917636b1d0d70205a13f89062b95e3a0fc31d4ff
src/xkbcomp/keymap.c
cwe-476
465
cwe-022
TarFileReader::extract
std::string TarFileReader::extract(const string &_path) { if (_path.empty()) THROW("path cannot be empty"); if (!hasMore()) THROW("No more tar files"); string path = _path; if (SystemUtilities::isDirectory(path)) path += "/" + getFilename(); LOG_DEBUG(5, "Extracting: " << path); return extract(*SystemUti...
std::string TarFileReader::extract(const string &_path) { if (_path.empty()) THROW("path cannot be empty"); if (!hasMore()) THROW("No more tar files"); string path = _path; if (SystemUtilities::isDirectory(path)) { path += "/" + getFilename(); // Check that path is under the target directory strin...
{'deleted': [{'line_no': 6, 'char_start': 180, 'char_end': 251, 'line': ' if (SystemUtilities::isDirectory(path)) path += "/" + getFilename();\n'}, {'line_no': 10, 'char_start': 293, 'char_end': 342, 'line': ' return extract(*SystemUtilities::oopen(path));\n'}], 'added': [{'line_no': 6, 'char_start': 180, 'char_end':...
{'deleted': [], 'added': [{'char_start': 222, 'char_end': 228, 'chars': '{\n '}, {'char_start': 260, 'char_end': 544, 'chars': ' // Check that path is under the target directory\n string a = SystemUtilities::getCanonicalPath(_path);\n string b = SystemUtilities::getCanonicalPath(path);\n if (!String::start...
github.com/CauldronDevelopmentLLC/cbang/commit/1c1dba62bd3e6fa9d0d0c0aa21926043b75382c7
src/cbang/tar/TarFileReader.cpp
cwe-022
90
cwe-125
security_fips_decrypt
BOOL security_fips_decrypt(BYTE* data, size_t length, rdpRdp* rdp) { size_t olen; if (!winpr_Cipher_Update(rdp->fips_decrypt, data, length, data, &olen)) return FALSE; return TRUE; }
BOOL security_fips_decrypt(BYTE* data, size_t length, rdpRdp* rdp) { size_t olen; if (!rdp || !rdp->fips_decrypt) return FALSE; if (!winpr_Cipher_Update(rdp->fips_decrypt, data, length, data, &olen)) return FALSE; return TRUE; }
{'deleted': [], 'added': [{'line_no': 5, 'char_start': 84, 'char_end': 117, 'line': '\tif (!rdp || !rdp->fips_decrypt)\n'}, {'line_no': 6, 'char_start': 117, 'char_end': 133, 'line': '\t\treturn FALSE;\n'}, {'line_no': 7, 'char_start': 133, 'char_end': 134, 'line': '\n'}]}
{'deleted': [], 'added': [{'char_start': 90, 'char_end': 140, 'chars': 'rdp || !rdp->fips_decrypt)\n\t\treturn FALSE;\n\n\tif (!'}]}
github.com/FreeRDP/FreeRDP/commit/d6cd14059b257318f176c0ba3ee0a348826a9ef8
libfreerdp/core/security.c
cwe-125
59
cwe-125
cx24116_send_diseqc_msg
static int cx24116_send_diseqc_msg(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd *d) { struct cx24116_state *state = fe->demodulator_priv; int i, ret; /* Dump DiSEqC message */ if (debug) { printk(KERN_INFO "cx24116: %s(", __func__); for (i = 0 ; i < d->msg_len ;) { printk(KERN_INFO "0x%02x", d->ms...
static int cx24116_send_diseqc_msg(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd *d) { struct cx24116_state *state = fe->demodulator_priv; int i, ret; /* Validate length */ if (d->msg_len > sizeof(d->msg)) return -EINVAL; /* Dump DiSEqC message */ if (debug) { printk(KERN_INFO "cx2411...
{'deleted': [{'line_no': 18, 'char_start': 429, 'char_end': 452, 'line': '\t/* Validate length */\n'}, {'line_no': 19, 'char_start': 452, 'char_end': 512, 'line': '\tif (d->msg_len > (CX24116_ARGLEN - CX24116_DISEQC_MSGOFS))\n'}, {'line_no': 20, 'char_start': 512, 'char_end': 530, 'line': '\t\treturn -EINVAL;\n'}, {'li...
{'deleted': [{'char_start': 427, 'char_end': 529, 'chars': '\n\n\t/* Validate length */\n\tif (d->msg_len > (CX24116_ARGLEN - CX24116_DISEQC_MSGOFS))\n\t\treturn -EINVAL;'}], 'added': [{'char_start': 167, 'char_end': 257, 'chars': 'Validate length */\n\tif (d->msg_len > sizeof(d->msg))\n return -EINVAL;\...
github.com/torvalds/linux/commit/1fa2337a315a2448c5434f41e00d56b01a22283c
drivers/media/dvb-frontends/cx24116.c
cwe-125
996
cwe-089
view_page_history
@app.route('/<page_name>/history') def view_page_history(page_name): query = db.query("select page_content.timestamp, page_content.id from page, page_content where page.id = page_content.page_id and page.page_name = '%s'" % page_name) page_histories = query.namedresult() return render_template( 'pa...
@app.route('/<page_name>/history') def view_page_history(page_name): query = db.query("select page_content.timestamp, page_content.id from page, page_content where page.id = page_content.page_id and page.page_name = $1", page_name) page_histories = query.namedresult() return render_template( 'page_...
{'deleted': [{'line_no': 3, 'char_start': 69, 'char_end': 239, 'line': ' query = db.query("select page_content.timestamp, page_content.id from page, page_content where page.id = page_content.page_id and page.page_name = \'%s\'" % page_name)\n'}], 'added': [{'line_no': 3, 'char_start': 69, 'char_end': 236, 'line': ' ...
{'deleted': [{'char_start': 220, 'char_end': 224, 'chars': "'%s'"}, {'char_start': 225, 'char_end': 227, 'chars': ' %'}], 'added': [{'char_start': 220, 'char_end': 222, 'chars': '$1'}, {'char_start': 223, 'char_end': 224, 'chars': ','}]}
github.com/Pumala/python_wiki_app_redo/commit/65d60747cd8efb05970304234d3bd949d2088e8b
server.py
cwe-089
93
cwe-476
ResolveStateAndPredicate
ResolveStateAndPredicate(ExprDef *expr, enum xkb_match_operation *pred_rtrn, xkb_mod_mask_t *mods_rtrn, CompatInfo *info) { if (expr == NULL) { *pred_rtrn = MATCH_ANY_OR_NONE; *mods_rtrn = MOD_REAL_MASK_ALL; return true; } *pred_rtrn = MATCH_EXACTLY; if ...
ResolveStateAndPredicate(ExprDef *expr, enum xkb_match_operation *pred_rtrn, xkb_mod_mask_t *mods_rtrn, CompatInfo *info) { if (expr == NULL) { *pred_rtrn = MATCH_ANY_OR_NONE; *mods_rtrn = MOD_REAL_MASK_ALL; return true; } *pred_rtrn = MATCH_EXACTLY; if ...
{'deleted': [{'line_no': 13, 'char_start': 434, 'char_end': 512, 'line': ' if (!LookupString(symInterpretMatchMaskNames, pred_txt, pred_rtrn)) {\n'}], 'added': [{'line_no': 13, 'char_start': 434, 'char_end': 512, 'line': ' if (!LookupString(symInterpretMatchMaskNames, pred_txt, pred_rtrn) ||\n'}, {'line_n...
{'deleted': [], 'added': [{'char_start': 508, 'char_end': 542, 'chars': ' ||\n !expr->action.args'}]}
github.com/xkbcommon/libxkbcommon/commit/96df3106d49438e442510c59acad306e94f3db4d
src/xkbcomp/compat.c
cwe-476
290
cwe-089
fetch_page_name
def fetch_page_name(self, page_id): ''' Returns the page name corresponding to the provided page ID. Args: page_id: The page ID whose ID to fetch. Returns: str: The page name corresponding to the provided page ID. Raises: ValueError: If the provided page ID is invalid or does ...
def fetch_page_name(self, page_id): ''' Returns the page name corresponding to the provided page ID. Args: page_id: The page ID whose ID to fetch. Returns: str: The page name corresponding to the provided page ID. Raises: ValueError: If the provided page ID is invalid or does ...
{'deleted': [{'line_no': 16, 'char_start': 378, 'char_end': 446, 'line': ' query = \'SELECT name FROM pages WHERE id="{0}"\'.format(page_id)\n'}, {'line_no': 17, 'char_start': 446, 'char_end': 477, 'line': ' self.cursor.execute(query)\n'}], 'added': [{'line_no': 16, 'char_start': 378, 'char_end': 429, 'line': " ...
{'deleted': [{'char_start': 423, 'char_end': 428, 'chars': '"{0}"'}, {'char_start': 429, 'char_end': 432, 'chars': '.fo'}, {'char_start': 433, 'char_end': 436, 'chars': 'mat'}], 'added': [{'char_start': 422, 'char_end': 423, 'chars': ' '}, {'char_start': 424, 'char_end': 427, 'chars': ' ?;'}, {'char_start': 428, 'char_...
github.com/jwngr/sdow/commit/4db98f3521592f17550d2b723336f33fec5e112a
sdow/database.py
cwe-089
160
cwe-078
_call_prepare_fc_map
def _call_prepare_fc_map(self, fc_map_id, source, target): try: out, err = self._run_ssh('svctask prestartfcmap %s' % fc_map_id) except exception.ProcessExecutionError as e: with excutils.save_and_reraise_exception(): LOG.error(_('_prepare_fc_map: Failed to pr...
def _call_prepare_fc_map(self, fc_map_id, source, target): try: out, err = self._run_ssh(['svctask', 'prestartfcmap', fc_map_id]) except exception.ProcessExecutionError as e: with excutils.save_and_reraise_exception(): LOG.error(_('_prepare_fc_map: Failed to p...
{'deleted': [{'line_no': 3, 'char_start': 76, 'char_end': 153, 'line': " out, err = self._run_ssh('svctask prestartfcmap %s' % fc_map_id)\n"}], 'added': [{'line_no': 3, 'char_start': 76, 'char_end': 154, 'line': " out, err = self._run_ssh(['svctask', 'prestartfcmap', fc_map_id])\n"}]}
{'deleted': [{'char_start': 135, 'char_end': 138, 'chars': ' %s'}, {'char_start': 139, 'char_end': 141, 'chars': ' %'}], 'added': [{'char_start': 113, 'char_end': 114, 'chars': '['}, {'char_start': 122, 'char_end': 124, 'chars': "',"}, {'char_start': 125, 'char_end': 126, 'chars': "'"}, {'char_start': 140, 'char_end': ...
github.com/thatsdone/cinder/commit/f752302d181583a95cf44354aea607ce9d9283f4
cinder/volume/drivers/storwize_svc.py
cwe-078
134
cwe-089
get_top_popular
def get_top_popular(top_num): """ query the top(top_num) popular articles top_num => list of [title, count] """ cmd = """SELECT title, views FROM articles INNER JOIN ( SELECT path, count(path) AS views FROM log GROUP BY log.path ) AS log ...
def get_top_popular(top_num): """ query the top(top_num) popular articles top_num => list of [title, count] """ cmd = """SELECT title, views FROM articles INNER JOIN ( SELECT path, count(path) AS views FROM log GROUP BY log.path ) AS log ...
{'deleted': [{'line_no': 12, 'char_start': 410, 'char_end': 452, 'line': ' LIMIT {}""".format(top_num)\r\n'}, {'line_no': 13, 'char_start': 452, 'char_end': 481, 'line': ' return execute_query(cmd)\r\n'}], 'added': [{'line_no': 12, 'char_start': 410, 'char_end': 436, 'line': ' LIMIT %s"""\r\n...
{'deleted': [{'char_start': 429, 'char_end': 431, 'chars': '{}'}, {'char_start': 434, 'char_end': 439, 'chars': '.form'}, {'char_start': 441, 'char_end': 442, 'chars': '('}, {'char_start': 449, 'char_end': 450, 'chars': ')'}], 'added': [{'char_start': 429, 'char_end': 431, 'chars': '%s'}, {'char_start': 434, 'char_end'...
github.com/thugasin/udacity-homework-logAnalyzer/commit/506f25f9a1caee7f17034adf7c75e0efbc88082b
logAnalyzerDb.py
cwe-089
102
cwe-125
MAPIPrint
void MAPIPrint(MAPIProps *p) { int j, i, index, h, x; DDWORD *ddword_ptr; DDWORD ddword_tmp; dtr thedate; MAPIProperty *mapi; variableLength *mapidata; variableLength vlTemp; int found; for (j = 0; j < p->count; j++) { mapi = &(p->properties[j]); printf(" #%i: Type: [", j); switch (PROP...
void MAPIPrint(MAPIProps *p) { int j, i, index, h, x; DDWORD *ddword_ptr; DDWORD ddword_tmp; dtr thedate; MAPIProperty *mapi; variableLength *mapidata; variableLength vlTemp; int found; for (j = 0; j < p->count; j++) { mapi = &(p->properties[j]); printf(" #%i: Type: [", j); switch (PROP...
{'deleted': [{'line_no': 95, 'char_start': 2731, 'char_end': 2795, 'line': ' printf(" Value: %li\\n", *((long*)mapidata->data));\n'}], 'added': [{'line_no': 95, 'char_start': 2731, 'char_end': 2793, 'line': ' printf(" Value: %i\\n", *((int*)mapidata->data));\n'}]}
{'deleted': [{'char_start': 2761, 'char_end': 2762, 'chars': 'l'}, {'char_start': 2771, 'char_end': 2773, 'chars': 'lo'}, {'char_start': 2774, 'char_end': 2775, 'chars': 'g'}], 'added': [{'char_start': 2770, 'char_end': 2771, 'chars': 'i'}, {'char_start': 2772, 'char_end': 2773, 'chars': 't'}]}
github.com/Yeraze/ytnef/commit/f98f5d4adc1c4bd4033638f6167c1bb95d642f89
lib/ytnef.c
cwe-125
1,306
cwe-089
delete
@jwt_required def delete(self, user_id): """ Deletes user with the corresponding user_id """ return database_utilities.execute_query(f"""delete from users where user_id = '{user_id}'""")
@jwt_required def delete(self, user_id): """ Deletes user with the corresponding user_id """ return database_utilities.execute_query(f"""delete from users where user_id = %s""", (user_id, ))
{'deleted': [{'line_no': 4, 'char_start': 109, 'char_end': 210, 'line': ' return database_utilities.execute_query(f"""delete from users where user_id = \'{user_id}\'""")\n'}], 'added': [{'line_no': 4, 'char_start': 109, 'char_end': 214, 'line': ' return database_utilities.execute_query(f"""delete from use...
{'deleted': [{'char_start': 195, 'char_end': 197, 'chars': "'{"}, {'char_start': 204, 'char_end': 209, 'chars': '}\'"""'}], 'added': [{'char_start': 195, 'char_end': 203, 'chars': '%s""", ('}, {'char_start': 210, 'char_end': 213, 'chars': ', )'}]}
github.com/sgosal2/tiger-boards-backend/commit/4670109dd613df2f2fe7e8403ebd149df2b55485
apis/users.py
cwe-089
44
cwe-022
pascal_case
def pascal_case(value: str) -> str: return stringcase.pascalcase(value)
def pascal_case(value: str) -> str: return stringcase.pascalcase(_sanitize(value))
{'deleted': [{'line_no': 2, 'char_start': 36, 'char_end': 75, 'line': ' return stringcase.pascalcase(value)\n'}], 'added': [{'line_no': 2, 'char_start': 36, 'char_end': 86, 'line': ' return stringcase.pascalcase(_sanitize(value))\n'}]}
{'deleted': [], 'added': [{'char_start': 69, 'char_end': 79, 'chars': '_sanitize('}, {'char_start': 85, 'char_end': 86, 'chars': ')'}]}
github.com/openapi-generators/openapi-python-client/commit/3e7dfae5d0b3685abf1ede1bc6c086a116ac4746
openapi_python_client/utils.py
cwe-022
20
cwe-476
acc_ctx_cont
acc_ctx_cont(OM_uint32 *minstat, gss_buffer_t buf, gss_ctx_id_t *ctx, gss_buffer_t *responseToken, gss_buffer_t *mechListMIC, OM_uint32 *negState, send_token_flag *return_token) { OM_uint32 ret, tmpmin; gss_OID supportedMech; spnego_gss_ctx_id_t sc; unsigned int len; unsigned ch...
acc_ctx_cont(OM_uint32 *minstat, gss_buffer_t buf, gss_ctx_id_t *ctx, gss_buffer_t *responseToken, gss_buffer_t *mechListMIC, OM_uint32 *negState, send_token_flag *return_token) { OM_uint32 ret, tmpmin; gss_OID supportedMech; spnego_gss_ctx_id_t sc; unsigned int len; unsigned ch...
{'deleted': [{'line_no': 25, 'char_start': 635, 'char_end': 658, 'line': '\tif (REMAIN > INT_MAX)\n'}], 'added': [{'line_no': 25, 'char_start': 635, 'char_end': 673, 'line': '\tif (REMAIN == 0 || REMAIN > INT_MAX)\n'}]}
{'deleted': [], 'added': [{'char_start': 647, 'char_end': 662, 'chars': '== 0 || REMAIN '}]}
github.com/krb5/krb5/commit/524688ce87a15fc75f87efc8c039ba4c7d5c197b
src/lib/gssapi/spnego/spnego_mech.c
cwe-476
506
cwe-089
add_input
def add_input(self,data): connection = self.connect() try: # The following is a flaw query = "INSERT INTO crimes(description) VALUES ('{}');".format(data) with connection.cursor() as cursor: cursor.execute(query) connection.commit()...
def add_input(self,data): connection = self.connect() try: # The following is a flaw query = "INSERT INTO crimes(description) VALUES (%s);" with connection.cursor() as cursor: cursor.execute(query, data) connection.commit() ...
{'deleted': [{'line_no': 5, 'char_start': 117, 'char_end': 199, 'line': ' query = "INSERT INTO crimes(description) VALUES (\'{}\');".format(data)\n'}, {'line_no': 7, 'char_start': 247, 'char_end': 285, 'line': ' cursor.execute(query)\n'}], 'added': [{'line_no': 5, 'char_start': 117, 'char_end'...
{'deleted': [{'char_start': 178, 'char_end': 182, 'chars': "'{}'"}, {'char_start': 185, 'char_end': 198, 'chars': '.format(data)'}], 'added': [{'char_start': 178, 'char_end': 180, 'chars': '%s'}, {'char_start': 268, 'char_end': 274, 'chars': ', data'}]}
github.com/amrishc/crimemap/commit/51b3d51aa031d7c285295de36f5464d43debf6de
dbhelper.py
cwe-089
65
cwe-022
_inject_key_into_fs
def _inject_key_into_fs(key, fs, execute=None): """Add the given public ssh key to root's authorized_keys. key is an ssh key string. fs is the path to the base of the filesystem into which to inject the key. """ sshdir = os.path.join(fs, 'root', '.ssh') utils.execute('mkdir', '-p', sshdir, run_...
def _inject_key_into_fs(key, fs, execute=None): """Add the given public ssh key to root's authorized_keys. key is an ssh key string. fs is the path to the base of the filesystem into which to inject the key. """ sshdir = _join_and_check_path_within_fs(fs, 'root', '.ssh') utils.execute('mkdir', ...
{'deleted': [{'line_no': 7, 'char_start': 229, 'char_end': 275, 'line': " sshdir = os.path.join(fs, 'root', '.ssh')\n"}, {'line_no': 11, 'char_start': 455, 'char_end': 509, 'line': " keyfile = os.path.join(sshdir, 'authorized_keys')\n"}, {'line_no': 12, 'char_start': 509, 'char_end': 526, 'line': ' key_data = ...
{'deleted': [{'char_start': 243, 'char_end': 245, 'chars': 's.'}, {'char_start': 249, 'char_end': 252, 'chars': '.jo'}, {'char_start': 485, 'char_end': 488, 'chars': 'dir'}, {'char_start': 655, 'char_end': 656, 'chars': 'u'}, {'char_start': 659, 'char_end': 663, 'chars': 's.ex'}, {'char_start': 664, 'char_end': 666, 'c...
github.com/openstack/nova/commit/2427d4a99bed35baefd8f17ba422cb7aae8dcca7
nova/virt/disk/api.py
cwe-022
199
cwe-089
process_ranks
def process_ranks(self, scene, urls, recent_date): PLAYER1 = 0 PLAYER2 = 1 WINNER = 2 DATE = 3 SCENE = 4 # make sure if we already have calculated ranks for these players at this time, we do not do it again sql = "SELECT * FROM ranks WHERE scene = '{}' AND da...
def process_ranks(self, scene, urls, recent_date): PLAYER1 = 0 PLAYER2 = 1 WINNER = 2 DATE = 3 SCENE = 4 # make sure if we already have calculated ranks for these players at this time, we do not do it again sql = "SELECT * FROM ranks WHERE scene = '{scene}' A...
{'deleted': [{'line_no': 9, 'char_start': 260, 'char_end': 362, 'line': ' sql = "SELECT * FROM ranks WHERE scene = \'{}\' AND date=\'{}\';".format(str(scene), recent_date)\n'}, {'line_no': 10, 'char_start': 362, 'char_end': 394, 'line': ' res = self.db.exec(sql)\n'}, {'line_no': 52, 'char_start': 1725, 'c...
{'deleted': [{'char_start': 329, 'char_end': 334, 'chars': '.form'}, {'char_start': 335, 'char_end': 339, 'chars': 't(st'}, {'char_start': 340, 'char_end': 341, 'chars': '('}, {'char_start': 346, 'char_end': 347, 'chars': ')'}, {'char_start': 360, 'char_end': 361, 'chars': ')'}, {'char_start': 1837, 'char_end': 1838, '...
github.com/DKelle/Smash_stats/commit/4bb83f3f6ce7d6bebbeb512cd015f9e72cf36d63
process_data.py
cwe-089
594
cwe-089
makeJudge
def makeJudge(judge): db.execute("UPDATE players SET Judge = 1 WHERE Name = '%s' COLLATE NOCASE" % (judge)) database.commit()
def makeJudge(judge): db.execute("UPDATE players SET Judge = 1 WHERE Name = ? COLLATE NOCASE", judge) database.commit()
{'deleted': [{'line_no': 2, 'char_start': 22, 'char_end': 110, 'line': '\tdb.execute("UPDATE players SET Judge = 1 WHERE Name = \'%s\' COLLATE NOCASE" % (judge)) \n'}], 'added': [{'line_no': 2, 'char_start': 22, 'char_end': 104, 'line': '\tdb.execute("UPDATE players SET Judge = 1 WHERE Name = ? COLLATE NOCASE", judge) ...
{'deleted': [{'char_start': 77, 'char_end': 81, 'chars': "'%s'"}, {'char_start': 97, 'char_end': 99, 'chars': ' %'}, {'char_start': 100, 'char_end': 101, 'chars': '('}, {'char_start': 106, 'char_end': 107, 'chars': ')'}], 'added': [{'char_start': 77, 'char_end': 78, 'chars': '?'}, {'char_start': 94, 'char_end': 95, 'ch...
github.com/iScrE4m/XLeague/commit/59cab6e5fd8bd5e47f2418a7c71cb1d4e3cad0d2
plugins/database.py
cwe-089
36
cwe-022
wiki_handle_rest_call
wiki_handle_rest_call(HttpRequest *req, HttpResponse *res, char *func) { if (func != NULL && *func != '\0') { if (!strcmp(func, "page/get")) { char *page = http_request_param_get(req, "page"); if (page == NULL) page = http_request_get_query_string(req); if (page &...
wiki_handle_rest_call(HttpRequest *req, HttpResponse *res, char *func) { if (func != NULL && *func != '\0') { if (!strcmp(func, "page/get")) { char *page = http_request_param_get(req, "page"); if (page == NULL) page = http_request_get_query_string(req); if (page &...
{'deleted': [{'line_no': 15, 'char_start': 307, 'char_end': 350, 'line': '\t if (page && (access(page, R_OK) == 0)) \n'}, {'line_no': 28, 'char_start': 699, 'char_end': 741, 'line': '\t file_write(page, wikitext);\t \n'}, {'line_no': 41, 'char_start': 1015, 'char_end': 1050, 'line': '\t if (page && (unlink(...
{'deleted': [{'char_start': 348, 'char_end': 349, 'chars': ' '}, {'char_start': 733, 'char_end': 740, 'chars': '\t '}, {'char_start': 1374, 'char_end': 1375, 'chars': ' '}], 'added': [{'char_start': 322, 'char_end': 349, 'chars': 'page_name_is_good(page) && '}, {'char_start': 725, 'char_end': 764, 'chars': '\t if...
github.com/yarolig/didiwiki/commit/5e5c796617e1712905dc5462b94bd5e6c08d15ea
src/wiki.c
cwe-022
641
cwe-079
is_safe_url
def is_safe_url(url, host=None): """ Return ``True`` if the url is a safe redirection (i.e. it doesn't point to a different host and uses a safe scheme). Always returns ``False`` on an empty url. """ if url is not None: url = url.strip() if not url: return False # Chrome...
def is_safe_url(url, host=None): """ Return ``True`` if the url is a safe redirection (i.e. it doesn't point to a different host and uses a safe scheme). Always returns ``False`` on an empty url. """ if url is not None: url = url.strip() if not url: return False # Chrome...
{'deleted': [{'line_no': 13, 'char_start': 346, 'char_end': 379, 'line': " url = url.replace('\\\\', '/')\n"}], 'added': [{'line_no': 14, 'char_start': 444, 'char_end': 525, 'line': " return _is_safe_url(url, host) and _is_safe_url(url.replace('\\\\', '/'), host)\n"}]}
{'deleted': [{'char_start': 345, 'char_end': 346, 'chars': '\n'}, {'char_start': 347, 'char_end': 396, 'chars': " url = url.replace('\\\\', '/')\n # Chrome cons"}, {'char_start': 397, 'char_end': 403, 'chars': 'ders a'}, {'char_start': 404, 'char_end': 405, 'chars': 'y'}, {'char_start': 406, 'char_end': 422, 'char...
github.com/django/django/commit/c5544d289233f501917e25970c03ed444abbd4f0
django/utils/http.py
cwe-079
325
cwe-089
get_mod_taken_together_with
def get_mod_taken_together_with(code): ''' Retrieves the list of modules taken together with the specified module code in the same semester. Returns a table of lists (up to 10 top results). Each list contains (specified code, module code of mod taken together, aySem, number of stude...
def get_mod_taken_together_with(code): ''' Retrieves the list of modules taken together with the specified module code in the same semester. Returns a table of lists (up to 10 top results). Each list contains (specified code, module code of mod taken together, aySem, number of stude...
{'deleted': [{'line_no': 16, 'char_start': 665, 'char_end': 730, 'line': ' "WHERE sp1.moduleCode = \'" + code + "\' AND " + \\\n'}, {'line_no': 23, 'char_start': 1035, 'char_end': 1070, 'line': ' DB_CURSOR.execute(sql_command)\n'}], 'added': [{'line_no': 16, 'char_start': 665, 'char_end': 718, 'line':...
{'deleted': [{'char_start': 705, 'char_end': 719, 'chars': '\'" + code + "\''}], 'added': [{'char_start': 705, 'char_end': 707, 'chars': '%s'}, {'char_start': 1056, 'char_end': 1065, 'chars': ', (code,)'}]}
github.com/nus-mtp/cs-modify/commit/79b4b1dd7eba5445751808e4c50b49d2dd08366b
components/model.py
cwe-089
310
cwe-787
sc_oberthur_read_file
sc_oberthur_read_file(struct sc_pkcs15_card *p15card, const char *in_path, unsigned char **out, size_t *out_len, int verify_pin) { struct sc_context *ctx = p15card->card->ctx; struct sc_card *card = p15card->card; struct sc_file *file = NULL; struct sc_path path; size_t sz; int rv; LOG_FUNC_CALLED(ctx); if...
sc_oberthur_read_file(struct sc_pkcs15_card *p15card, const char *in_path, unsigned char **out, size_t *out_len, int verify_pin) { struct sc_context *ctx = p15card->card->ctx; struct sc_card *card = p15card->card; struct sc_file *file = NULL; struct sc_path path; size_t sz; int rv; LOG_FUNC_CALLED(ctx); if...
{'deleted': [{'line_no': 43, 'char_start': 1107, 'char_end': 1118, 'line': '\t\tint rec;\n'}, {'line_no': 44, 'char_start': 1118, 'char_end': 1134, 'line': '\t\tint offs = 0;\n'}, {'line_no': 45, 'char_start': 1134, 'char_end': 1171, 'line': '\t\tint rec_len = file->record_length;\n'}], 'added': [{'line_no': 43, 'char_...
{'deleted': [{'char_start': 1110, 'char_end': 1111, 'chars': 'n'}, {'char_start': 1121, 'char_end': 1122, 'chars': 'n'}, {'char_start': 1137, 'char_end': 1138, 'chars': 'n'}], 'added': [{'char_start': 1109, 'char_end': 1110, 'chars': 's'}, {'char_start': 1111, 'char_end': 1114, 'chars': 'ze_'}, {'char_start': 1123, 'ch...
github.com/OpenSC/OpenSC/commit/6903aebfddc466d966c7b865fae34572bf3ed23e
src/libopensc/pkcs15-oberthur.c
cwe-787
937
cwe-089
add_language
def add_language(self, language): """"Add new language for item translations.""" if self.connection: self.cursor.execute('insert into itemlanguage (language) values ("%s")' % language[0]) self.connection.commit()
def add_language(self, language): """"Add new language for item translations.""" if self.connection: t = (language[0], ) self.cursor.execute('insert into itemlanguage (language) values (?)', t) self.connection.commit()
{'deleted': [{'line_no': 4, 'char_start': 121, 'char_end': 220, 'line': ' self.cursor.execute(\'insert into itemlanguage (language) values ("%s")\' % language[0])\n'}], 'added': [{'line_no': 4, 'char_start': 121, 'char_end': 153, 'line': ' t = (language[0], )\n'}, {'line_no': 5, 'char_start': 153,...
{'deleted': [{'char_start': 198, 'char_end': 202, 'chars': '"%s"'}, {'char_start': 204, 'char_end': 206, 'chars': ' %'}, {'char_start': 207, 'char_end': 218, 'chars': 'language[0]'}], 'added': [{'char_start': 133, 'char_end': 165, 'chars': 't = (language[0], )\n '}, {'char_start': 230, 'char_end': 231, 'char...
github.com/ecosl-developers/ecosl/commit/8af050a513338bf68ff2a243e4a2482d24e9aa3a
ecosldb/ecosldb.py
cwe-089
50
cwe-089
_add_to_db
@staticmethod def _add_to_db(user): """ Adds User object to the database :param user: User object with info about user :return: None """ query = ("INSERT INTO users (chat_id, first_name, nickname, " "last_name, language) " f"VALUE...
@staticmethod def _add_to_db(user): """ Adds User object to the database :param user: User object with info about user :return: None """ query = ("INSERT INTO users (chat_id, first_name, nickname, " "last_name, language) " f"VALUE...
{'deleted': [{'line_no': 10, 'char_start': 296, 'char_end': 362, 'line': ' f"VALUES ({user.chat_id}, \'{user.first_name}\', "\n'}, {'line_no': 11, 'char_start': 362, 'char_end': 441, 'line': ' f"\'{user.nickname}\', \'{user.last_name}\', \'{user.language}\')")\n'}, {'line_no': 13, 'char_...
{'deleted': [{'char_start': 323, 'char_end': 324, 'chars': '{'}, {'char_start': 336, 'char_end': 337, 'chars': '}'}, {'char_start': 339, 'char_end': 341, 'chars': "'{"}, {'char_start': 356, 'char_end': 358, 'chars': "}'"}, {'char_start': 360, 'char_end': 361, 'chars': '"'}, {'char_start': 379, 'char_end': 399, 'chars':...
github.com/RandyRomero/photoGPSbot/commit/0e9f57f13e61863b3672f5730e27f149da00786a
photogpsbot/users.py
cwe-089
143
cwe-079
PropertiesWidget::loadTorrentInfos
void PropertiesWidget::loadTorrentInfos(BitTorrent::TorrentHandle *const torrent) { clear(); m_torrent = torrent; downloaded_pieces->setTorrent(m_torrent); pieces_availability->setTorrent(m_torrent); if (!m_torrent) return; // Save path updateSavePath(m_torrent); // Hash hash_lbl->s...
void PropertiesWidget::loadTorrentInfos(BitTorrent::TorrentHandle *const torrent) { clear(); m_torrent = torrent; downloaded_pieces->setTorrent(m_torrent); pieces_availability->setTorrent(m_torrent); if (!m_torrent) return; // Save path updateSavePath(m_torrent); // Hash hash_lbl->s...
{'deleted': [{'line_no': 21, 'char_start': 655, 'char_end': 737, 'line': ' comment_text->setText(Utils::Misc::parseHtmlLinks(m_torrent->comment()));\n'}, {'line_no': 26, 'char_start': 784, 'char_end': 845, 'line': ' label_created_by_val->setText(m_torrent->creator());\n'}], 'added': [{'line_no': 21, 'char...
{'deleted': [], 'added': [{'char_start': 713, 'char_end': 742, 'chars': 'Utils::String::toHtmlEscaped('}, {'char_start': 761, 'char_end': 762, 'chars': ')'}, {'char_start': 852, 'char_end': 881, 'chars': 'Utils::String::toHtmlEscaped('}, {'char_start': 900, 'char_end': 901, 'chars': ')'}]}
github.com/qbittorrent/qBittorrent/commit/6ca3e4f094da0a0017cb2d483ec1db6176bb0b16
src/gui/properties/propertieswidget.cpp
cwe-079
275
cwe-476
validate_as_request
validate_as_request(kdc_realm_t *kdc_active_realm, register krb5_kdc_req *request, krb5_db_entry client, krb5_db_entry server, krb5_timestamp kdc_time, const char **status, krb5_pa_data ***e_data) { int errcode; krb5_error_code ret; /* * If a...
validate_as_request(kdc_realm_t *kdc_active_realm, register krb5_kdc_req *request, krb5_db_entry client, krb5_db_entry server, krb5_timestamp kdc_time, const char **status, krb5_pa_data ***e_data) { int errcode; krb5_error_code ret; /* * If a...
{'deleted': [{'line_no': 103, 'char_start': 3679, 'char_end': 3758, 'line': ' if (check_anon(kdc_active_realm, request->client, request->server) != 0) {\n'}], 'added': [{'line_no': 103, 'char_start': 3679, 'char_end': 3755, 'line': ' if (check_anon(kdc_active_realm, client.princ, request->server) != 0) {\n'}]}
{'deleted': [{'char_start': 3716, 'char_end': 3725, 'chars': 'request->'}], 'added': [{'char_start': 3722, 'char_end': 3728, 'chars': '.princ'}]}
github.com/krb5/krb5/commit/93b4a6306a0026cf1cc31ac4bd8a49ba5d034ba7
src/kdc/kdc_util.c
cwe-476
1,098
cwe-078
test_get_least_used_nsp
def test_get_least_used_nsp(self): self.flags(lock_path=self.tempdir) #record self.clear_mox() _run_ssh = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh) self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_run_ssh", _run_ssh) show_vlun_cmd = 'showvlun -a -...
def test_get_least_used_nsp(self): self.flags(lock_path=self.tempdir) #record self.clear_mox() _run_ssh = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh) self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_run_ssh", _run_ssh) show_vlun_cmd = ['showvlun', '...
{'deleted': [{'line_no': 9, 'char_start': 282, 'char_end': 335, 'line': " show_vlun_cmd = 'showvlun -a -showcols Port'\n"}], 'added': [{'line_no': 9, 'char_start': 282, 'char_end': 346, 'line': " show_vlun_cmd = ['showvlun', '-a', '-showcols', 'Port']\n"}]}
{'deleted': [], 'added': [{'char_start': 306, 'char_end': 307, 'chars': '['}, {'char_start': 316, 'char_end': 318, 'chars': "',"}, {'char_start': 319, 'char_end': 320, 'chars': "'"}, {'char_start': 322, 'char_end': 324, 'chars': "',"}, {'char_start': 325, 'char_end': 326, 'chars': "'"}, {'char_start': 335, 'char_end': ...
github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f
cinder/tests/test_hp3par.py
cwe-078
336
cwe-190
amqp_handle_input
int amqp_handle_input(amqp_connection_state_t state, amqp_bytes_t received_data, amqp_frame_t *decoded_frame) { size_t bytes_consumed; void *raw_frame; /* Returning frame_type of zero indicates either insufficient input, or a complete, ignored frame was read. */ decoded_frame->frame_...
int amqp_handle_input(amqp_connection_state_t state, amqp_bytes_t received_data, amqp_frame_t *decoded_frame) { size_t bytes_consumed; void *raw_frame; /* Returning frame_type of zero indicates either insufficient input, or a complete, ignored frame was read. */ decoded_frame->frame_...
{'deleted': [{'line_no': 54, 'char_start': 1794, 'char_end': 1833, 'line': ' /* frame length is 3 bytes in */\n'}, {'line_no': 57, 'char_start': 1887, 'char_end': 1914, 'line': ' state->target_size =\n'}, {'line_no': 58, 'char_start': 1914, 'char_end': 1989, 'line': ' amqp_d32(amqp_offset(raw_frame, ...
{'deleted': [{'char_start': 1800, 'char_end': 1802, 'chars': '/*'}, {'char_start': 1808, 'char_end': 1816, 'chars': ' length '}, {'char_start': 1817, 'char_end': 1824, 'chars': 's 3 byt'}, {'char_start': 1825, 'char_end': 1832, 'chars': 's in */'}, {'char_start': 1893, 'char_end': 1895, 'chars': 'st'}, {'char_start': 1...
github.com/alanxz/rabbitmq-c/commit/fc85be7123050b91b054e45b91c78d3241a5047a
librabbitmq/amqp_connection.c
cwe-190
1,275
cwe-089
get_item
@api.route('/items/<int:item_id>', methods=['GET']) def get_item(item_id): sql = '''SELECT id, name_enus FROM tblDBCItem WHERE id = {} AND auctionable = true;'''.format(item_id) cursor = mysql.connection.cursor() cursor.execute(sql) data = cursor.fetchone() if data: item = {} for tu...
@api.route('/items/<int:item_id>', methods=['GET']) def get_item(item_id): sql = '''SELECT id, name_enus FROM tblDBCItem WHERE id = %s AND auctionable = true;''' cursor = mysql.connection.cursor() cursor.execute(sql, [item_id]) data = cursor.fetchone() if data: item = {} for tup in ...
{'deleted': [{'line_no': 3, 'char_start': 75, 'char_end': 182, 'line': " sql = '''SELECT id, name_enus FROM tblDBCItem WHERE id = {} AND auctionable = true;'''.format(item_id)\n"}, {'line_no': 5, 'char_start': 221, 'char_end': 245, 'line': ' cursor.execute(sql)\n'}], 'added': [{'line_no': 3, 'char_start': 75, 'ch...
{'deleted': [{'char_start': 136, 'char_end': 138, 'chars': '{}'}, {'char_start': 165, 'char_end': 181, 'chars': '.format(item_id)'}], 'added': [{'char_start': 136, 'char_end': 138, 'chars': '%s'}, {'char_start': 227, 'char_end': 238, 'chars': ', [item_id]'}]}
github.com/cosileone/TimeIsMoneyFriend-API/commit/3d3b5defd26ef7d205915bf643b6b1df90a15e44
timf/api/views.py
cwe-089
130
cwe-476
AP4_HdlrAtom::AP4_HdlrAtom
AP4_HdlrAtom::AP4_HdlrAtom(AP4_UI32 size, AP4_UI08 version, AP4_UI32 flags, AP4_ByteStream& stream) : AP4_Atom(AP4_ATOM_TYPE_HDLR, size, version, flags) { AP4_UI32 predefined; stream.ReadUI32(predefined); ...
AP4_HdlrAtom::AP4_HdlrAtom(AP4_UI32 size, AP4_UI08 version, AP4_UI32 flags, AP4_ByteStream& stream) : AP4_Atom(AP4_ATOM_TYPE_HDLR, size, version, flags) { AP4_UI32 predefined; stream.ReadUI32(predefined); ...
{'deleted': [{'line_no': 15, 'char_start': 509, 'char_end': 566, 'line': ' int name_size = size-(AP4_FULL_ATOM_HEADER_SIZE+20);\n'}, {'line_no': 16, 'char_start': 566, 'char_end': 598, 'line': ' if (name_size == 0) return;\n'}], 'added': [{'line_no': 15, 'char_start': 509, 'char_end': 562, 'line': ' if (size <...
{'deleted': [{'char_start': 514, 'char_end': 516, 'chars': 'nt'}, {'char_start': 517, 'char_end': 522, 'chars': 'name_'}, {'char_start': 527, 'char_end': 528, 'chars': '='}, {'char_start': 529, 'char_end': 535, 'chars': 'size-('}, {'char_start': 570, 'char_end': 572, 'chars': 'if'}, {'char_start': 573, 'char_end': 574,...
github.com/axiomatic-systems/Bento4/commit/22192de5367fa0cee985917f092be4060b7c00b0
Source/C++/Core/Ap4HdlrAtom.cpp
cwe-476
294
cwe-476
lexer_process_char_literal
lexer_process_char_literal (parser_context_t *context_p, /**< context */ const uint8_t *char_p, /**< characters */ size_t length, /**< length of string */ uint8_t literal_type, /**< final literal type */ bool...
lexer_process_char_literal (parser_context_t *context_p, /**< context */ const uint8_t *char_p, /**< characters */ size_t length, /**< length of string */ uint8_t literal_type, /**< final literal type */ bool...
{'deleted': [], 'added': [{'line_no': 41, 'char_start': 1556, 'char_end': 1575, 'line': ' if (length == 0)\n'}, {'line_no': 42, 'char_start': 1575, 'char_end': 1579, 'line': ' {\n'}, {'line_no': 43, 'char_start': 1579, 'char_end': 1603, 'line': ' has_escape = false;\n'}, {'line_no': 44, 'char_start': 1603, 'char_e...
{'deleted': [], 'added': [{'char_start': 1558, 'char_end': 1610, 'chars': 'if (length == 0)\n {\n has_escape = false;\n }\n\n '}]}
github.com/zherczeg/jerryscript/commit/03a8c630f015f63268639d3ed3bf82cff6fa77d8
jerry-core/parser/js/js-lexer.c
cwe-476
532
cwe-125
autodetect_recv_bandwidth_measure_results
static BOOL autodetect_recv_bandwidth_measure_results(rdpRdp* rdp, wStream* s, AUTODETECT_RSP_PDU* autodetectRspPdu) { BOOL success = TRUE; if (autodetectRspPdu->headerLength != 0x0E) return FALSE; WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Results ...
static BOOL autodetect_recv_bandwidth_measure_results(rdpRdp* rdp, wStream* s, AUTODETECT_RSP_PDU* autodetectRspPdu) { BOOL success = TRUE; if (autodetectRspPdu->headerLength != 0x0E) return FALSE; WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Results ...
{'deleted': [], 'added': [{'line_no': 10, 'char_start': 327, 'char_end': 366, 'line': '\tif (Stream_GetRemainingLength(s) < 8)\n'}, {'line_no': 11, 'char_start': 366, 'char_end': 379, 'line': '\t\treturn -1;\n'}]}
{'deleted': [], 'added': [{'char_start': 328, 'char_end': 380, 'chars': 'if (Stream_GetRemainingLength(s) < 8)\n\t\treturn -1;\n\t'}]}
github.com/FreeRDP/FreeRDP/commit/f5e73cc7c9cd973b516a618da877c87b80950b65
libfreerdp/core/autodetect.c
cwe-125
264
cwe-787
rfbHandleAuthResult
rfbHandleAuthResult(rfbClient* client) { uint32_t authResult=0, reasonLen=0; char *reason=NULL; if (!ReadFromRFBServer(client, (char *)&authResult, 4)) return FALSE; authResult = rfbClientSwap32IfLE(authResult); switch (authResult) { case rfbVncAuthOK: rfbClientLog("VNC authentication s...
rfbHandleAuthResult(rfbClient* client) { uint32_t authResult=0; if (!ReadFromRFBServer(client, (char *)&authResult, 4)) return FALSE; authResult = rfbClientSwap32IfLE(authResult); switch (authResult) { case rfbVncAuthOK: rfbClientLog("VNC authentication succeeded\n"); return TRUE; ...
{'deleted': [{'line_no': 3, 'char_start': 41, 'char_end': 81, 'line': ' uint32_t authResult=0, reasonLen=0;\n'}, {'line_no': 4, 'char_start': 81, 'char_end': 104, 'line': ' char *reason=NULL;\n'}, {'line_no': 19, 'char_start': 489, 'char_end': 566, 'line': ' if (!ReadFromRFBServer(client, (char *)&reasonLe...
{'deleted': [{'char_start': 66, 'char_end': 102, 'chars': ', reasonLen=0;\n char *reason=NULL'}, {'char_start': 497, 'char_end': 502, 'chars': 'if (!'}, {'char_start': 506, 'char_end': 510, 'chars': 'From'}, {'char_start': 511, 'char_end': 538, 'chars': 'FBServer(client, (char *)&r'}, {'char_start': 543, 'char_end':...
github.com/LibVNC/libvncserver/commit/e34bcbb759ca5bef85809967a268fdf214c1ad2c
libvncclient/rfbproto.c
cwe-787
325
cwe-125
get_uncompressed_data
get_uncompressed_data(struct archive_read *a, const void **buff, size_t size, size_t minimum) { struct _7zip *zip = (struct _7zip *)a->format->data; ssize_t bytes_avail; if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) { /* Copy mode. */ /* * Note: '1' here is a performance optimization. ...
get_uncompressed_data(struct archive_read *a, const void **buff, size_t size, size_t minimum) { struct _7zip *zip = (struct _7zip *)a->format->data; ssize_t bytes_avail; if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) { /* Copy mode. */ *buff = __archive_read_ahead(a, minimum, &bytes_avail)...
{'deleted': [{'line_no': 10, 'char_start': 264, 'char_end': 269, 'line': '\t\t/*\n'}, {'line_no': 11, 'char_start': 269, 'char_end': 320, 'line': "\t\t * Note: '1' here is a performance optimization.\n"}, {'line_no': 12, 'char_start': 320, 'char_end': 380, 'line': '\t\t * Recall that the decompression layer returns a c...
{'deleted': [{'char_start': 266, 'char_end': 499, 'chars': "/*\n\t\t * Note: '1' here is a performance optimization.\n\t\t * Recall that the decompression layer returns a count of\n\t\t * available bytes; asking for more than that forces the\n\t\t * decompressor to combine reads by copying data.\n\t\t */\n\t\t"}, {'cha...
github.com/libarchive/libarchive/commit/65a23f5dbee4497064e9bb467f81138a62b0dae1
libarchive/archive_read_support_format_7zip.c
cwe-125
499
cwe-787
HandleRFBServerMessage
HandleRFBServerMessage(rfbClient* client) { rfbServerToClientMsg msg; if (client->serverPort==-1) client->vncRec->readTimestamp = TRUE; if (!ReadFromRFBServer(client, (char *)&msg, 1)) return FALSE; switch (msg.type) { case rfbSetColourMapEntries: { /* TODO: int i; uint16_t rgb[3]; ...
HandleRFBServerMessage(rfbClient* client) { rfbServerToClientMsg msg; if (client->serverPort==-1) client->vncRec->readTimestamp = TRUE; if (!ReadFromRFBServer(client, (char *)&msg, 1)) return FALSE; switch (msg.type) { case rfbSetColourMapEntries: { /* TODO: int i; uint16_t rgb[3]; ...
{'deleted': [{'line_no': 517, 'char_start': 15578, 'char_end': 15627, 'line': ' buffer = malloc((uint64_t)msg.sct.length+1);\n'}], 'added': [{'line_no': 517, 'char_start': 15578, 'char_end': 15617, 'line': ' buffer = malloc(msg.sct.length+1);\n'}]}
{'deleted': [{'char_start': 15598, 'char_end': 15608, 'chars': '(uint64_t)'}], 'added': []}
github.com/LibVNC/libvncserver/commit/a64c3b37af9a6c8f8009d7516874b8d266b42bae
libvncclient/rfbproto.c
cwe-787
5,548