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-476 | php_wddx_pop_element | */
static void php_wddx_pop_element(void *user_data, const XML_Char *name)
{
st_entry *ent1, *ent2;
wddx_stack *stack = (wddx_stack *)user_data;
HashTable *target_hash;
zend_class_entry **pce;
zval *obj;
zval *tmp;
TSRMLS_FETCH();
/* OBJECTS_FIXME */
if (stack->top == 0) {
return;
}
if (!... | */
static void php_wddx_pop_element(void *user_data, const XML_Char *name)
{
st_entry *ent1, *ent2;
wddx_stack *stack = (wddx_stack *)user_data;
HashTable *target_hash;
zend_class_entry **pce;
zval *obj;
zval *tmp;
TSRMLS_FETCH();
/* OBJECTS_FIXME */
if (stack->top == 0) {
return;
}
if (!... | {'deleted': [{'line_no': 40, 'char_start': 966, 'char_end': 1003, 'line': '\t\t\tZ_STRVAL_P(ent1->data) = new_str;\n'}, {'line_no': 41, 'char_start': 1003, 'char_end': 1040, 'line': '\t\t\tZ_STRLEN_P(ent1->data) = new_len;\n'}], 'added': [{'line_no': 40, 'char_start': 966, 'char_end': 984, 'line': '\t\t\tif (new_str) {... | {'deleted': [], 'added': [{'char_start': 969, 'char_end': 988, 'chars': 'if (new_str) {\n\t\t\t\t'}, {'char_start': 1025, 'char_end': 1026, 'chars': '\t'}, {'char_start': 1059, 'char_end': 1111, 'chars': '\n\t\t\t} else {\n\t\t\t\tZVAL_EMPTY_STRING(ent1->data);\n\t\t\t}'}]} | github.com/php/php-src/commit/698a691724c0a949295991e5df091ce16f899e02 | ext/wddx/wddx.c | cwe-476 | 1,241 |
cwe-476 | big_key_init | static int __init big_key_init(void)
{
return register_key_type(&key_type_big_key);
} | static int __init big_key_init(void)
{
struct crypto_skcipher *cipher;
struct crypto_rng *rng;
int ret;
rng = crypto_alloc_rng(big_key_rng_name, 0, 0);
if (IS_ERR(rng)) {
pr_err("Can't alloc rng: %ld\n", PTR_ERR(rng));
return PTR_ERR(rng);
}
big_key_rng = rng;
/* seed RNG */
ret = crypto_rng_reset(rng, ... | {'deleted': [{'line_no': 3, 'char_start': 39, 'char_end': 85, 'line': '\treturn register_key_type(&key_type_big_key);\n'}, {'line_no': 4, 'char_start': 85, 'char_end': 86, 'line': '}\n'}], 'added': []} | {'deleted': [], 'added': [{'char_start': 40, 'char_end': 42, 'chars': 'st'}, {'char_start': 43, 'char_end': 68, 'chars': 'uct crypto_skcipher *ciph'}, {'char_start': 69, 'char_end': 74, 'chars': 'r;\n\ts'}, {'char_start': 75, 'char_end': 76, 'chars': 'r'}, {'char_start': 77, 'char_end': 87, 'chars': 'ct crypto_'}, {'ch... | github.com/torvalds/linux/commit/7df3e59c3d1df4f87fe874c7956ef7a3d2f4d5fb | security/keys/big_key.c | cwe-476 | 21 |
cwe-416 | ndpi_reset_packet_line_info | static void ndpi_reset_packet_line_info(struct ndpi_packet_struct *packet) {
packet->parsed_lines = 0, packet->empty_line_position_set = 0, packet->host_line.ptr = NULL,
packet->host_line.len = 0, packet->referer_line.ptr = NULL, packet->referer_line.len = 0,
packet->content_line.ptr = NULL, packet->content_l... | static void ndpi_reset_packet_line_info(struct ndpi_packet_struct *packet) {
packet->parsed_lines = 0, packet->empty_line_position_set = 0, packet->host_line.ptr = NULL,
packet->host_line.len = 0, packet->referer_line.ptr = NULL, packet->referer_line.len = 0,
packet->content_line.ptr = NULL, packet->content_l... | {'deleted': [{'line_no': 8, 'char_start': 688, 'char_end': 793, 'line': ' packet->http_contentlen.ptr = NULL, packet->http_contentlen.len = 0, packet->http_cookie.ptr = NULL,\n'}], 'added': [{'line_no': 8, 'char_start': 688, 'char_end': 806, 'line': ' packet->http_contentlen.ptr = NULL, packet->http_contentlen.le... | {'deleted': [], 'added': [{'char_start': 769, 'char_end': 860, 'chars': 'content_disposition_line.ptr = NULL,\n packet->content_disposition_line.len = 0, packet->'}]} | github.com/ntop/nDPI/commit/6a9f5e4f7c3fd5ddab3e6727b071904d76773952 | src/lib/ndpi_main.c | cwe-416 | 323 |
cwe-125 | getToken | static x86newTokenType getToken(const char *str, size_t *begin, size_t *end) {
// Skip whitespace
while (begin && isspace ((ut8)str[*begin])) {
++(*begin);
}
if (!str[*begin]) { // null byte
*end = *begin;
return TT_EOF;
} else if (isalpha ((ut8)str[*begin])) { // word token
*end = *begin... | static x86newTokenType getToken(const char *str, size_t *begin, size_t *end) {
if (*begin > strlen (str)) {
return TT_EOF;
}
// Skip whitespace
while (begin && str[*begin] && isspace ((ut8)str[*begin])) {
++(*begin);
}
if (!str[*begin]) { // null byte
*end = *begin;
return TT_EOF;
}
if (... | {'deleted': [{'line_no': 3, 'char_start': 99, 'char_end': 146, 'line': '\twhile (begin && isspace ((ut8)str[*begin])) {\n'}, {'line_no': 10, 'char_start': 247, 'char_end': 305, 'line': '\t} else if (isalpha ((ut8)str[*begin])) { // word token\n'}, {'line_no': 12, 'char_start': 322, 'char_end': 366, 'line': '\t\twhile... | {'deleted': [{'char_start': 249, 'char_end': 255, 'chars': ' else '}, {'char_start': 403, 'char_end': 409, 'chars': ' else '}], 'added': [{'char_start': 80, 'char_end': 130, 'chars': 'if (*begin > strlen (str)) {\n\t\treturn TT_EOF;\n\t}\n\t'}, {'char_start': 162, 'char_end': 177, 'chars': ' && str[*begin]'}, {'char_st... | github.com/radare/radare2/commit/66191f780863ea8c66ace4040d0d04a8842e8432 | libr/asm/p/asm_x86_nz.c | cwe-125 | 236 |
cwe-787 | FromkLinuxSockAddr | bool FromkLinuxSockAddr(const struct klinux_sockaddr *input,
socklen_t input_len, struct sockaddr *output,
socklen_t *output_len,
void (*abort_handler)(const char *)) {
if (!input || !output || !output_len || input_len == 0) {
output = nullpt... | bool FromkLinuxSockAddr(const struct klinux_sockaddr *input,
socklen_t input_len, struct sockaddr *output,
socklen_t *output_len,
void (*abort_handler)(const char *)) {
if (!input || !output || !output_len || input_len == 0) {
output = nullpt... | {'deleted': [], 'added': [{'line_no': 12, 'char_start': 438, 'char_end': 495, 'line': ' if (input_len < sizeof(struct klinux_sockaddr_un)) {\n'}, {'line_no': 13, 'char_start': 495, 'char_end': 515, 'line': ' return false;\n'}, {'line_no': 14, 'char_start': 515, 'char_end': 521, 'line': ' }\n'}, {'line_no': 1... | {'deleted': [{'char_start': 493, 'char_end': 493, 'chars': ''}, {'char_start': 1856, 'char_end': 1856, 'chars': ''}], 'added': [{'char_start': 442, 'char_end': 526, 'chars': 'if (input_len < sizeof(struct klinux_sockaddr_un)) {\n return false;\n }\n\n '}, {'char_start': 1182, 'char_end': 1265, 'chars': ' ... | github.com/google/asylo/commit/bda9772e7872b0d2b9bee32930cf7a4983837b39 | asylo/platform/system_call/type_conversions/manual_types_functions.cc | cwe-787 | 755 |
cwe-190 | process_get_command | static inline void process_get_command(conn *c, token_t *tokens, size_t ntokens, bool return_cas) {
char *key;
size_t nkey;
int i = 0;
item *it;
token_t *key_token = &tokens[KEY_TOKEN];
char *suffix;
assert(c != NULL);
do {
while(key_token->length != 0) {
key = key_... | static inline void process_get_command(conn *c, token_t *tokens, size_t ntokens, bool return_cas) {
char *key;
size_t nkey;
int i = 0;
item *it;
token_t *key_token = &tokens[KEY_TOKEN];
char *suffix;
assert(c != NULL);
do {
while(key_token->length != 0) {
key = key_... | {'deleted': [{'line_no': 24, 'char_start': 625, 'char_end': 677, 'line': ' it = item_get(key, nkey, c, DO_UPDATE);\n'}], 'added': [{'line_no': 24, 'char_start': 625, 'char_end': 669, 'line': ' it = limited_get(key, nkey, c);\n'}]} | {'deleted': [{'char_start': 645, 'char_end': 646, 'chars': 'm'}, {'char_start': 663, 'char_end': 674, 'chars': ', DO_UPDATE'}], 'added': [{'char_start': 642, 'char_end': 645, 'chars': 'lim'}, {'char_start': 648, 'char_end': 649, 'chars': 'd'}]} | github.com/memcached/memcached/commit/a8c4a82787b8b6c256d61bd5c42fb7f92d1bae00 | memcached.c | cwe-190 | 1,494 |
cwe-089 | compare_and_update | @staticmethod
def compare_and_update(user, message):
"""
This method compare a user object from the bot and his info from
the Telegram message to check whether a user has changed his bio
or not. If yes, the user object that represents him in the bot will
be updated accord... | @staticmethod
def compare_and_update(user, message):
"""
This method compare a user object from the bot and his info from
the Telegram message to check whether a user has changed his bio
or not. If yes, the user object that represents him in the bot will
be updated accord... | {'deleted': [{'line_no': 41, 'char_start': 1578, 'char_end': 1635, 'line': ' f"SET first_name=\'{user.first_name}\', "\n'}, {'line_no': 42, 'char_start': 1635, 'char_end': 1684, 'line': ' f"nickname=\'{user.nickname}\', "\n'}, {'line_no': 43, 'char_start': 1684, 'char_end': 1734, 'line':... | {'deleted': [{'char_start': 1612, 'char_end': 1615, 'chars': "'{u"}, {'char_start': 1616, 'char_end': 1631, 'chars': "er.first_name}'"}, {'char_start': 1663, 'char_end': 1666, 'chars': "'{u"}, {'char_start': 1667, 'char_end': 1680, 'chars': "er.nickname}'"}, {'char_start': 1713, 'char_end': 1722, 'chars': "'{user.la"},... | github.com/RandyRomero/photoGPSbot/commit/0e9f57f13e61863b3672f5730e27f149da00786a | photogpsbot/users.py | cwe-089 | 401 |
cwe-125 | string_scan_range | static int string_scan_range(RList *list, RBinFile *bf, int min,
const ut64 from, const ut64 to, int type) {
ut8 tmp[R_STRING_SCAN_BUFFER_SIZE];
ut64 str_start, needle = from;
int count = 0, i, rc, runes;
int str_type = R_STRING_TYPE_DETECT;
if (type == -1) {
type = R_STRING_TYPE_DETECT;
}
if (from >... | static int string_scan_range(RList *list, RBinFile *bf, int min,
const ut64 from, const ut64 to, int type) {
ut8 tmp[R_STRING_SCAN_BUFFER_SIZE];
ut64 str_start, needle = from;
int count = 0, i, rc, runes;
int str_type = R_STRING_TYPE_DETECT;
if (type == -1) {
type = R_STRING_TYPE_DETECT;
}
if (from >... | {'deleted': [{'line_no': 15, 'char_start': 418, 'char_end': 453, 'line': '\tut8 *buf = calloc (to - from, 1);\n'}, {'line_no': 19, 'char_start': 490, 'char_end': 538, 'line': '\tr_buf_read_at (bf->buf, from, buf, to - from);\n'}, {'line_no': 29, 'char_start': 768, 'char_end': 796, 'line': '\t\t\tif ((to - needle) > 5) ... | {'deleted': [{'char_start': 438, 'char_end': 447, 'chars': 'to - from'}, {'char_start': 526, 'char_end': 535, 'chars': 'to - from'}], 'added': [{'char_start': 419, 'char_end': 441, 'chars': 'int len = to - from;\n\t'}, {'char_start': 460, 'char_end': 463, 'chars': 'len'}, {'char_start': 542, 'char_end': 545, 'chars': '... | github.com/radare/radare2/commit/3fcf41ed96ffa25b38029449520c8d0a198745f3 | libr/bin/file.c | cwe-125 | 1,357 |
cwe-125 | uas_switch_interface | static int uas_switch_interface(struct usb_device *udev,
struct usb_interface *intf)
{
int alt;
alt = uas_find_uas_alt_setting(intf);
if (alt < 0)
return alt;
return usb_set_interface(udev,
intf->altsetting[0].desc.bInterfaceNumber, alt);
} | static int uas_switch_interface(struct usb_device *udev,
struct usb_interface *intf)
{
struct usb_host_interface *alt;
alt = uas_find_uas_alt_setting(intf);
if (!alt)
return -ENODEV;
return usb_set_interface(udev, alt->desc.bInterfaceNumber,
alt->desc.bAlternateSetting);
} | {'deleted': [{'line_no': 4, 'char_start': 91, 'char_end': 101, 'line': '\tint alt;\n'}, {'line_no': 7, 'char_start': 141, 'char_end': 155, 'line': '\tif (alt < 0)\n'}, {'line_no': 8, 'char_start': 155, 'char_end': 169, 'line': '\t\treturn alt;\n'}, {'line_no': 10, 'char_start': 170, 'char_end': 202, 'line': '\treturn u... | {'deleted': [{'char_start': 149, 'char_end': 153, 'chars': ' < 0'}, {'char_start': 164, 'char_end': 167, 'chars': 'alt'}, {'char_start': 201, 'char_end': 211, 'chars': '\n\t\t\tintf->'}, {'char_start': 214, 'char_end': 225, 'chars': 'setting[0].'}, {'char_start': 247, 'char_end': 248, 'chars': ' '}], 'added': [{'char_s... | github.com/torvalds/linux/commit/786de92b3cb26012d3d0f00ee37adf14527f35c4 | drivers/usb/storage/uas.c | cwe-125 | 72 |
cwe-078 | resolve_hostname | @then(parsers.parse("the hostname '{hostname}' should be resolved"))
def resolve_hostname(busybox_pod, host, hostname):
with host.sudo():
# test dns resolve
cmd_nslookup = ("kubectl --kubeconfig=/etc/kubernetes/admin.conf"
" exec -ti {0} nslookup {1}".format(
... | @then(parsers.parse("the hostname '{hostname}' should be resolved"))
def resolve_hostname(busybox_pod, host, hostname):
with host.sudo():
# test dns resolve
result = host.run(
"kubectl --kubeconfig=/etc/kubernetes/admin.conf "
"exec -ti %s nslookup %s",
busybox_po... | {'deleted': [{'line_no': 3, 'char_start': 120, 'char_end': 146, 'line': ' with host.sudo():\n'}, {'line_no': 5, 'char_start': 177, 'char_end': 255, 'line': ' cmd_nslookup = ("kubectl --kubeconfig=/etc/kubernetes/admin.conf"\n'}, {'line_no': 6, 'char_start': 255, 'char_end': 320, 'line': ' ... | {'deleted': [{'char_start': 124, 'char_end': 128, 'chars': ' '}, {'char_start': 146, 'char_end': 150, 'chars': ' '}, {'char_start': 189, 'char_end': 201, 'chars': 'cmd_nslookup'}, {'char_start': 202, 'char_end': 203, 'chars': '='}, {'char_start': 204, 'char_end': 205, 'chars': '('}, {'char_start': 255, 'char_end'... | github.com/scality/metalk8s/commit/82d92836d4ff78c623a0e06302c94cfa5ff79908 | tests/post/steps/test_dns.py | cwe-078 | 101 |
cwe-089 | delete_data | def delete_data(self, session, id):
self._openContainer(session)
sid = str(id)
if (self.idNormalizer is not None):
sid = self.idNormalizer.process_string(session, str(id))
query = "DELETE FROM %s WHERE identifier = '%s';" % (self.table, sid)
self._query(query)
... | def delete_data(self, session, id):
self._openContainer(session)
sid = str(id)
if (self.idNormalizer is not None):
sid = self.idNormalizer.process_string(session, str(id))
query = "DELETE FROM %s WHERE identifier = $1;" % (self.table)
self._query(query, sid)
... | {'deleted': [{'line_no': 6, 'char_start': 212, 'char_end': 290, 'line': ' query = "DELETE FROM %s WHERE identifier = \'%s\';" % (self.table, sid)\n'}, {'line_no': 7, 'char_start': 290, 'char_end': 317, 'line': ' self._query(query)\n'}], 'added': [{'line_no': 6, 'char_start': 212, 'char_end': 283, 'line': ... | {'deleted': [{'char_start': 263, 'char_end': 267, 'chars': "'%s'"}, {'char_start': 283, 'char_end': 288, 'chars': ', sid'}], 'added': [{'char_start': 263, 'char_end': 265, 'chars': '$1'}, {'char_start': 308, 'char_end': 313, 'chars': ', sid'}]} | github.com/cheshire3/cheshire3/commit/d350363b4ea10f102c24c8f26d7b76b006323e8e | cheshire3/sql/postgresStore.py | cwe-089 | 79 |
cwe-476 | dex_parse_debug_item | static void dex_parse_debug_item(RBinFile *binfile, RBinDexObj *bin,
RBinDexClass *c, int MI, int MA, int paddr, int ins_size,
int insns_size, char *class_name, int regsz,
int debug_info_off) {
struct r_bin_t *rbin = binfile->rbin;
const ut8 *p4 = r_buf_get_at (binfile->buf, debug_info_off, NULL);
... | static void dex_parse_debug_item(RBinFile *binfile, RBinDexObj *bin,
RBinDexClass *c, int MI, int MA, int paddr, int ins_size,
int insns_size, char *class_name, int regsz,
int debug_info_off) {
struct r_bin_t *rbin = binfile->rbin;
const ut8 *p4 = r_buf_get_at (binfile->buf, debug_info_off, NULL);
... | {'deleted': [], 'added': [{'line_no': 83, 'char_start': 2398, 'char_end': 2414, 'line': '\tif (p4 <= 0) {\n'}, {'line_no': 84, 'char_start': 2414, 'char_end': 2424, 'line': '\t\treturn;\n'}, {'line_no': 85, 'char_start': 2424, 'char_end': 2427, 'line': '\t}\n'}]} | {'deleted': [], 'added': [{'char_start': 2399, 'char_end': 2428, 'chars': 'if (p4 <= 0) {\n\t\treturn;\n\t}\n\t'}]} | github.com/radare/radare2/commit/252afb1cff9676f3ae1f341a28448bf2c8b6e308 | libr/bin/p/bin_dex.c | cwe-476 | 3,035 |
cwe-089 | update_title | def update_title(self, title = None):
if (not self.title):
self.title = title
# This will fall to a sql injection
sql = "UPDATE jdk_entries SET title = '" + self.title + "'" + \
"WHERE jdk_entries.id = '" + self.entry_id + "';"
db_execute(sql)
self.update_date_modified()
... | def update_title(self, title = None):
if (not self.title):
self.title = title
quote_tuple = self.title, self.entry_id
# This will fall to a sql injection
sql = "UPDATE jdk_entries SET title = ?" + \
"WHERE jdk_entries.id = ?;"
db_execute(sql, quote_tuple)
self.update_... | {'deleted': [{'line_no': 6, 'char_start': 132, 'char_end': 200, 'line': ' sql = "UPDATE jdk_entries SET title = \'" + self.title + "\'" + \\\n'}, {'line_no': 7, 'char_start': 200, 'char_end': 261, 'line': ' "WHERE jdk_entries.id = \'" + self.entry_id + "\';" \n'}, {'line_no': 9, 'char_start': 262, 'char_end... | {'deleted': [{'char_start': 174, 'char_end': 194, 'chars': '\'" + self.title + "\''}, {'char_start': 234, 'char_end': 257, 'chars': '\'" + self.entry_id + "\''}], 'added': [{'char_start': 95, 'char_end': 140, 'chars': 'quote_tuple = self.title, self.entry_id\n\n '}, {'char_start': 219, 'char_end': 220, 'chars': '?'}... | github.com/peterlebrun/jdk/commit/000238566fbe55ba09676c3d57af04ae207235ae | entry.py | cwe-089 | 85 |
cwe-089 | user_verify | def user_verify(self):
eid = self.email
code = self.password
if eid.strip() == '':
return
if code.strip() == '':
return
query = '''select * from usr where email like\''''+eid+'\''
cursor = g.conn.execute(query)
for row in cursor:
... | def user_verify(self):
eid = self.email
code = self.password
if eid.strip() == '':
return
if code.strip() == '':
return
query = 'select * from usr where email like %s'
cursor = g.conn.execute(query, (eid, ))
for row in cursor:
... | {'deleted': [{'line_no': 8, 'char_start': 180, 'char_end': 248, 'line': " query = '''select * from usr where email like\\''''+eid+'\\''\n"}, {'line_no': 9, 'char_start': 248, 'char_end': 287, 'line': ' cursor = g.conn.execute(query)\n'}], 'added': [{'line_no': 8, 'char_start': 180, 'char_end': 236, 'line'... | {'deleted': [{'char_start': 197, 'char_end': 199, 'chars': "''"}, {'char_start': 233, 'char_end': 246, 'chars': "\\''''+eid+'\\'"}], 'added': [{'char_start': 231, 'char_end': 234, 'chars': ' %s'}, {'char_start': 273, 'char_end': 282, 'chars': ', (eid, )'}]} | github.com/Daniel-Bu/w4111-project1/commit/fe04bedc72e62fd4c4ee046a9af29fd81e9b3340 | Web-app/User.py | cwe-089 | 115 |
cwe-416 | usb_console_setup | static int usb_console_setup(struct console *co, char *options)
{
struct usbcons_info *info = &usbcons_info;
int baud = 9600;
int bits = 8;
int parity = 'n';
int doflow = 0;
int cflag = CREAD | HUPCL | CLOCAL;
char *s;
struct usb_serial *serial;
struct usb_serial_port *port;
int retval;
struct tty_struct *tt... | static int usb_console_setup(struct console *co, char *options)
{
struct usbcons_info *info = &usbcons_info;
int baud = 9600;
int bits = 8;
int parity = 'n';
int doflow = 0;
int cflag = CREAD | HUPCL | CLOCAL;
char *s;
struct usb_serial *serial;
struct usb_serial_port *port;
int retval;
struct tty_struct *tt... | {'deleted': [], 'added': [{'line_no': 132, 'char_start': 3110, 'char_end': 3130, 'line': '\tinfo->port = NULL;\n'}]} | {'deleted': [], 'added': [{'char_start': 3111, 'char_end': 3131, 'chars': 'info->port = NULL;\n\t'}]} | github.com/torvalds/linux/commit/299d7572e46f98534033a9e65973f13ad1ce9047 | drivers/usb/serial/console.c | cwe-416 | 1,003 |
cwe-089 | add_input | def add_input(self, data):
connection = self.connects()
try:
# The following introduces a deliberate security flaw. See section on SQL injecton below
query = "INSERT INTO crimes (description) VALUES ('{}');".format(
data)
with connection.cursor() a... | def add_input(self, data):
connection = self.connects()
try:
# The following introduces a deliberate security flaw. See section on SQL injecton below
query = "INSERT INTO crimes (description) VALUES (%s);"
with connection.cursor() as cursor:
cursor... | {'deleted': [{'line_no': 5, 'char_start': 182, 'char_end': 260, 'line': ' query = "INSERT INTO crimes (description) VALUES (\'{}\');".format(\n'}, {'line_no': 6, 'char_start': 260, 'char_end': 282, 'line': ' data)\n'}, {'line_no': 8, 'char_start': 330, 'char_end': 368, 'line': ' ... | {'deleted': [{'char_start': 244, 'char_end': 248, 'chars': "'{}'"}, {'char_start': 251, 'char_end': 281, 'chars': '.format(\n data)'}], 'added': [{'char_start': 244, 'char_end': 246, 'chars': '%s'}, {'char_start': 334, 'char_end': 340, 'chars': ', data'}]} | github.com/JeremiahO/crimemap/commit/c17537fcd7aa4e2a26f7ca5cefaeb356ff646858 | dbhelper.py | cwe-089 | 80 |
cwe-125 | jpc_pi_nextrpcl | static int jpc_pi_nextrpcl(register jpc_pi_t *pi)
{
int rlvlno;
jpc_pirlvl_t *pirlvl;
jpc_pchg_t *pchg;
int prchind;
int prcvind;
int *prclyrno;
int compno;
jpc_picomp_t *picomp;
int xstep;
int ystep;
uint_fast32_t r;
uint_fast32_t rpx;
uint_fast32_t rpy;
uint_fast32_t trx0;
uint_fast32_t try0;
pchg = ... | static int jpc_pi_nextrpcl(register jpc_pi_t *pi)
{
int rlvlno;
jpc_pirlvl_t *pirlvl;
jpc_pchg_t *pchg;
int prchind;
int prcvind;
int *prclyrno;
int compno;
jpc_picomp_t *picomp;
int xstep;
int ystep;
uint_fast32_t r;
uint_fast32_t rpx;
uint_fast32_t rpy;
uint_fast32_t trx0;
uint_fast32_t try0;
pchg = ... | {'deleted': [{'line_no': 30, 'char_start': 656, 'char_end': 710, 'line': '\t\t\t\tif (pirlvl->prcwidthexpn + pi->picomp->numrlvls >\n'}, {'line_no': 32, 'char_start': 746, 'char_end': 799, 'line': '\t\t\t\t pirlvl->prcheightexpn + pi->picomp->numrlvls >\n'}], 'added': [{'line_no': 30, 'char_start': 656, 'char_end': 70... | {'deleted': [{'char_start': 689, 'char_end': 693, 'chars': '->pi'}, {'char_start': 776, 'char_end': 780, 'chars': 'pi->'}], 'added': []} | github.com/mdadams/jasper/commit/f25486c3d4aa472fec79150f2c41ed4333395d3d | src/libjasper/jpc/jpc_t2cod.c | cwe-125 | 1,363 |
cwe-476 | avcodec_open2 | int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
{
int ret = 0;
int codec_init_ok = 0;
AVDictionary *tmp = NULL;
const AVPixFmtDescriptor *pixdesc;
if (avcodec_is_open(avctx))
return 0;
if ((!codec && !avctx->codec)) {
a... | int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
{
int ret = 0;
int codec_init_ok = 0;
AVDictionary *tmp = NULL;
const AVPixFmtDescriptor *pixdesc;
if (avcodec_is_open(avctx))
return 0;
if ((!codec && !avctx->codec)) {
a... | {'deleted': [{'line_no': 486, 'char_start': 20499, 'char_end': 20523, 'line': ' if (avctx->codec &&\n'}], 'added': [{'line_no': 486, 'char_start': 20499, 'char_end': 20546, 'line': ' if (avctx->codec && avctx->codec->close &&\n'}]} | {'deleted': [], 'added': [{'char_start': 20522, 'char_end': 20545, 'chars': ' avctx->codec->close &&'}]} | github.com/FFmpeg/FFmpeg/commit/8df6884832ec413cf032dfaa45c23b1c7876670c | libavcodec/utils.c | cwe-476 | 5,416 |
cwe-089 | top_proxies | @app.route('/top_proxies')
def top_proxies():
con = psycopg2.connect(**config.POSTGRES)
cur = con.cursor()
query = "SELECT sum(amount) FROM holders"
cur.execute(query)
total = cur.fetchone()
total_votes = total[0]
query = "SELECT voting_as FROM holders WHERE voting_as<>'1.2.5' group by vot... | @app.route('/top_proxies')
def top_proxies():
con = psycopg2.connect(**config.POSTGRES)
cur = con.cursor()
query = "SELECT sum(amount) FROM holders"
cur.execute(query)
total = cur.fetchone()
total_votes = total[0]
query = "SELECT voting_as FROM holders WHERE voting_as<>'1.2.5' group by vot... | {'deleted': [{'line_no': 25, 'char_start': 551, 'char_end': 650, 'line': ' query = "SELECT account_name, amount FROM holders WHERE account_id=\'"+proxy_id+"\' LIMIT 1"\n'}, {'line_no': 26, 'char_start': 650, 'char_end': 677, 'line': ' cur.execute(query)\n'}, {'line_no': 39, 'char_start': 910, 'char_end': ... | {'deleted': [{'char_start': 626, 'char_end': 640, 'chars': '\'"+proxy_id+"\''}, {'char_start': 982, 'char_end': 996, 'chars': '\'"+proxy_id+"\''}], 'added': [{'char_start': 626, 'char_end': 628, 'chars': '%s'}, {'char_start': 663, 'char_end': 676, 'chars': ', (proxy_id,)'}, {'char_start': 983, 'char_end': 985, 'chars':... | github.com/VinChain/vinchain-python-api-backend/commit/b78088a551fbb712121269c6eb7f43ede120ff60 | api.py | cwe-089 | 429 |
cwe-089 | add_consumption_data_row | def add_consumption_data_row(self, ts, energy_used, power_used):
if power_used > 0:
query = '''
INSERT OR IGNORE INTO Consumption (
TimeStamp,
EnergyUsed,
PowerUsed
) VAL... | def add_consumption_data_row(self, ts, energy_used, power_used):
if power_used > 0:
query = '''
INSERT OR IGNORE INTO Consumption (
TimeStamp,
EnergyUsed,
PowerUsed
) VAL... | {'deleted': [{'line_no': 11, 'char_start': 326, 'char_end': 350, 'line': ' %s,\n'}, {'line_no': 12, 'char_start': 350, 'char_end': 374, 'line': ' %s,\n'}, {'line_no': 13, 'char_start': 374, 'char_end': 397, 'line': ' %s\n'}, {'line_no': 15, 'char_start': 416, 'ch... | {'deleted': [{'char_start': 346, 'char_end': 348, 'chars': '%s'}, {'char_start': 370, 'char_end': 372, 'chars': '%s'}, {'char_start': 394, 'char_end': 396, 'chars': '%s'}, {'char_start': 431, 'char_end': 444, 'chars': ' % (ts, 0, 0)'}, {'char_start': 586, 'char_end': 588, 'chars': '%s'}, {'char_start': 630, 'char_end':... | github.com/philipptrenz/s0-bridge/commit/269b48caa05377b7c58c3e6d1622a4429cb5ba65 | util/database.py | cwe-089 | 144 |
cwe-089 | get_current_state | def get_current_state(chat_id):
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(chat_id) + "'")
name = conn.fetchone()
if name != None:
return name[4]
else:
... | def get_current_state(chat_id):
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(chat_id),))
name = conn.fetchone()
if name != None:
return name[4]
else:
... | {'deleted': [{'line_no': 4, 'char_start': 159, 'char_end': 238, 'line': ' conn.execute("select * from users where chat_id = \'" + str(chat_id) + "\'")\n'}], 'added': [{'line_no': 4, 'char_start': 159, 'char_end': 234, 'line': ' conn.execute("select * from users where chat_id = ?", (str(chat_id),))\n'}]} | {'deleted': [{'char_start': 213, 'char_end': 214, 'chars': "'"}, {'char_start': 215, 'char_end': 217, 'chars': ' +'}, {'char_start': 230, 'char_end': 236, 'chars': ' + "\'"'}], 'added': [{'char_start': 213, 'char_end': 214, 'chars': '?'}, {'char_start': 215, 'char_end': 216, 'chars': ','}, {'char_start': 217, 'char_end... | github.com/lissrbay/codeforces_bot/commit/cc7f5143445a0030b1149ac60a65b1b1b9c92a90 | bot.py | cwe-089 | 85 |
cwe-125 | SyncExifProfile | MagickBooleanType SyncExifProfile(Image *image,StringInfo *profile)
{
#define MaxDirectoryStack 16
#define EXIF_DELIMITER "\n"
#define EXIF_NUM_FORMATS 12
#define TAG_EXIF_OFFSET 0x8769
#define TAG_INTEROP_OFFSET 0xa005
typedef struct _DirectoryInfo
{
unsigned char
*directory;
size_t
entr... | MagickBooleanType SyncExifProfile(Image *image,StringInfo *profile)
{
#define MaxDirectoryStack 16
#define EXIF_DELIMITER "\n"
#define EXIF_NUM_FORMATS 12
#define TAG_EXIF_OFFSET 0x8769
#define TAG_INTEROP_OFFSET 0xa005
typedef struct _DirectoryInfo
{
unsigned char
*directory;
size_t
entr... | {'deleted': [{'line_no': 125, 'char_start': 2750, 'char_end': 2792, 'line': ' if ((format-1) >= EXIF_NUM_FORMATS)\n'}], 'added': [{'line_no': 125, 'char_start': 2750, 'char_end': 2810, 'line': ' if ((format < 0) || ((format-1) >= EXIF_NUM_FORMATS))\n'}]} | {'deleted': [], 'added': [{'char_start': 2767, 'char_end': 2784, 'chars': ' < 0) || ((format'}, {'char_start': 2807, 'char_end': 2808, 'chars': ')'}]} | github.com/ImageMagick/ImageMagick/commit/a7bb158b7bedd1449a34432feb3a67c8f1873bfa | MagickCore/profile.c | cwe-125 | 1,540 |
cwe-125 | usb_get_bos_descriptor | int usb_get_bos_descriptor(struct usb_device *dev)
{
struct device *ddev = &dev->dev;
struct usb_bos_descriptor *bos;
struct usb_dev_cap_header *cap;
unsigned char *buffer;
int length, total_len, num, i;
int ret;
bos = kzalloc(sizeof(struct usb_bos_descriptor), GFP_KERNEL);
if (!bos)
return -ENOMEM;
/* Get... | int usb_get_bos_descriptor(struct usb_device *dev)
{
struct device *ddev = &dev->dev;
struct usb_bos_descriptor *bos;
struct usb_dev_cap_header *cap;
unsigned char *buffer;
int length, total_len, num, i;
int ret;
bos = kzalloc(sizeof(struct usb_bos_descriptor), GFP_KERNEL);
if (!bos)
return -ENOMEM;
/* Get... | {'deleted': [{'line_no': 55, 'char_start': 1313, 'char_end': 1338, 'line': '\t\tlength = cap->bLength;\n'}, {'line_no': 57, 'char_start': 1339, 'char_end': 1365, 'line': '\t\tif (total_len < length)\n'}], 'added': [{'line_no': 56, 'char_start': 1314, 'char_end': 1376, 'line': '\t\tif (total_len < sizeof(*cap) || total_... | {'deleted': [{'char_start': 1318, 'char_end': 1321, 'chars': 'gth'}, {'char_start': 1322, 'char_end': 1323, 'chars': '='}, {'char_start': 1327, 'char_end': 1343, 'chars': '->bLength;\n\n\t\tif'}, {'char_start': 1344, 'char_end': 1345, 'chars': '('}, {'char_start': 1357, 'char_end': 1358, 'chars': 'l'}], 'added': [{'cha... | github.com/torvalds/linux/commit/1c0edc3633b56000e18d82fc241e3995ca18a69e | drivers/usb/core/config.c | cwe-125 | 667 |
cwe-089 | stats | @bot.message_handler(commands=['stats'])
def stats(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()
settings.clo... | @bot.message_handler(commands=['stats'])
def stats(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()
settings.close()... | {'deleted': [{'line_no': 5, 'char_start': 190, 'char_end': 277, 'line': ' conn.execute("select * from users where chat_id = \'" + str(message.chat.id) + "\'")\n'}], 'added': [{'line_no': 5, 'char_start': 190, 'char_end': 273, 'line': ' conn.execute("select * from users where chat_id = ?", (str(message.chat.id),))... | {'deleted': [{'char_start': 244, 'char_end': 245, 'chars': "'"}, {'char_start': 246, 'char_end': 248, 'chars': ' +'}, {'char_start': 269, 'char_end': 275, 'chars': ' + "\'"'}], 'added': [{'char_start': 244, 'char_end': 245, 'chars': '?'}, {'char_start': 246, 'char_end': 247, 'chars': ','}, {'char_start': 248, 'char_end... | github.com/lissrbay/codeforces_bot/commit/cc7f5143445a0030b1149ac60a65b1b1b9c92a90 | bot.py | cwe-089 | 247 |
cwe-787 | input_csi_dispatch_sgr_colon | input_csi_dispatch_sgr_colon(struct input_ctx *ictx, u_int i)
{
struct grid_cell *gc = &ictx->cell.cell;
char *s = ictx->param_list[i].str, *copy, *ptr, *out;
int p[8];
u_int n;
const char *errstr;
for (n = 0; n < nitems(p); n++)
p[n] = -1;
n = 0;
ptr = copy = xstrdup(s);
while ((out = strsep(&ptr... | input_csi_dispatch_sgr_colon(struct input_ctx *ictx, u_int i)
{
struct grid_cell *gc = &ictx->cell.cell;
char *s = ictx->param_list[i].str, *copy, *ptr, *out;
int p[8];
u_int n;
const char *errstr;
for (n = 0; n < nitems(p); n++)
p[n] = -1;
n = 0;
ptr = copy = xstrdup(s);
while ((out = strsep(&ptr... | {'deleted': [{'line_no': 21, 'char_start': 485, 'char_end': 494, 'line': '\t\t} else\n'}], 'added': [{'line_no': 21, 'char_start': 485, 'char_end': 496, 'line': '\t\t} else {\n'}, {'line_no': 23, 'char_start': 504, 'char_end': 529, 'line': '\t\t\tif (n == nitems(p)) {\n'}, {'line_no': 24, 'char_start': 529, 'char_end':... | {'deleted': [], 'added': [{'char_start': 493, 'char_end': 495, 'chars': ' {'}, {'char_start': 503, 'char_end': 565, 'chars': '\n\t\t\tif (n == nitems(p)) {\n\t\t\t\tfree(copy);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}'}]} | github.com/tmux/tmux/commit/a868bacb46e3c900530bed47a1c6f85b0fbe701c | input.c | cwe-787 | 636 |
cwe-416 | __ns_get_path | static void *__ns_get_path(struct path *path, struct ns_common *ns)
{
struct vfsmount *mnt = nsfs_mnt;
struct qstr qname = { .name = "", };
struct dentry *dentry;
struct inode *inode;
unsigned long d;
rcu_read_lock();
d = atomic_long_read(&ns->stashed);
if (!d)
goto slow;
dentry = (struct dentry *)d;
if (!... | static void *__ns_get_path(struct path *path, struct ns_common *ns)
{
struct vfsmount *mnt = nsfs_mnt;
struct qstr qname = { .name = "", };
struct dentry *dentry;
struct inode *inode;
unsigned long d;
rcu_read_lock();
d = atomic_long_read(&ns->stashed);
if (!d)
goto slow;
dentry = (struct dentry *)d;
if (!... | {'deleted': [], 'added': [{'line_no': 42, 'char_start': 985, 'char_end': 1023, 'line': '\tdentry->d_flags |= DCACHE_RCUACCESS;\n'}]} | {'deleted': [], 'added': [{'char_start': 997, 'char_end': 1035, 'chars': 'lags |= DCACHE_RCUACCESS;\n\tdentry->d_f'}]} | github.com/torvalds/linux/commit/073c516ff73557a8f7315066856c04b50383ac34 | fs/nsfs.c | cwe-416 | 399 |
cwe-125 | WriteTIFFImage | static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
Image *image)
{
const char
*mode,
*option;
CompressionType
compression;
EndianType
endian_type;
MagickBooleanType
debug,
status;
MagickOffsetType
scene;
QuantumInfo
*quantum_info;
QuantumType
q... | static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
Image *image)
{
const char
*mode,
*option;
CompressionType
compression;
EndianType
endian_type;
MagickBooleanType
debug,
status;
MagickOffsetType
scene;
QuantumInfo
*quantum_info;
QuantumType
q... | {'deleted': [{'line_no': 893, 'char_start': 30340, 'char_end': 30392, 'line': ' if (image->exception.severity > ErrorException)\n'}, {'line_no': 894, 'char_start': 30392, 'char_end': 30405, 'line': ' break;\n'}, {'line_no': 899, 'char_start': 30549, 'char_end': 30586, 'line': ' (void) TIFFWriteDirectory(tiff... | {'deleted': [{'char_start': 30340, 'char_end': 30405, 'chars': ' if (image->exception.severity > ErrorException)\n break;\n'}, {'char_start': 30553, 'char_end': 30556, 'chars': '(vo'}, {'char_start': 30557, 'char_end': 30559, 'chars': 'd)'}, {'char_start': 30863, 'char_end': 30880, 'chars': 'image->exception.'}... | github.com/ImageMagick/ImageMagick6/commit/3c53413eb544cc567309b4c86485eae43e956112 | coders/tiff.c | cwe-125 | 7,681 |
cwe-089 | __init__.callback | def callback(recipeName):
menu.pack_forget()
viewRecipeFrame.pack(expand=True, fill='both')
groceryButton.pack_forget()
database_file = "meal_planner.db"
print(recipeName)
with sqlite3.connect(database_file) as conn:
cursor ... | def callback(recipeName):
menu.pack_forget()
viewRecipeFrame.pack(expand=True, fill='both')
groceryButton.pack_forget()
database_file = "meal_planner.db"
print(recipeName)
with sqlite3.connect(database_file) as conn:
cursor ... | {'deleted': [{'line_no': 9, 'char_start': 336, 'char_end': 448, 'line': ' selection = cursor.execute("""SELECT * FROM recipe WHERE name = """ + "\\"" + recipeName + "\\"")\n'}], 'added': [{'line_no': 9, 'char_start': 336, 'char_end': 439, 'line': ' selection = cursor.execute("""SELECT * FR... | {'deleted': [{'char_start': 419, 'char_end': 421, 'chars': ' +'}, {'char_start': 422, 'char_end': 429, 'chars': '"\\"" + '}, {'char_start': 439, 'char_end': 441, 'chars': ' +'}, {'char_start': 442, 'char_end': 446, 'chars': '"\\""'}], 'added': [{'char_start': 416, 'char_end': 418, 'chars': '?;'}, {'char_start': 421, 'c... | github.com/trishamoyer/RecipePlanner-Python/commit/44d2ce370715d9344fad34b3b749322ab095a925 | mealPlan.py | cwe-089 | 377 |
cwe-190 | ImagingLibTiffDecode | int ImagingLibTiffDecode(Imaging im, ImagingCodecState state, UINT8* buffer, Py_ssize_t bytes) {
TIFFSTATE *clientstate = (TIFFSTATE *)state->context;
char *filename = "tempfile.tif";
char *mode = "r";
TIFF *tiff;
/* buffer is the encoded file, bytes is the length of the encoded file */
/* ... | int ImagingLibTiffDecode(Imaging im, ImagingCodecState state, UINT8* buffer, Py_ssize_t bytes) {
TIFFSTATE *clientstate = (TIFFSTATE *)state->context;
char *filename = "tempfile.tif";
char *mode = "r";
TIFF *tiff;
/* buffer is the encoded file, bytes is the length of the encoded file */
/* ... | {'deleted': [{'line_no': 76, 'char_start': 3145, 'char_end': 3197, 'line': ' state->bytes = row_byte_size * tile_length;\n'}, {'line_no': 78, 'char_start': 3198, 'char_end': 3238, 'line': ' /* overflow check for malloc */\n'}, {'line_no': 79, 'char_start': 3238, 'char_end': 3280, 'line': ' if (stat... | {'deleted': [{'char_start': 3145, 'char_end': 3197, 'chars': ' state->bytes = row_byte_size * tile_length;\n'}, {'char_start': 3228, 'char_end': 3229, 'chars': 'm'}, {'char_start': 3250, 'char_end': 3265, 'chars': 'state->bytes > '}, {'char_start': 3273, 'char_end': 3274, 'chars': '-'}, {'char_start': 3275, 'cha... | github.com/python-pillow/Pillow/commit/4e2def2539ec13e53a82e06c4b3daf00454100c4 | src/libImaging/TiffDecode.c | cwe-190 | 1,977 |
cwe-787 | make_canonical | make_canonical(struct ly_ctx *ctx, int type, const char **value, void *data1, void *data2)
{
const uint16_t buf_len = 511;
char buf[buf_len + 1];
struct lys_type_bit **bits = NULL;
struct lyxp_expr *exp;
const char *module_name, *cur_expr, *end;
int i, j, count;
int64_t num;
uint64_t unu... | make_canonical(struct ly_ctx *ctx, int type, const char **value, void *data1, void *data2)
{
const uint16_t buf_len = 511;
char buf[buf_len + 1];
struct lys_type_bit **bits = NULL;
struct lyxp_expr *exp;
const char *module_name, *cur_expr, *end;
int i, j, count;
int64_t num;
uint64_t unu... | {'deleted': [], 'added': [{'line_no': 40, 'char_start': 1335, 'char_end': 1440, 'line': ' LY_CHECK_ERR_RETURN(strlen(module_name) + 1 + strlen(*value) > buf_len, LOGBUF(*value), -1);\n'}, {'line_no': 43, 'char_start': 1513, 'char_end': 1592, 'line': ' LY_CHECK_ERR_RETURN(strlen(*value) > buf_len, ... | {'deleted': [], 'added': [{'char_start': 1347, 'char_end': 1452, 'chars': 'LY_CHECK_ERR_RETURN(strlen(module_name) + 1 + strlen(*value) > buf_len, LOGBUF(*value), -1);\n '}, {'char_start': 1512, 'char_end': 1591, 'chars': '\n LY_CHECK_ERR_RETURN(strlen(*value) > buf_len, LOGBUF(*value), -1);'}]} | github.com/CESNET/libyang/commit/6980afae2ff9fcd6d67508b0a3f694d75fd059d6 | src/parser.c | cwe-787 | 1,424 |
cwe-476 | AP4_AtomSampleTable::GetSample | AP4_AtomSampleTable::GetSample(AP4_Ordinal index,
AP4_Sample& sample)
{
AP4_Result result;
// check that we have an stsc atom
if (!m_StscAtom) {
return AP4_ERROR_INVALID_FORMAT;
}
// check that we have a chunk offset table
if (m_StcoAtom == NULL && m... | AP4_AtomSampleTable::GetSample(AP4_Ordinal index,
AP4_Sample& sample)
{
AP4_Result result;
// check that we have an stsc atom
if (!m_StscAtom) {
return AP4_ERROR_INVALID_FORMAT;
}
// check that we have a chunk offset table
if (m_StcoAtom == NULL && m... | {'deleted': [{'line_no': 59, 'char_start': 1780, 'char_end': 1836, 'line': ' result = m_SttsAtom->GetDts(index, dts, &duration);\n'}, {'line_no': 60, 'char_start': 1836, 'char_end': 1879, 'line': ' if (AP4_FAILED(result)) return result;\n'}], 'added': [{'line_no': 59, 'char_start': 1780, 'char_end': 1802, 'line':... | {'deleted': [], 'added': [{'char_start': 1784, 'char_end': 1810, 'chars': 'if (m_SttsAtom) {\n '}, {'char_start': 1866, 'char_end': 1870, 'chars': ' '}, {'char_start': 1908, 'char_end': 1914, 'chars': '\n }'}]} | github.com/axiomatic-systems/Bento4/commit/2f267f89f957088197f4b1fc254632d1645b415d | Source/C++/Core/Ap4AtomSampleTable.cpp | cwe-476 | 791 |
cwe-476 | ReadPSDChannel | static MagickBooleanType ReadPSDChannel(Image *image,
const ImageInfo *image_info,const PSDInfo *psd_info,LayerInfo* layer_info,
const size_t channel,const PSDCompressionType compression,
ExceptionInfo *exception)
{
Image
*channel_image,
*mask;
MagickOffsetType
offset;
MagickBooleanType
st... | static MagickBooleanType ReadPSDChannel(Image *image,
const ImageInfo *image_info,const PSDInfo *psd_info,LayerInfo* layer_info,
const size_t channel,const PSDCompressionType compression,
ExceptionInfo *exception)
{
Image
*channel_image,
*mask;
MagickOffsetType
offset;
MagickBooleanType
st... | {'deleted': [{'line_no': 36, 'char_start': 1110, 'char_end': 1141, 'line': ' mask->matte=MagickFalse;\n'}, {'line_no': 37, 'char_start': 1141, 'char_end': 1167, 'line': ' channel_image=mask;\n'}], 'added': [{'line_no': 36, 'char_start': 1110, 'char_end': 1144, 'line': ' if (mask != (Image *) NULL)\n'}, {... | {'deleted': [], 'added': [{'char_start': 1116, 'char_end': 1164, 'chars': 'if (mask != (Image *) NULL)\n {\n '}, {'char_start': 1195, 'char_end': 1199, 'chars': ' '}, {'char_start': 1218, 'char_end': 1228, 'chars': '\n }'}]} | github.com/ImageMagick/ImageMagick/commit/7f2dc7a1afc067d0c89f12c82bcdec0445fb1b94 | coders/psd.c | cwe-476 | 705 |
cwe-476 | generatePreview | generatePreview (const char inFileName[],
float exposure,
int previewWidth,
int &previewHeight,
Array2D <PreviewRgba> &previewPixels)
{
//
// Read the input file
//
RgbaInputFile in (inFileName);
Box2i dw = in.dataWindow();
float a = in.pixelAspectRatio();
int w = dw.max.x - dw... | generatePreview (const char inFileName[],
float exposure,
int previewWidth,
int &previewHeight,
Array2D <PreviewRgba> &previewPixels)
{
//
// Read the input file
//
RgbaInputFile in (inFileName);
Box2i dw = in.dataWindow();
float a = in.pixelAspectRatio();
int w = dw.max.x - dw... | {'deleted': [{'line_no': 29, 'char_start': 689, 'char_end': 767, 'line': ' float fx = (previewWidth > 0)? (float (w - 1) / (previewWidth - 1)): 1;\n'}, {'line_no': 30, 'char_start': 767, 'char_end': 845, 'line': ' float fy = (previewHeight > 0)? (float (h - 1) / (previewHeight - 1)): 1;\n'}], 'added': [{'line_n... | {'deleted': [{'char_start': 721, 'char_end': 722, 'chars': '0'}, {'char_start': 799, 'char_end': 800, 'chars': '0'}], 'added': [{'char_start': 721, 'char_end': 722, 'chars': '1'}, {'char_start': 799, 'char_end': 800, 'chars': '1'}]} | github.com/AcademySoftwareFoundation/openexr/commit/74504503cff86e986bac441213c403b0ba28d58f | OpenEXR/exrmakepreview/makePreview.cpp | cwe-476 | 462 |
cwe-476 | changedline | static int changedline (const Proto *p, int oldpc, int newpc) {
while (oldpc++ < newpc) {
if (p->lineinfo[oldpc] != 0)
return (luaG_getfuncline(p, oldpc - 1) != luaG_getfuncline(p, newpc));
}
return 0; /* no line changes in the way */
} | static int changedline (const Proto *p, int oldpc, int newpc) {
if (p->lineinfo == NULL) /* no debug information? */
return 0;
while (oldpc++ < newpc) {
if (p->lineinfo[oldpc] != 0)
return (luaG_getfuncline(p, oldpc - 1) != luaG_getfuncline(p, newpc));
}
return 0; /* no line changes between posi... | {'deleted': [{'line_no': 6, 'char_start': 206, 'char_end': 252, 'line': ' return 0; /* no line changes in the way */\n'}], 'added': [{'line_no': 2, 'char_start': 64, 'char_end': 120, 'line': ' if (p->lineinfo == NULL) /* no debug information? */\n'}, {'line_no': 3, 'char_start': 120, 'char_end': 134, 'line': ' r... | {'deleted': [{'char_start': 238, 'char_end': 239, 'chars': 'i'}, {'char_start': 242, 'char_end': 248, 'chars': 'he way'}], 'added': [{'char_start': 66, 'char_end': 136, 'chars': 'if (p->lineinfo == NULL) /* no debug information? */\n return 0;\n '}, {'char_start': 308, 'char_end': 310, 'chars': 'be'}, {'char_start... | github.com/lua/lua/commit/ae5b5ba529753c7a653901ffc29b5ea24c3fdf3a | ldebug.c | cwe-476 | 89 |
cwe-416 | usb_sg_cancel | void usb_sg_cancel(struct usb_sg_request *io)
{
unsigned long flags;
int i, retval;
spin_lock_irqsave(&io->lock, flags);
if (io->status) {
spin_unlock_irqrestore(&io->lock, flags);
return;
}
/* shut everything down */
io->status = -ECONNRESET;
spin_unlock_irqrestore(&io->lock, flags);
for (i = io->entrie... | void usb_sg_cancel(struct usb_sg_request *io)
{
unsigned long flags;
int i, retval;
spin_lock_irqsave(&io->lock, flags);
if (io->status || io->count == 0) {
spin_unlock_irqrestore(&io->lock, flags);
return;
}
/* shut everything down */
io->status = -ECONNRESET;
io->count++; /* Keep the request alive until... | {'deleted': [{'line_no': 7, 'char_start': 125, 'char_end': 144, 'line': '\tif (io->status) {\n'}], 'added': [{'line_no': 7, 'char_start': 125, 'char_end': 162, 'line': '\tif (io->status || io->count == 0) {\n'}, {'line_no': 13, 'char_start': 274, 'char_end': 335, 'line': "\tio->count++;\t\t/* Keep the request alive unt... | {'deleted': [], 'added': [{'char_start': 140, 'char_end': 158, 'chars': ' || io->count == 0'}, {'char_start': 273, 'char_end': 334, 'chars': "\n\tio->count++;\t\t/* Keep the request alive until we're done */"}, {'char_start': 677, 'char_end': 817, 'chars': '\n\n\tspin_lock_irqsave(&io->lock, flags);\n\tio->count--;\n\t... | github.com/torvalds/linux/commit/056ad39ee9253873522f6469c3364964a322912b | drivers/usb/core/message.c | cwe-416 | 193 |
cwe-416 | hci_uart_set_proto | static int hci_uart_set_proto(struct hci_uart *hu, int id)
{
const struct hci_uart_proto *p;
int err;
p = hci_uart_get_proto(id);
if (!p)
return -EPROTONOSUPPORT;
hu->proto = p;
set_bit(HCI_UART_PROTO_READY, &hu->flags);
err = hci_uart_register_dev(hu);
if (err) {
clear_bit(HCI_UART_PROTO_READY, &hu->fla... | static int hci_uart_set_proto(struct hci_uart *hu, int id)
{
const struct hci_uart_proto *p;
int err;
p = hci_uart_get_proto(id);
if (!p)
return -EPROTONOSUPPORT;
hu->proto = p;
err = hci_uart_register_dev(hu);
if (err) {
return err;
}
set_bit(HCI_UART_PROTO_READY, &hu->flags);
return 0;
} | {'deleted': [{'line_no': 11, 'char_start': 187, 'char_end': 231, 'line': '\tset_bit(HCI_UART_PROTO_READY, &hu->flags);\n'}, {'line_no': 15, 'char_start': 278, 'char_end': 325, 'line': '\t\tclear_bit(HCI_UART_PROTO_READY, &hu->flags);\n'}], 'added': [{'line_no': 17, 'char_start': 252, 'char_end': 296, 'line': '\tset_bit... | {'deleted': [{'char_start': 187, 'char_end': 231, 'chars': '\tset_bit(HCI_UART_PROTO_READY, &hu->flags);\n'}, {'char_start': 280, 'char_end': 282, 'chars': 'cl'}, {'char_start': 283, 'char_end': 284, 'chars': 'a'}, {'char_start': 324, 'char_end': 342, 'chars': '\n\t\treturn err;\n\t}\n'}], 'added': [{'char_start': 236,... | github.com/torvalds/linux/commit/56897b217a1d0a91c9920cb418d6b3fe922f590a | drivers/bluetooth/hci_ldisc.c | cwe-416 | 112 |
cwe-078 | test_create_host | def test_create_host(self):
self.flags(lock_path=self.tempdir)
#record
self.clear_mox()
self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "get_cpg",
self.fake_get_cpg)
self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "get_domain",
sel... | def test_create_host(self):
self.flags(lock_path=self.tempdir)
#record
self.clear_mox()
self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "get_cpg",
self.fake_get_cpg)
self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "get_domain",
sel... | {'deleted': [{'line_no': 13, 'char_start': 497, 'char_end': 550, 'line': " show_host_cmd = 'showhost -verbose fakehost'\n"}, {'line_no': 16, 'char_start': 631, 'char_end': 698, 'line': " create_host_cmd = ('createhost -iscsi -persona 1 -domain '\n"}, {'line_no': 17, 'char_start': 698, 'char_end': 745, 'li... | {'deleted': [{'char_start': 695, 'char_end': 696, 'chars': ' '}, {'char_start': 725, 'char_end': 726, 'chars': "'"}, {'char_start': 727, 'char_end': 728, 'chars': '\\'}, {'char_start': 738, 'char_end': 739, 'chars': '\\'}, {'char_start': 772, 'char_end': 781, 'chars': "'fakehost"}], 'added': [{'char_start': 521, 'char_... | github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f | cinder/tests/test_hp3par.py | cwe-078 | 285 |
cwe-089 | also_add | def also_add(name, also):
db = db_connect()
cursor = db.cursor()
try:
cursor.execute('''
INSERT INTO isalso(name,also) VALUES('{}','{}')
'''.format(name, also))
db.commit()
logger.debug('added to isalso name {} with value {}'.format(
name, also))
... | def also_add(name, also):
db = db_connect()
cursor = db.cursor()
try:
cursor.execute('''
INSERT INTO isalso(name,also) VALUES(%(name)s,%(also)s)
''', (
name,
also,
))
db.commit()
logger.debug('added to isalso name {} with value ... | {'deleted': [{'line_no': 6, 'char_start': 109, 'char_end': 169, 'line': " INSERT INTO isalso(name,also) VALUES('{}','{}')\n"}, {'line_no': 7, 'char_start': 169, 'char_end': 205, 'line': " '''.format(name, also))\n"}], 'added': [{'line_no': 6, 'char_start': 109, 'char_end': 177, 'line': ' ... | {'deleted': [{'char_start': 158, 'char_end': 162, 'chars': "'{}'"}, {'char_start': 163, 'char_end': 167, 'chars': "'{}'"}, {'char_start': 184, 'char_end': 191, 'chars': '.format'}], 'added': [{'char_start': 158, 'char_end': 166, 'chars': '%(name)s'}, {'char_start': 167, 'char_end': 175, 'chars': '%(also)s'}, {'char_sta... | github.com/tylarb/KarmaBoi-PCF/commit/c1d00a27d7f6b7eb6f15a3dacd4269654a32c10a | KarmaBoi/dbopts.py | cwe-089 | 98 |
cwe-079 | edit_workflow | @check_document_access_permission()
def edit_workflow(request):
workflow_id = request.GET.get('workflow')
if workflow_id:
wid = {}
if workflow_id.isdigit():
wid['id'] = workflow_id
else:
wid['uuid'] = workflow_id
doc = Document2.objects.get(type='oozie-workflow2', **wid)
workflow ... | @check_document_access_permission()
def edit_workflow(request):
workflow_id = request.GET.get('workflow')
if workflow_id:
wid = {}
if workflow_id.isdigit():
wid['id'] = workflow_id
else:
wid['uuid'] = workflow_id
doc = Document2.objects.get(type='oozie-workflow2', **wid)
workflow ... | {'deleted': [{'line_no': 30, 'char_start': 743, 'char_end': 801, 'line': " 'layout_json': json.dumps(workflow_data['layout']),\n"}, {'line_no': 31, 'char_start': 801, 'char_end': 863, 'line': " 'workflow_json': json.dumps(workflow_data['workflow']),\n"}, {'line_no': 32, 'char_start': 863, 'char_end': 933, 'li... | {'deleted': [], 'added': [{'char_start': 798, 'char_end': 822, 'chars': ', cls=JSONEncoderForHTML'}, {'char_start': 884, 'char_end': 908, 'chars': ', cls=JSONEncoderForHTML'}, {'char_start': 978, 'char_end': 1002, 'chars': ', cls=JSONEncoderForHTML'}, {'char_start': 1074, 'char_end': 1098, 'chars': ', cls=JSONEncoderFo... | github.com/gethue/hue/commit/6641c62beaa1468082e47d82da5ed758d11c7735 | apps/oozie/src/oozie/views/editor2.py | cwe-079 | 284 |
cwe-190 | Perl_re_op_compile | REGEXP *
Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
OP *expr, const regexp_engine* eng, REGEXP *old_re,
bool *is_bare_re, const U32 orig_rx_flags, const U32 pm_flags)
{
dVAR;
REGEXP *Rx; /* Capital 'R' means points to a REGEXP */
STRLEN plen;
char *exp;
regnod... | REGEXP *
Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
OP *expr, const regexp_engine* eng, REGEXP *old_re,
bool *is_bare_re, const U32 orig_rx_flags, const U32 pm_flags)
{
dVAR;
REGEXP *Rx; /* Capital 'R' means points to a REGEXP */
STRLEN plen;
char *exp;
regnod... | {'deleted': [], 'added': [{'line_no': 381, 'char_start': 12024, 'char_end': 12025, 'line': '\n'}, {'line_no': 382, 'char_start': 12025, 'char_end': 12103, 'line': ' /* XXX For backporting, use long jumps if there is any possibility of\n'}, {'line_no': 383, 'char_start': 12103, 'char_end': 12126, 'line': ' ... | {'deleted': [], 'added': [{'char_start': 12024, 'char_end': 12266, 'chars': '\n /* XXX For backporting, use long jumps if there is any possibility of\n * overflow */\n if (RExC_size > U16_MAX && ! RExC_use_BRANCHJ) {\n RExC_use_BRANCHJ = TRUE;\n flags |= RESTART_PARSE;\n ... | github.com/perl/perl5/commit/3295b48defa0f8570114877b063fe546dd348b3c | regcomp.c | cwe-190 | 10,428 |
cwe-022 | Utility::UnZip | bool Utility::UnZip(const QString &zippath, const QString &destpath)
{
int res = 0;
QDir dir(destpath);
if (!cp437) {
cp437 = new QCodePage437Codec();
}
#ifdef Q_OS_WIN32
zlib_filefunc64_def ffunc;
fill_win32_filefunc64W(&ffunc);
unzFile zfile = unzOpen2_64(Utility::QStringToStdWStri... | bool Utility::UnZip(const QString &zippath, const QString &destpath)
{
int res = 0;
QDir dir(destpath);
if (!cp437) {
cp437 = new QCodePage437Codec();
}
#ifdef Q_OS_WIN32
zlib_filefunc64_def ffunc;
fill_win32_filefunc64W(&ffunc);
unzFile zfile = unzOpen2_64(Utility::QStringToStdWStri... | {'deleted': [], 'added': [{'line_no': 39, 'char_start': 1400, 'char_end': 1401, 'line': '\n'}, {'line_no': 46, 'char_start': 1800, 'char_end': 1801, 'line': '\n'}, {'line_no': 47, 'char_start': 1801, 'char_end': 1846, 'line': '\t QString original_path = qfile_name;\n'}, {'line_no': 48, 'char_start': 1846, 'char_... | {'deleted': [], 'added': [{'char_start': 1400, 'char_end': 2937, 'chars': '\n\t // for security reasons against maliciously crafted zip archives\n\t // we need the file path to always be inside the target folder \n\t // and not outside, so we will remove all illegal backslashes\n\t // and al... | github.com/Sigil-Ebook/Sigil/commit/0979ba8d10c96ebca330715bfd4494ea0e019a8f | src/Misc/Utility.cpp | cwe-022 | 928 |
cwe-190 | ApplyEvaluateOperator | static MagickRealType ApplyEvaluateOperator(RandomInfo *random_info,
const Quantum pixel,const MagickEvaluateOperator op,
const MagickRealType value)
{
MagickRealType
result;
result=0.0;
switch (op)
{
case UndefinedEvaluateOperator:
break;
case AbsEvaluateOperator:
{
result=(Mag... | static MagickRealType ApplyEvaluateOperator(RandomInfo *random_info,
const Quantum pixel,const MagickEvaluateOperator op,
const MagickRealType value)
{
MagickRealType
result;
result=0.0;
switch (op)
{
case UndefinedEvaluateOperator:
break;
case AbsEvaluateOperator:
{
result=(Mag... | {'deleted': [{'line_no': 37, 'char_start': 975, 'char_end': 1046, 'line': ' result=(MagickRealType) ((size_t) pixel & (size_t) (value+0.5));\n'}, {'line_no': 77, 'char_start': 2060, 'char_end': 2132, 'line': ' result=(MagickRealType) ((size_t) pixel << (size_t) (value+0.5));\n'}, {'line_no': 120, 'char_start'... | {'deleted': [], 'added': [{'char_start': 1008, 'char_end': 1009, 'chars': 's'}, {'char_start': 1025, 'char_end': 1026, 'chars': 's'}, {'char_start': 2095, 'char_end': 2096, 'chars': 's'}, {'char_start': 2113, 'char_end': 2114, 'chars': 's'}, {'char_start': 3194, 'char_end': 3195, 'chars': 's'}, {'char_start': 3211, 'ch... | github.com/ImageMagick/ImageMagick6/commit/3e21bc8a58b4ae38d24c7e283837cc279f35b6a5 | magick/statistic.c | cwe-190 | 1,303 |
cwe-079 | nav_path | def nav_path(request):
"""Return current path as list of items with "name" and "href" members
The href members are view_directory links for directories and view_log
links for files, but are set to None when the link would point to
the current view"""
if not request.repos:
return []
is_dir = request.p... | def nav_path(request):
"""Return current path as list of items with "name" and "href" members
The href members are view_directory links for directories and view_log
links for files, but are set to None when the link would point to
the current view"""
if not request.repos:
return []
is_dir = request.p... | {'deleted': [{'line_no': 28, 'char_start': 897, 'char_end': 936, 'line': ' item = _item(name=part, href=None)\n'}], 'added': [{'line_no': 28, 'char_start': 897, 'char_end': 959, 'line': ' item = _item(name=request.server.escape(part), href=None)\n'}]} | {'deleted': [], 'added': [{'char_start': 919, 'char_end': 941, 'chars': 'request.server.escape('}, {'char_start': 945, 'char_end': 946, 'chars': ')'}]} | github.com/viewvc/viewvc/commit/9dcfc7daa4c940992920d3b2fbd317da20e44aad | lib/viewvc.py | cwe-079 | 330 |
cwe-476 | handle_client_startup | static bool handle_client_startup(PgSocket *client, PktHdr *pkt)
{
const char *passwd;
const uint8_t *key;
bool ok;
SBuf *sbuf = &client->sbuf;
/* don't tolerate partial packets */
if (incomplete_pkt(pkt)) {
disconnect_client(client, true, "client sent partial pkt in startup phase");
return false;
}
if (... | static bool handle_client_startup(PgSocket *client, PktHdr *pkt)
{
const char *passwd;
const uint8_t *key;
bool ok;
SBuf *sbuf = &client->sbuf;
/* don't tolerate partial packets */
if (incomplete_pkt(pkt)) {
disconnect_client(client, true, "client sent partial pkt in startup phase");
return false;
}
if (... | {'deleted': [], 'added': [{'line_no': 63, 'char_start': 1457, 'char_end': 1475, 'line': '\t\t/* too early */\n'}, {'line_no': 64, 'char_start': 1475, 'char_end': 1503, 'line': '\t\tif (!client->auth_user) {\n'}, {'line_no': 65, 'char_start': 1503, 'char_end': 1584, 'line': '\t\t\tdisconnect_client(client, true, "client... | {'deleted': [], 'added': [{'char_start': 1462, 'char_end': 1611, 'chars': 'too early */\n\t\tif (!client->auth_user) {\n\t\t\tdisconnect_client(client, true, "client password pkt before startup packet");\n\t\t\treturn false;\n\t\t}\n\n\t\t/* '}]} | github.com/pgbouncer/pgbouncer/commit/74d6e5f7de5ec736f71204b7b422af7380c19ac5 | src/client.c | cwe-476 | 656 |
cwe-476 | exprListAppendList | static ExprList *exprListAppendList(
Parse *pParse, /* Parsing context */
ExprList *pList, /* List to which to append. Might be NULL */
ExprList *pAppend, /* List of values to append. Might be NULL */
int bIntToNull
){
if( pAppend ){
int i;
int nInit = pList ? pList->nExpr : 0;
... | static ExprList *exprListAppendList(
Parse *pParse, /* Parsing context */
ExprList *pList, /* List to which to append. Might be NULL */
ExprList *pAppend, /* List of values to append. Might be NULL */
int bIntToNull
){
if( pAppend ){
int i;
int nInit = pList ? pList->nExpr : 0;
... | {'deleted': [], 'added': [{'line_no': 12, 'char_start': 426, 'char_end': 490, 'line': ' assert( pDup==0 || !ExprHasProperty(pDup, EP_MemToken) );\n'}, {'line_no': 16, 'char_start': 634, 'char_end': 662, 'line': ' pDup->u.zToken = 0;\n'}]} | {'deleted': [], 'added': [{'char_start': 432, 'char_end': 496, 'chars': 'assert( pDup==0 || !ExprHasProperty(pDup, EP_MemToken) );\n '}, {'char_start': 632, 'char_end': 660, 'chars': ';\n pDup->u.zToken = 0'}]} | github.com/sqlite/sqlite/commit/75e95e1fcd52d3ec8282edb75ac8cd0814095d54 | src/window.c | cwe-476 | 238 |
cwe-787 | cbs_jpeg_split_fragment | static int cbs_jpeg_split_fragment(CodedBitstreamContext *ctx,
CodedBitstreamFragment *frag,
int header)
{
AVBufferRef *data_ref;
uint8_t *data;
size_t data_size;
int unit, start, end, marker, next_start, next_marker;
int err, i, ... | static int cbs_jpeg_split_fragment(CodedBitstreamContext *ctx,
CodedBitstreamFragment *frag,
int header)
{
AVBufferRef *data_ref;
uint8_t *data;
size_t data_size;
int unit, start, end, marker, next_start, next_marker;
int err, i, ... | {'deleted': [], 'added': [{'line_no': 95, 'char_start': 3398, 'char_end': 3436, 'line': ' if (length > end - start)\n'}, {'line_no': 96, 'char_start': 3436, 'char_end': 3480, 'line': ' return AVERROR_INVALIDDATA;\n'}, {'line_no': 97, 'char_start': 3480, 'char_end': 3481, 'line': '\n'}]} | {'deleted': [], 'added': [{'char_start': 3410, 'char_end': 3493, 'chars': 'if (length > end - start)\n return AVERROR_INVALIDDATA;\n\n '}]} | github.com/FFmpeg/FFmpeg/commit/1812352d767ccf5431aa440123e2e260a4db2726 | libavcodec/cbs_jpeg.c | cwe-787 | 1,126 |
cwe-078 | _add_chapsecret_to_host | def _add_chapsecret_to_host(self, host_name):
"""Generate and store a randomly-generated CHAP secret for the host."""
chap_secret = utils.generate_password()
ssh_cmd = ('svctask chhost -chapsecret "%(chap_secret)s" %(host_name)s'
% {'chap_secret': chap_secret, 'host_name'... | def _add_chapsecret_to_host(self, host_name):
"""Generate and store a randomly-generated CHAP secret for the host."""
chap_secret = utils.generate_password()
ssh_cmd = ['svctask', 'chhost', '-chapsecret', chap_secret, host_name]
out, err = self._run_ssh(ssh_cmd)
# No output ... | {'deleted': [{'line_no': 5, 'char_start': 179, 'char_end': 259, 'line': ' ssh_cmd = (\'svctask chhost -chapsecret "%(chap_secret)s" %(host_name)s\'\n'}, {'line_no': 6, 'char_start': 259, 'char_end': 334, 'line': " % {'chap_secret': chap_secret, 'host_name': host_name})\n"}], 'added': [{'line_no... | {'deleted': [{'char_start': 197, 'char_end': 198, 'chars': '('}, {'char_start': 206, 'char_end': 225, 'chars': ' chhost -chapsecret'}, {'char_start': 226, 'char_end': 229, 'chars': '"%('}, {'char_start': 231, 'char_end': 246, 'chars': 'ap_secret)s" %('}, {'char_start': 250, 'char_end': 257, 'chars': '_name)s'}, {'char_... | github.com/thatsdone/cinder/commit/f752302d181583a95cf44354aea607ce9d9283f4 | cinder/volume/drivers/storwize_svc.py | cwe-078 | 136 |
cwe-416 | PHP_MINIT_FUNCTION | PHP_MINIT_FUNCTION(spl_array)
{
REGISTER_SPL_STD_CLASS_EX(ArrayObject, spl_array_object_new, spl_funcs_ArrayObject);
REGISTER_SPL_IMPLEMENTS(ArrayObject, Aggregate);
REGISTER_SPL_IMPLEMENTS(ArrayObject, ArrayAccess);
REGISTER_SPL_IMPLEMENTS(ArrayObject, Serializable);
REGISTER_SPL_IMPLEMENTS(ArrayObject, Countable... | PHP_MINIT_FUNCTION(spl_array)
{
REGISTER_SPL_STD_CLASS_EX(ArrayObject, spl_array_object_new, spl_funcs_ArrayObject);
REGISTER_SPL_IMPLEMENTS(ArrayObject, Aggregate);
REGISTER_SPL_IMPLEMENTS(ArrayObject, ArrayAccess);
REGISTER_SPL_IMPLEMENTS(ArrayObject, Serializable);
REGISTER_SPL_IMPLEMENTS(ArrayObject, Countable... | {'deleted': [], 'added': [{'line_no': 19, 'char_start': 968, 'char_end': 1020, 'line': '\tspl_handler_ArrayObject.get_gc = spl_array_get_gc;\n'}]} | {'deleted': [], 'added': []} | github.com/php/php-src/commit/3f627e580acfdaf0595ae3b115b8bec677f203ee?w=1 | ext/spl/spl_array.c | cwe-416 | 600 |
cwe-089 | add_item | def add_item(self, item):
""""Add new item."""
if self.connection:
self.cursor.execute('insert into item (name, shoppinglistid) values ("%s", "%s")' % (item[0], item[1]))
self.connection.commit() | def add_item(self, item):
""""Add new item."""
if self.connection:
t = (item[0], item[1], )
self.cursor.execute('insert into item (name, shoppinglistid) values (?, ?)', t)
self.connection.commit() | {'deleted': [{'line_no': 4, 'char_start': 87, 'char_end': 203, 'line': ' self.cursor.execute(\'insert into item (name, shoppinglistid) values ("%s", "%s")\' % (item[0], item[1]))\n'}], 'added': [{'line_no': 4, 'char_start': 87, 'char_end': 124, 'line': ' t = (item[0], item[1], )\n'}, {'line_no': 5... | {'deleted': [{'char_start': 168, 'char_end': 172, 'chars': '"%s"'}, {'char_start': 174, 'char_end': 178, 'chars': '"%s"'}, {'char_start': 180, 'char_end': 191, 'chars': ' % (item[0]'}, {'char_start': 193, 'char_end': 194, 'chars': 'i'}, {'char_start': 195, 'char_end': 201, 'chars': 'em[1])'}], 'added': [{'char_start': ... | github.com/ecosl-developers/ecosl/commit/8af050a513338bf68ff2a243e4a2482d24e9aa3a | ecosldb/ecosldb.py | cwe-089 | 58 |
cwe-416 | SMB2_read | SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
unsigned int *nbytes, char **buf, int *buf_type)
{
struct smb_rqst rqst;
int resp_buftype, rc = -EACCES;
struct smb2_read_plain_req *req = NULL;
struct smb2_read_rsp *rsp = NULL;
struct kvec iov[1];
struct kvec rsp_iov;
unsigned int total_len;
... | SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
unsigned int *nbytes, char **buf, int *buf_type)
{
struct smb_rqst rqst;
int resp_buftype, rc = -EACCES;
struct smb2_read_plain_req *req = NULL;
struct smb2_read_rsp *rsp = NULL;
struct kvec iov[1];
struct kvec rsp_iov;
unsigned int total_len;
... | {'deleted': [{'line_no': 30, 'char_start': 802, 'char_end': 832, 'line': '\tcifs_small_buf_release(req);\n'}, {'line_no': 31, 'char_start': 832, 'char_end': 833, 'line': '\n'}], 'added': [{'line_no': 51, 'char_start': 1501, 'char_end': 1531, 'line': '\tcifs_small_buf_release(req);\n'}, {'line_no': 52, 'char_start': 153... | {'deleted': [{'char_start': 803, 'char_end': 834, 'chars': 'cifs_small_buf_release(req);\n\n\t'}], 'added': [{'char_start': 1497, 'char_end': 1528, 'chars': ');\n\n\tcifs_small_buf_release(req'}]} | github.com/torvalds/linux/commit/088aaf17aa79300cab14dbee2569c58cfafd7d6e | fs/cifs/smb2pdu.c | cwe-416 | 717 |
cwe-125 | mxf_parse_structural_metadata | static int mxf_parse_structural_metadata(MXFContext *mxf)
{
MXFPackage *material_package = NULL;
int i, j, k, ret;
av_log(mxf->fc, AV_LOG_TRACE, "metadata sets count %d\n", mxf->metadata_sets_count);
/* TODO: handle multiple material packages (OP3x) */
for (i = 0; i < mxf->packages_count; i++) {
... | static int mxf_parse_structural_metadata(MXFContext *mxf)
{
MXFPackage *material_package = NULL;
int i, j, k, ret;
av_log(mxf->fc, AV_LOG_TRACE, "metadata sets count %d\n", mxf->metadata_sets_count);
/* TODO: handle multiple material packages (OP3x) */
for (i = 0; i < mxf->packages_count; i++) {
... | {'deleted': [{'line_no': 104, 'char_start': 5013, 'char_end': 5117, 'line': ' av_log(mxf, AV_LOG_TRACE, "could not resolve essence container data strong ref\\n");\n'}], 'added': [{'line_no': 104, 'char_start': 5013, 'char_end': 5121, 'line': ' av_log(mxf->fc, AV_LOG_TRACE, "could n... | {'deleted': [], 'added': [{'char_start': 5043, 'char_end': 5047, 'chars': '->fc'}]} | github.com/FFmpeg/FFmpeg/commit/bab0716c7f4793ec42e05a5aa7e80d82a0dd4e75 | libavformat/mxfdec.c | cwe-125 | 4,817 |
cwe-416 | blk_rq_map_user_iov | int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
struct rq_map_data *map_data,
const struct iov_iter *iter, gfp_t gfp_mask)
{
bool copy = false;
unsigned long align = q->dma_pad_mask | queue_dma_alignment(q);
struct bio *bio = NULL;
struct iov_iter i;
int ret;
if (map_data)
copy = tru... | int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
struct rq_map_data *map_data,
const struct iov_iter *iter, gfp_t gfp_mask)
{
bool copy = false;
unsigned long align = q->dma_pad_mask | queue_dma_alignment(q);
struct bio *bio = NULL;
struct iov_iter i;
int ret;
if (!iter_is_iovec(iter))
... | {'deleted': [], 'added': [{'line_no': 11, 'char_start': 293, 'char_end': 320, 'line': '\tif (!iter_is_iovec(iter))\n'}, {'line_no': 12, 'char_start': 320, 'char_end': 333, 'line': '\t\tgoto fail;\n'}, {'line_no': 13, 'char_start': 333, 'char_end': 334, 'line': '\n'}, {'line_no': 36, 'char_start': 819, 'char_end': 825, ... | {'deleted': [], 'added': [{'char_start': 298, 'char_end': 339, 'chars': '!iter_is_iovec(iter))\n\t\tgoto fail;\n\n\tif ('}, {'char_start': 818, 'char_end': 824, 'chars': '\nfail:'}]} | github.com/torvalds/linux/commit/a0ac402cfcdc904f9772e1762b3fda112dcc56a0 | block/blk-map.c | cwe-416 | 249 |
cwe-476 | megasas_alloc_cmds | int megasas_alloc_cmds(struct megasas_instance *instance)
{
int i;
int j;
u16 max_cmd;
struct megasas_cmd *cmd;
max_cmd = instance->max_mfi_cmds;
/*
* instance->cmd_list is an array of struct megasas_cmd pointers.
* Allocate the dynamic array first and then allocate individual
* commands.
*/
instance->... | int megasas_alloc_cmds(struct megasas_instance *instance)
{
int i;
int j;
u16 max_cmd;
struct megasas_cmd *cmd;
max_cmd = instance->max_mfi_cmds;
/*
* instance->cmd_list is an array of struct megasas_cmd pointers.
* Allocate the dynamic array first and then allocate individual
* commands.
*/
instance->... | {'deleted': [], 'added': [{'line_no': 56, 'char_start': 1333, 'char_end': 1351, 'line': '\t\treturn -ENOMEM;\n'}]} | {'deleted': [], 'added': [{'char_start': 1334, 'char_end': 1352, 'chars': '\treturn -ENOMEM;\n\t'}]} | github.com/torvalds/linux/commit/bcf3b67d16a4c8ffae0aa79de5853435e683945c | drivers/scsi/megaraid/megaraid_sas_base.c | cwe-476 | 395 |
cwe-089 | send_message | @frappe.whitelist(allow_guest=True)
def send_message(subject="Website Query", message="", sender="", status="Open"):
from frappe.www.contact import send_message as website_send_message
lead = customer = None
website_send_message(subject, message, sender)
customer = frappe.db.sql("""select distinct dl.link_name fr... | @frappe.whitelist(allow_guest=True)
def send_message(subject="Website Query", message="", sender="", status="Open"):
from frappe.www.contact import send_message as website_send_message
lead = customer = None
website_send_message(subject, message, sender)
customer = frappe.db.sql("""select distinct dl.link_name fr... | {'deleted': [{'line_no': 10, 'char_start': 424, 'char_end': 482, 'line': '\t\tand c.email_id=\'{email_id}\'""".format(email_id=sender))\n'}], 'added': [{'line_no': 10, 'char_start': 424, 'char_end': 458, 'line': '\t\tand c.email_id = %s""", sender)\n'}]} | {'deleted': [{'char_start': 441, 'char_end': 453, 'chars': "'{email_id}'"}, {'char_start': 456, 'char_end': 473, 'chars': '.format(email_id='}, {'char_start': 479, 'char_end': 480, 'chars': ')'}], 'added': [{'char_start': 440, 'char_end': 441, 'chars': ' '}, {'char_start': 442, 'char_end': 445, 'chars': ' %s'}, {'char_... | github.com/libracore/erpnext/commit/9acb885e60f77cd4e9ea8c98bdc39c18abcac731 | erpnext/templates/utils.py | cwe-089 | 364 |
cwe-125 | GetPSDRowSize | static inline size_t GetPSDRowSize(Image *image)
{
if (image->depth == 1)
return((image->columns+7)/8);
else
return(image->columns*GetPSDPacketSize(image));
} | static inline size_t GetPSDRowSize(Image *image)
{
if (image->depth == 1)
return(((image->columns+7)/8)*GetPSDPacketSize(image));
else
return(image->columns*GetPSDPacketSize(image));
} | {'deleted': [{'line_no': 4, 'char_start': 76, 'char_end': 110, 'line': ' return((image->columns+7)/8);\n'}], 'added': [{'line_no': 4, 'char_start': 76, 'char_end': 136, 'line': ' return(((image->columns+7)/8)*GetPSDPacketSize(image));\n'}]} | {'deleted': [], 'added': [{'char_start': 88, 'char_end': 89, 'chars': '('}, {'char_start': 108, 'char_end': 133, 'chars': ')*GetPSDPacketSize(image)'}]} | github.com/ImageMagick/ImageMagick/commit/5f16640725b1225e6337c62526e6577f0f88edb8 | coders/psd.c | cwe-125 | 52 |
cwe-125 | parse8BIM | static ssize_t parse8BIM(Image *ifile, Image *ofile)
{
char
brkused,
quoted,
*line,
*token,
*newstr,
*name;
int
state,
next;
unsigned char
dataset;
unsigned int
recnum;
int
inputlen = MaxTextExtent;
MagickOffsetType
savedpos,
currentpos;
ssize_t
... | static ssize_t parse8BIM(Image *ifile, Image *ofile)
{
char
brkused,
quoted,
*line,
*token,
*newstr,
*name;
int
state,
next;
unsigned char
dataset;
unsigned int
recnum;
int
inputlen = MaxTextExtent;
MagickOffsetType
savedpos,
currentpos;
ssize_t
... | {'deleted': [{'line_no': 173, 'char_start': 4538, 'char_end': 4572, 'line': ' while (len--)\n'}, {'line_no': 204, 'char_start': 5742, 'char_end': 5776, 'line': ' while (len--)\n'}], 'added': [{'line_no': 173, 'char_start': 4538, 'char_end': 4576, 'line': ' while ... | {'deleted': [], 'added': [{'char_start': 4570, 'char_end': 4574, 'chars': ' > 0'}, {'char_start': 5778, 'char_end': 5782, 'chars': ' > 0'}]} | github.com/ImageMagick/ImageMagick/commit/97c9f438a9b3454d085895f4d1f66389fd22a0fb | coders/meta.c | cwe-125 | 1,608 |
cwe-476 | inet_rtm_getroute | static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack)
{
struct net *net = sock_net(in_skb->sk);
struct rtmsg *rtm;
struct nlattr *tb[RTA_MAX+1];
struct fib_result res = {};
struct rtable *rt = NULL;
struct flowi4 fl4;
__be32 dst = 0;
__be32 src = 0;
... | static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack)
{
struct net *net = sock_net(in_skb->sk);
struct rtmsg *rtm;
struct nlattr *tb[RTA_MAX+1];
struct fib_result res = {};
struct rtable *rt = NULL;
struct flowi4 fl4;
__be32 dst = 0;
__be32 src = 0;
... | {'deleted': [{'line_no': 102, 'char_start': 2323, 'char_end': 2362, 'line': '\tif (rtm->rtm_flags & RTM_F_FIB_MATCH)\n'}, {'line_no': 107, 'char_start': 2548, 'char_end': 2554, 'line': '\telse\n'}], 'added': [{'line_no': 102, 'char_start': 2323, 'char_end': 2364, 'line': '\tif (rtm->rtm_flags & RTM_F_FIB_MATCH) {\n'}, ... | {'deleted': [{'char_start': 2362, 'char_end': 2362, 'chars': ''}, {'char_start': 2611, 'char_end': 2611, 'chars': ''}], 'added': [{'char_start': 2361, 'char_end': 2479, 'chars': ' {\n\t\tif (!res.fi) {\n\t\t\terr = fib_props[res.type].error;\n\t\t\tif (!err)\n\t\t\t\terr = -EHOSTUNREACH;\n\t\t\tgoto errout_free;\n\t\t}... | github.com/torvalds/linux/commit/bc3aae2bbac46dd894c89db5d5e98f7f0ef9e205 | net/ipv4/route.c | cwe-476 | 1,016 |
cwe-089 | test_process_as_form | @unpack
def test_process_as_form(self, job_number, dcn_key, was_prev_matched,
was_prev_closed, was_prev_tracked):
email_obj = {
'sender' : "Alex Roy <Alex.Roy@dilfo.com>",
'subject' : "DO NOT MODIFY MESSAGE BELOW - JUST HIT `SEND`",
'date' : "Tue, 7 May 20... | @unpack
def test_process_as_form(self, job_number, dcn_key, was_prev_matched,
was_prev_closed, was_prev_tracked):
email_obj = {
'sender' : "Alex Roy <Alex.Roy@dilfo.com>",
'subject' : "DO NOT MODIFY MESSAGE BELOW - JUST HIT `SEND`",
'date' : "Tue, 7 May 20... | {'deleted': [{'line_no': 18, 'char_start': 823, 'char_end': 876, 'line': " VALUES ({}, 'alex.roy616@gmail.com', {})\n"}, {'line_no': 22, 'char_start': 992, 'char_end': 1045, 'line': " VALUES ({}, 'alex.roy616@gmail.com', {})\n"}, {'line_no': 26, 'char_start': 1151, 'char_end': 1244, 'line': ' ... | {'deleted': [{'char_start': 843, 'char_end': 845, 'chars': '{}'}, {'char_start': 872, 'char_end': 874, 'chars': '{}'}, {'char_start': 1012, 'char_end': 1014, 'chars': '{}'}, {'char_start': 1041, 'char_end': 1043, 'chars': '{}'}, {'char_start': 1206, 'char_end': 1214, 'chars': '.format('}, {'char_start': 1241, 'char_end... | github.com/confirmationbias616/certificate_checker/commit/9e890b9613b627e3a5995d0e4a594c8e0831e2ce | tests.py | cwe-089 | 641 |
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': [], 'added': [{'line_no': 259, 'char_start': 9073, 'char_end': 9119, 'line': ' if (!allowed_problem_dir(problem_id))\n'}, {'line_no': 260, 'char_start': 9119, 'char_end': 9129, 'line': ' {\n'}, {'line_no': 261, 'char_start': 9129, 'char_end': 9197, 'line': ' return_InvalidProblemDir... | {'deleted': [], 'added': [{'char_start': 9086, 'char_end': 9241, 'chars': 'allowed_problem_dir(problem_id))\n {\n return_InvalidProblemDir_error(invocation, problem_id);\n return;\n }\n\n if (!'}, {'char_start': 11712, 'char_end': 11867, 'chars': '\n\n if (!allowed_prob... | github.com/abrt/abrt/commit/7a47f57975be0d285a2f20758e4572dca6d9cdd3 | src/dbus/abrt-dbus.c | cwe-022 | 3,466 |
cwe-476 | archive_acl_from_text_l | archive_acl_from_text_l(struct archive_acl *acl, const char *text,
int want_type, struct archive_string_conv *sc)
{
struct {
const char *start;
const char *end;
} field[6], name;
const char *s, *st;
int numfields, fields, n, r, sol, ret;
int type, types, tag, permset, id;
size_t len;
char sep;
switch ... | archive_acl_from_text_l(struct archive_acl *acl, const char *text,
int want_type, struct archive_string_conv *sc)
{
struct {
const char *start;
const char *end;
} field[6], name;
const char *s, *st;
int numfields, fields, n, r, sol, ret;
int type, types, tag, permset, id;
size_t len;
char sep;
switch ... | {'deleted': [], 'added': [{'line_no': 98, 'char_start': 2311, 'char_end': 2330, 'line': '\t\t\tif (len == 0) {\n'}, {'line_no': 99, 'char_start': 2330, 'char_end': 2354, 'line': '\t\t\t\tret = ARCHIVE_WARN;\n'}, {'line_no': 100, 'char_start': 2354, 'char_end': 2368, 'line': '\t\t\t\tcontinue;\n'}, {'line_no': 101, 'cha... | {'deleted': [], 'added': [{'char_start': 2314, 'char_end': 2377, 'chars': 'if (len == 0) {\n\t\t\t\tret = ARCHIVE_WARN;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t'}]} | github.com/libarchive/libarchive/commit/15bf44fd2c1ad0e3fd87048b3fcc90c4dcff1175 | libarchive/archive_acl.c | cwe-476 | 2,072 |
cwe-416 | sctp_do_peeloff | int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp)
{
struct sctp_association *asoc = sctp_id2assoc(sk, id);
struct sctp_sock *sp = sctp_sk(sk);
struct socket *sock;
int err = 0;
if (!asoc)
return -EINVAL;
/* If there is a thread waiting on more sndbuf space for
* sending on this as... | int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp)
{
struct sctp_association *asoc = sctp_id2assoc(sk, id);
struct sctp_sock *sp = sctp_sk(sk);
struct socket *sock;
int err = 0;
/* Do not peel off from one netns to another one. */
if (!net_eq(current->nsproxy->net_ns, sock_net(sk)))
r... | {'deleted': [], 'added': [{'line_no': 8, 'char_start': 209, 'char_end': 263, 'line': '\t/* Do not peel off from one netns to another one. */\n'}, {'line_no': 9, 'char_start': 263, 'char_end': 317, 'line': '\tif (!net_eq(current->nsproxy->net_ns, sock_net(sk)))\n'}, {'line_no': 10, 'char_start': 317, 'char_end': 335, 'l... | {'deleted': [], 'added': [{'char_start': 210, 'char_end': 337, 'chars': '/* Do not peel off from one netns to another one. */\n\tif (!net_eq(current->nsproxy->net_ns, sock_net(sk)))\n\t\treturn -EINVAL;\n\n\t'}]} | github.com/torvalds/linux/commit/df80cd9b28b9ebaa284a41df611dbf3a2d05ca74 | net/sctp/socket.c | cwe-416 | 333 |
cwe-078 | on_message | def on_message( self, profile_id, profile_name, level, message, timeout ):
if 1 == level:
cmd = "notify-send "
if timeout > 0:
cmd = cmd + " -t %s" % (1000 * timeout)
title = "Back In Time (%s) : %s" % (self.user, profile_name)
message = messa... | def on_message( self, profile_id, profile_name, level, message, timeout ):
if 1 == level:
cmd = ['notify-send']
if timeout > 0:
cmd.extend(['-t', str(1000 * timeout)])
title = "Back In Time (%s) : %s" % (self.user, profile_name)
message = mess... | {'deleted': [{'line_no': 3, 'char_start': 102, 'char_end': 135, 'line': ' cmd = "notify-send "\n'}, {'line_no': 5, 'char_start': 163, 'char_end': 219, 'line': ' cmd = cmd + " -t %s" % (1000 * timeout)\n'}, {'line_no': 11, 'char_start': 391, 'char_end': 451, 'line': ' cmd = cmd + " \... | {'deleted': [{'char_start': 120, 'char_end': 121, 'chars': '"'}, {'char_start': 132, 'char_end': 134, 'chars': ' "'}, {'char_start': 182, 'char_end': 187, 'chars': ' = cm'}, {'char_start': 188, 'char_end': 193, 'chars': ' + " '}, {'char_start': 196, 'char_end': 197, 'chars': '%'}, {'char_start': 198, 'char_end': 202, '... | github.com/bit-team/backintime/commit/cef81d0da93ff601252607df3db1a48f7f6f01b3 | qt4/plugins/notifyplugin.py | cwe-078 | 130 |
cwe-416 | kvm_ioctl_create_device | static int kvm_ioctl_create_device(struct kvm *kvm,
struct kvm_create_device *cd)
{
struct kvm_device_ops *ops = NULL;
struct kvm_device *dev;
bool test = cd->flags & KVM_CREATE_DEVICE_TEST;
int ret;
if (cd->type >= ARRAY_SIZE(kvm_device_ops_table))
return -ENODEV;
ops = kvm_device_ops_table[cd->type];... | static int kvm_ioctl_create_device(struct kvm *kvm,
struct kvm_create_device *cd)
{
struct kvm_device_ops *ops = NULL;
struct kvm_device *dev;
bool test = cd->flags & KVM_CREATE_DEVICE_TEST;
int ret;
if (cd->type >= ARRAY_SIZE(kvm_device_ops_table))
return -ENODEV;
ops = kvm_device_ops_table[cd->type];... | {'deleted': [{'line_no': 41, 'char_start': 823, 'char_end': 844, 'line': '\t\tops->destroy(dev);\n'}], 'added': [{'line_no': 44, 'char_start': 904, 'char_end': 925, 'line': '\t\tops->destroy(dev);\n'}]} | {'deleted': [{'char_start': 825, 'char_end': 846, 'chars': 'ops->destroy(dev);\n\t\t'}], 'added': [{'char_start': 901, 'char_end': 922, 'chars': ');\n\t\tops->destroy(dev'}]} | github.com/torvalds/linux/commit/a0f1d21c1ccb1da66629627a74059dd7f5ac9c61 | virt/kvm/kvm_main.c | cwe-416 | 314 |
cwe-125 | glyph_cache_put | BOOL glyph_cache_put(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index, rdpGlyph* glyph)
{
rdpGlyph* prevGlyph;
if (id > 9)
{
WLog_ERR(TAG, "invalid glyph cache id: %" PRIu32 "", id);
return FALSE;
}
if (index > glyphCache->glyphCache[id].number)
{
WLog_ERR(TAG, "invalid glyph cache index: %" PRIu32 " in... | BOOL glyph_cache_put(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index, rdpGlyph* glyph)
{
rdpGlyph* prevGlyph;
if (id > 9)
{
WLog_ERR(TAG, "invalid glyph cache id: %" PRIu32 "", id);
return FALSE;
}
if (index >= glyphCache->glyphCache[id].number)
{
WLog_ERR(TAG, "invalid glyph cache index: %" PRIu32 " i... | {'deleted': [{'line_no': 11, 'char_start': 211, 'char_end': 259, 'line': '\tif (index > glyphCache->glyphCache[id].number)\n'}], 'added': [{'line_no': 11, 'char_start': 211, 'char_end': 260, 'line': '\tif (index >= glyphCache->glyphCache[id].number)\n'}]} | {'deleted': [], 'added': [{'char_start': 223, 'char_end': 224, 'chars': '='}]} | github.com/FreeRDP/FreeRDP/commit/c0fd449ec0870b050d350d6d844b1ea6dad4bc7d | libfreerdp/cache/glyph.c | cwe-125 | 213 |
cwe-125 | store_versioninfo_gnu_verdef | static Sdb *store_versioninfo_gnu_verdef(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) {
const char *section_name = "";
const char *link_section_name = "";
char *end = NULL;
Elf_(Shdr) *link_shdr = NULL;
ut8 dfs[sizeof (Elf_(Verdef))] = {0};
Sdb *sdb;
int cnt, i;
if (shdr->sh_link > bin->ehdr.e_shnum) {
return false... | static Sdb *store_versioninfo_gnu_verdef(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) {
const char *section_name = "";
const char *link_section_name = "";
char *end = NULL;
Elf_(Shdr) *link_shdr = NULL;
ut8 dfs[sizeof (Elf_(Verdef))] = {0};
Sdb *sdb;
int cnt, i;
if (shdr->sh_link > bin->ehdr.e_shnum) {
return false... | {'deleted': [{'line_no': 56, 'char_start': 1827, 'char_end': 1855, 'line': '\t\tvstart += verdef->vd_aux;\n'}], 'added': [{'line_no': 56, 'char_start': 1827, 'char_end': 1857, 'line': '\t\tint vdaux = verdef->vd_aux;\n'}, {'line_no': 57, 'char_start': 1857, 'char_end': 1876, 'line': '\t\tif (vdaux < 1) {\n'}, {'line_no... | {'deleted': [{'char_start': 1829, 'char_end': 1831, 'chars': 'vs'}, {'char_start': 1833, 'char_end': 1835, 'chars': 'rt'}, {'char_start': 1836, 'char_end': 1837, 'chars': '+'}], 'added': [{'char_start': 1829, 'char_end': 1833, 'chars': 'int '}, {'char_start': 1834, 'char_end': 1835, 'chars': 'd'}, {'char_start': 1836, ... | github.com/radare/radare2/commit/44ded3ff35b8264f54b5a900cab32ec489d9e5b9 | libr/bin/format/elf/elf.c | cwe-125 | 1,404 |
cwe-022 | is_cgi | def is_cgi(self):
"""Test whether self.path corresponds to a CGI script,
and return a boolean.
This function sets self.cgi_info to a tuple (dir, rest)
when it returns True, where dir is the directory part before
the CGI script name. Note that rest begins with a
slas... | def is_cgi(self):
"""Test whether self.path corresponds to a CGI script.
Returns True and updates the cgi_info attribute to the tuple
(dir, rest) if self.path requires running a CGI script.
Returns False otherwise.
The default implementation tests whether the normalized url... | {'deleted': [{'line_no': 2, 'char_start': 22, 'char_end': 85, 'line': ' """Test whether self.path corresponds to a CGI script,\n'}, {'line_no': 3, 'char_start': 85, 'char_end': 115, 'line': ' and return a boolean.\n'}, {'line_no': 4, 'char_start': 115, 'char_end': 116, 'line': '\n'}, {'line_no': 5, 'char_... | {'deleted': [{'char_start': 83, 'char_end': 84, 'chars': ','}, {'char_start': 93, 'char_end': 98, 'chars': 'and r'}, {'char_start': 104, 'char_end': 110, 'chars': 'a bool'}, {'char_start': 113, 'char_end': 120, 'chars': '.\n\n '}, {'char_start': 121, 'char_end': 130, 'chars': ' This f'}, {'char_start': 131, 'char_... | github.com/Ricky-Wilson/Python/commit/c5abced949e6a4b001d1dee321593e74ecadecfe | Lib/CGIHTTPServer.py | cwe-022 | 182 |
cwe-022 | _normalize | def _normalize(self, metaerrors):
"""Normalize output format to be usable by Anaconda's linting frontend
"""
errors = []
for error in metaerrors:
if self.filepath not in error.get('path', ''):
continue
error_type = error.get('severity', 'X').... | def _normalize(self, metaerrors):
"""Normalize output format to be usable by Anaconda's linting frontend
"""
errors = []
for error in metaerrors:
last_path = os.path.join(
os.path.basename(os.path.dirname(self.filepath)),
os.path.basename(... | {'deleted': [{'line_no': 7, 'char_start': 183, 'char_end': 242, 'line': " if self.filepath not in error.get('path', ''):\n"}], 'added': [{'line_no': 7, 'char_start': 183, 'char_end': 221, 'line': ' last_path = os.path.join(\n'}, {'line_no': 8, 'char_start': 221, 'char_end': 287, 'line': ' ... | {'deleted': [], 'added': [{'char_start': 195, 'char_end': 217, 'chars': 'last_path = os.path.jo'}, {'char_start': 218, 'char_end': 273, 'chars': 'n(\n os.path.basename(os.path.dirname(sel'}, {'char_start': 274, 'char_end': 287, 'chars': '.filepath)),\n'}, {'char_start': 288, 'char_end': 320, 'chars': ' ... | github.com/DamnWidget/anaconda_go/commit/d3db90bb8853d832927818699591b91f56f6413c | plugin/handlers_go/anagonda/context/gometalinter.py | cwe-022 | 216 |
cwe-089 | set_language | def set_language(self, lang):
"""
Update language of user in the User object and in the database
:param lang: string with language tag like "en-US"
:return: None
"""
log.debug('Updating info about user %s language '
'in memory & database...', self)
... | def set_language(self, lang):
"""
Update language of user in the User object and in the database
:param lang: string with language tag like "en-US"
:return: None
"""
log.debug('Updating info about user %s language '
'in memory & database...', self)
... | {'deleted': [{'line_no': 13, 'char_start': 383, 'char_end': 435, 'line': ' f"SET language=\'{self.language}\' "\n'}, {'line_no': 14, 'char_start': 435, 'char_end': 487, 'line': ' f"WHERE chat_id=\'{self.chat_id}\'")\n'}, {'line_no': 17, 'char_start': 501, 'char_end': 527, 'line': ' ... | {'deleted': [{'char_start': 415, 'char_end': 417, 'chars': "'{"}, {'char_start': 418, 'char_end': 432, 'chars': "elf.language}'"}, {'char_start': 468, 'char_end': 470, 'chars': "'{"}, {'char_start': 482, 'char_end': 487, 'chars': '}\'")\n'}], 'added': [{'char_start': 415, 'char_end': 416, 'chars': '%'}, {'char_start': ... | github.com/RandyRomero/photoGPSbot/commit/0e9f57f13e61863b3672f5730e27f149da00786a | photogpsbot/users.py | cwe-089 | 143 |
cwe-078 | _exec_cmd | def _exec_cmd(self, cmd):
"""Executes adb commands in a new shell.
This is specific to executing adb binary because stderr is not a good
indicator of cmd execution status.
Args:
cmds: A string that is the adb command to execute.
Returns:
The output ... | def _exec_cmd(self, args, shell):
"""Executes adb commands.
Args:
args: string or list of strings, program arguments.
See subprocess.Popen() documentation.
shell: bool, True to run this command through the system shell,
False to invoke it dire... | {'deleted': [{'line_no': 1, 'char_start': 0, 'char_end': 30, 'line': ' def _exec_cmd(self, cmd):\n'}, {'line_no': 8, 'char_start': 216, 'char_end': 279, 'line': ' cmds: A string that is the adb command to execute.\n'}, {'line_no': 17, 'char_start': 494, 'char_end': 571, 'line': ' cmd, stdout=su... | {'deleted': [{'char_start': 24, 'char_end': 27, 'chars': 'cmd'}, {'char_start': 63, 'char_end': 65, 'chars': 'in'}, {'char_start': 66, 'char_end': 67, 'chars': 'a'}, {'char_start': 68, 'char_end': 71, 'chars': 'new'}, {'char_start': 73, 'char_end': 79, 'chars': 'hell.\n'}, {'char_start': 88, 'char_end': 92, 'chars': 'T... | github.com/google/mobly/commit/3862e8ba359040fbdd6e1a6d36e51d07cda8e1ee | mobly/controllers/android_device_lib/adb.py | cwe-078 | 204 |
cwe-022 | cleanup_pathname | cleanup_pathname(struct archive_write_disk *a)
{
char *dest, *src;
char separator = '\0';
dest = src = a->name;
if (*src == '\0') {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Invalid empty pathname");
return (ARCHIVE_FAILED);
}
#if defined(__CYGWIN__)
cleanup_pathname_win(a);
#endif
/* Skip ... | cleanup_pathname(struct archive_write_disk *a)
{
char *dest, *src;
char separator = '\0';
dest = src = a->name;
if (*src == '\0') {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Invalid empty pathname");
return (ARCHIVE_FAILED);
}
#if defined(__CYGWIN__)
cleanup_pathname_win(a);
#endif
/* Skip ... | {'deleted': [{'line_no': 17, 'char_start': 336, 'char_end': 354, 'line': "\tif (*src == '/')\n"}], 'added': [{'line_no': 17, 'char_start': 336, 'char_end': 356, 'line': "\tif (*src == '/') {\n"}, {'line_no': 18, 'char_start': 356, 'char_end': 415, 'line': '\t\tif (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {\n'... | {'deleted': [], 'added': [{'char_start': 353, 'char_end': 543, 'chars': ' {\n\t\tif (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {\n\t\t\tarchive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,\n\t\t\t "Path is absolute");\n\t\t\treturn (ARCHIVE_FAILED);\n\t\t}\n'}, {'char_start': 565, 'char_end': 56... | github.com/libarchive/libarchive/commit/59357157706d47c365b2227739e17daba3607526 | libarchive/archive_write_disk_posix.c | cwe-022 | 591 |
cwe-476 | xfs_attr_shortform_to_leaf | xfs_attr_shortform_to_leaf(
struct xfs_da_args *args,
struct xfs_buf **leaf_bp)
{
xfs_inode_t *dp;
xfs_attr_shortform_t *sf;
xfs_attr_sf_entry_t *sfe;
xfs_da_args_t nargs;
char *tmpbuffer;
int error, i, size;
xfs_dablk_t blkno;
struct xfs_buf *bp;
xfs_ifork_t *ifp;
trace_xfs_attr_sf_to_leaf(args);
dp = ... | xfs_attr_shortform_to_leaf(
struct xfs_da_args *args,
struct xfs_buf **leaf_bp)
{
xfs_inode_t *dp;
xfs_attr_shortform_t *sf;
xfs_attr_sf_entry_t *sfe;
xfs_da_args_t nargs;
char *tmpbuffer;
int error, i, size;
xfs_dablk_t blkno;
struct xfs_buf *bp;
xfs_ifork_t *ifp;
trace_xfs_attr_sf_to_leaf(args);
dp = ... | {'deleted': [{'line_no': 46, 'char_start': 1151, 'char_end': 1195, 'line': '\t\terror = xfs_da_shrink_inode(args, 0, bp);\n'}, {'line_no': 47, 'char_start': 1195, 'char_end': 1208, 'line': '\t\tbp = NULL;\n'}, {'line_no': 48, 'char_start': 1208, 'char_end': 1221, 'line': '\t\tif (error)\n'}], 'added': [{'line_no': 46, ... | {'deleted': [{'char_start': 1155, 'char_end': 1156, 'chars': 'r'}, {'char_start': 1157, 'char_end': 1158, 'chars': 'r'}, {'char_start': 1159, 'char_end': 1160, 'chars': '='}, {'char_start': 1193, 'char_end': 1199, 'chars': ';\n\t\tbp'}, {'char_start': 1202, 'char_end': 1219, 'chars': 'NULL;\n\t\tif (error'}], 'added': ... | github.com/torvalds/linux/commit/bb3d48dcf86a97dc25fe9fc2c11938e19cb4399a | fs/xfs/libxfs/xfs_attr_leaf.c | cwe-476 | 780 |
cwe-089 | isValidAdmToken | def isValidAdmToken(adm_token):
conn, c = connectDB()
req = "SELECT * from {} where adm_token='{}'".format(CFG("admintoken_table_name"), adm_token)
answer = bool(queryOne(c, req))
closeDB(conn)
return answer | def isValidAdmToken(adm_token):
conn, c = connectDB()
req = "SELECT * from {} where adm_token=?".format(CFG("admintoken_table_name"))
answer = bool(queryOne(c, req, (adm_token,)))
closeDB(conn)
return answer | {'deleted': [{'line_no': 3, 'char_start': 58, 'char_end': 157, 'line': ' req = "SELECT * from {} where adm_token=\'{}\'".format(CFG("admintoken_table_name"), adm_token)\n'}, {'line_no': 4, 'char_start': 157, 'char_end': 193, 'line': ' answer = bool(queryOne(c, req))\n'}], 'added': [{'line_no': 3, 'char_start': 5... | {'deleted': [{'char_start': 103, 'char_end': 107, 'chars': "'{}'"}, {'char_start': 144, 'char_end': 155, 'chars': ', adm_token'}], 'added': [{'char_start': 103, 'char_end': 104, 'chars': '?'}, {'char_start': 176, 'char_end': 190, 'chars': ', (adm_token,)'}]} | github.com/FAUSheppy/simple-python-poll/commit/186c5ff5cdf58272e253a1bb432419ee50d93109 | database.py | cwe-089 | 64 |
cwe-125 | next_line | next_line(struct archive_read *a,
const char **b, ssize_t *avail, ssize_t *ravail, ssize_t *nl)
{
ssize_t len;
int quit;
quit = 0;
if (*avail == 0) {
*nl = 0;
len = 0;
} else
len = get_line_size(*b, *avail, nl);
/*
* Read bytes more while it does not reach the end of line.
*/
while (*nl == 0 && l... | next_line(struct archive_read *a,
const char **b, ssize_t *avail, ssize_t *ravail, ssize_t *nl)
{
ssize_t len;
int quit;
quit = 0;
if (*avail == 0) {
*nl = 0;
len = 0;
} else
len = get_line_size(*b, *avail, nl);
/*
* Read bytes more while it does not reach the end of line.
*/
while (*nl == 0 && l... | {'deleted': [{'line_no': 38, 'char_start': 933, 'char_end': 972, 'line': '\t\tlen = get_line_size(*b, *avail, nl);\n'}], 'added': [{'line_no': 38, 'char_start': 933, 'char_end': 984, 'line': '\t\tlen = get_line_size(*b + len, *avail - len, nl);\n'}]} | {'deleted': [], 'added': [{'char_start': 957, 'char_end': 963, 'chars': ' + len'}, {'char_start': 971, 'char_end': 977, 'chars': ' - len'}]} | github.com/libarchive/libarchive/commit/eec077f52bfa2d3f7103b4b74d52572ba8a15aca | libarchive/archive_read_support_format_mtree.c | cwe-125 | 358 |
cwe-125 | lha_read_file_header_1 | lha_read_file_header_1(struct archive_read *a, struct lha *lha)
{
const unsigned char *p;
size_t extdsize;
int i, err, err2;
int namelen, padding;
unsigned char headersum, sum_calculated;
err = ARCHIVE_OK;
if ((p = __archive_read_ahead(a, H1_FIXED_SIZE, NULL)) == NULL)
return (truncated_error(a));
lha->hea... | lha_read_file_header_1(struct archive_read *a, struct lha *lha)
{
const unsigned char *p;
size_t extdsize;
int i, err, err2;
int namelen, padding;
unsigned char headersum, sum_calculated;
err = ARCHIVE_OK;
if ((p = __archive_read_ahead(a, H1_FIXED_SIZE, NULL)) == NULL)
return (truncated_error(a));
lha->hea... | {'deleted': [], 'added': [{'line_no': 53, 'char_start': 1755, 'char_end': 1779, 'line': '\tif (lha->compsize < 0)\n'}, {'line_no': 54, 'char_start': 1779, 'char_end': 1830, 'line': '\t\tgoto invalid;\t/* Invalid compressed file size */\n'}, {'line_no': 55, 'char_start': 1830, 'char_end': 1831, 'line': '\n'}]} | {'deleted': [], 'added': [{'char_start': 1760, 'char_end': 1836, 'chars': 'lha->compsize < 0)\n\t\tgoto invalid;\t/* Invalid compressed file size */\n\n\tif ('}]} | github.com/libarchive/libarchive/commit/98dcbbf0bf4854bf987557e55e55fff7abbf3ea9 | libarchive/archive_read_support_format_lha.c | cwe-125 | 635 |
cwe-089 | auto_unlock_tasks | @staticmethod
def auto_unlock_tasks(project_id: int):
"""Unlock all tasks locked for longer than the auto-unlock delta"""
expiry_delta = Task.auto_unlock_delta()
lock_duration = (datetime.datetime.min + expiry_delta).time().isoformat()
expiry_date = datetime.datetime.utcnow() - e... | @staticmethod
def auto_unlock_tasks(project_id: int):
"""Unlock all tasks locked for longer than the auto-unlock delta"""
expiry_delta = Task.auto_unlock_delta()
lock_duration = (datetime.datetime.min + expiry_delta).time().isoformat()
expiry_date = datetime.datetime.utcnow() - e... | {'deleted': [{'line_no': 14, 'char_start': 652, 'char_end': 687, 'line': ' AND t.project_id = {0}\n'}, {'line_no': 15, 'char_start': 687, 'char_end': 727, 'line': " AND th.action_date <= '{1}'\n"}, {'line_no': 16, 'char_start': 727, 'char_end': 780, 'line': " '''.format(project_id, str(... | {'deleted': [{'char_start': 683, 'char_end': 686, 'chars': '{0}'}, {'char_start': 721, 'char_end': 726, 'chars': "'{1}'"}, {'char_start': 742, 'char_end': 779, 'chars': '.format(project_id, str(expiry_date))'}], 'added': [{'char_start': 683, 'char_end': 694, 'chars': ':project_id'}, {'char_start': 729, 'char_end': 741,... | github.com/hotosm/tasking-manager/commit/dee040a2d22b3c4d5e38e2dbf8c6b651ad4c241a | server/models/postgis/task.py | cwe-089 | 248 |
cwe-125 | ttm_put_pages | static void ttm_put_pages(struct page **pages, unsigned npages, int flags,
enum ttm_caching_state cstate)
{
struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate);
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate);
#endif
unsigned long irq_flags;
unsigne... | static void ttm_put_pages(struct page **pages, unsigned npages, int flags,
enum ttm_caching_state cstate)
{
struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate);
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate);
#endif
unsigned long irq_flags;
unsigne... | {'deleted': [{'line_no': 29, 'char_start': 736, 'char_end': 766, 'line': '\t\t\t\t\tif (p++ != pages[i + j])\n'}, {'line_no': 64, 'char_start': 1344, 'char_end': 1373, 'line': '\t\t\t\tif (p++ != pages[i + j])\n'}], 'added': [{'line_no': 29, 'char_start': 736, 'char_end': 766, 'line': '\t\t\t\t\tif (++p != pages[i + j]... | {'deleted': [{'char_start': 745, 'char_end': 746, 'chars': 'p'}, {'char_start': 1352, 'char_end': 1353, 'chars': 'p'}], 'added': [{'char_start': 747, 'char_end': 748, 'chars': 'p'}, {'char_start': 1354, 'char_end': 1355, 'chars': 'p'}]} | github.com/torvalds/linux/commit/453393369dc9806d2455151e329c599684762428 | drivers/gpu/drm/ttm/ttm_page_alloc.c | cwe-125 | 854 |
cwe-125 | CSoundFile::GetLength | std::vector<GetLengthType> CSoundFile::GetLength(enmGetLengthResetMode adjustMode, GetLengthTarget target)
{
std::vector<GetLengthType> results;
GetLengthType retval;
retval.startOrder = target.startOrder;
retval.startRow = target.startRow;
// Are we trying to reach a certain pattern position?
const bool hasSear... | std::vector<GetLengthType> CSoundFile::GetLength(enmGetLengthResetMode adjustMode, GetLengthTarget target)
{
std::vector<GetLengthType> results;
GetLengthType retval;
retval.startOrder = target.startOrder;
retval.startRow = target.startRow;
// Are we trying to reach a certain pattern position?
const bool hasSear... | {'deleted': [{'line_no': 978, 'char_start': 31995, 'char_end': 32059, 'line': '\t\t\t\tfor(CHANNELINDEX nChn = 0; nChn < GetNumChannels(); nChn++)\n'}], 'added': [{'line_no': 978, 'char_start': 31995, 'char_end': 32021, 'line': '\t\t\t\tpChn = playState.Chn;\n'}, {'line_no': 979, 'char_start': 32021, 'char_end': 32093,... | {'deleted': [], 'added': [{'char_start': 31999, 'char_end': 32025, 'chars': 'pChn = playState.Chn;\n\t\t\t\t'}, {'char_start': 32078, 'char_end': 32086, 'chars': 'Chn++, p'}]} | github.com/OpenMPT/openmpt/commit/492022c7297ede682161d9c0ec2de15526424e76 | soundlib/Snd_fx.cpp | cwe-125 | 11,000 |
cwe-416 | usb_audio_probe | static int usb_audio_probe(struct usb_interface *intf,
const struct usb_device_id *usb_id)
{
struct usb_device *dev = interface_to_usbdev(intf);
const struct snd_usb_audio_quirk *quirk =
(const struct snd_usb_audio_quirk *)usb_id->driver_info;
struct snd_usb_audio *chip;
int i, err;
struct usb_host_interfa... | static int usb_audio_probe(struct usb_interface *intf,
const struct usb_device_id *usb_id)
{
struct usb_device *dev = interface_to_usbdev(intf);
const struct snd_usb_audio_quirk *quirk =
(const struct snd_usb_audio_quirk *)usb_id->driver_info;
struct snd_usb_audio *chip;
int i, err;
struct usb_host_interfa... | {'deleted': [{'line_no': 120, 'char_start': 3144, 'char_end': 3173, 'line': '\t\tatomic_dec(&chip->active);\n'}], 'added': [{'line_no': 118, 'char_start': 3085, 'char_end': 3136, 'line': '\t\t/* chip->active is inside the chip->card object,\n'}, {'line_no': 119, 'char_start': 3136, 'char_end': 3187, 'line': '\t\t * dec... | {'deleted': [{'char_start': 3087, 'char_end': 3089, 'chars': 'if'}, {'char_start': 3090, 'char_end': 3092, 'chars': '(!'}, {'char_start': 3098, 'char_end': 3102, 'chars': 'num_'}, {'char_start': 3107, 'char_end': 3109, 'chars': 'fa'}, {'char_start': 3110, 'char_end': 3113, 'chars': 'es)'}, {'char_start': 3116, 'char_en... | github.com/torvalds/linux/commit/5f8cf712582617d523120df67d392059eaf2fc4b | sound/usb/card.c | cwe-416 | 987 |
cwe-125 | ReadPSDChannelPixels | static MagickBooleanType ReadPSDChannelPixels(Image *image,
const size_t channels,const size_t row,const ssize_t type,
const unsigned char *pixels,ExceptionInfo *exception)
{
Quantum
pixel;
register const unsigned char
*p;
register Quantum
*q;
register ssize_t
x;
size_t
packet_size... | static MagickBooleanType ReadPSDChannelPixels(Image *image,
const size_t channels,const size_t row,const ssize_t type,
const unsigned char *pixels,ExceptionInfo *exception)
{
Quantum
pixel;
register const unsigned char
*p;
register Quantum
*q;
register ssize_t
x;
size_t
packet_size... | {'deleted': [{'line_no': 72, 'char_start': 1913, 'char_end': 1960, 'line': ' GetPixelIndex(image,q),q);\n'}], 'added': [{'line_no': 72, 'char_start': 1913, 'char_end': 1986, 'line': ' ConstrainColormapIndex(image,GetPixelIndex(image,q),\n'}, {'line_no': 73, 'char_start': 1986, 'cha... | {'deleted': [], 'added': [{'char_start': 1933, 'char_end': 1962, 'chars': 'ConstrainColormapIndex(image,'}, {'char_start': 1983, 'char_end': 2017, 'chars': '),\n exception'}]} | github.com/ImageMagick/ImageMagick/commit/e14fd0a2801f73bdc123baf4fbab97dec55919eb | coders/psd.c | cwe-125 | 764 |
cwe-078 | process_statistics | def process_statistics(self, metadata, _):
args = [metadata.hostname, '-p', metadata.profile, '-g',
':'.join([g for g in metadata.groups])]
for notifier in os.listdir(self.data):
if ((notifier[-1] == '~') or
(notifier[:2] == '.#') or
(notif... | def process_statistics(self, metadata, _):
args = [metadata.hostname, '-p', metadata.profile, '-g',
':'.join([g for g in metadata.groups])]
self.debug_log("running triggers")
for notifier in os.listdir(self.data):
self.debug_log("running %s" % notifier)
... | {'deleted': [{'line_no': 10, 'char_start': 425, 'char_end': 472, 'line': " npath = self.data + '/' + notifier\n"}, {'line_no': 11, 'char_start': 472, 'char_end': 545, 'line': ' self.logger.debug("Running %s %s" % (npath, " ".join(args)))\n'}, {'line_no': 12, 'char_start': 545, 'char_end': 579, 'li... | {'deleted': [{'char_start': 454, 'char_end': 462, 'chars': " + '/' +"}, {'char_start': 489, 'char_end': 557, 'chars': 'logger.debug("Running %s %s" % (npath, " ".join(args)))\n '}, {'char_start': 572, 'char_end': 573, 'chars': ','}], 'added': [{'char_start': 176, 'char_end': 219, 'chars': 'self.debug_log("ru... | github.com/Bcfg2/bcfg2/commit/a524967e8d5c4c22e49cd619aed20c87a316c0be | src/lib/Server/Plugins/Trigger.py | cwe-078 | 149 |
cwe-078 | do_setup | def do_setup(self, ctxt):
"""Check that we have all configuration details from the storage."""
LOG.debug(_('enter: do_setup'))
self._context = ctxt
# Validate that the pool exists
ssh_cmd = 'svcinfo lsmdiskgrp -delim ! -nohdr'
out, err = self._run_ssh(ssh_cmd)
... | def do_setup(self, ctxt):
"""Check that we have all configuration details from the storage."""
LOG.debug(_('enter: do_setup'))
self._context = ctxt
# Validate that the pool exists
ssh_cmd = ['svcinfo', 'lsmdiskgrp', '-delim', '!', '-nohdr']
out, err = self._run_ssh(... | {'deleted': [{'line_no': 8, 'char_start': 218, 'char_end': 273, 'line': " ssh_cmd = 'svcinfo lsmdiskgrp -delim ! -nohdr'\n"}, {'line_no': 21, 'char_start': 806, 'char_end': 857, 'line': " ssh_cmd = 'svcinfo lslicense -delim !'\n"}, {'line_no': 34, 'char_start': 1463, 'char_end': 1507, 'line': " ... | {'deleted': [], 'added': [{'char_start': 236, 'char_end': 237, 'chars': '['}, {'char_start': 245, 'char_end': 247, 'chars': "',"}, {'char_start': 248, 'char_end': 249, 'chars': "'"}, {'char_start': 259, 'char_end': 261, 'chars': "',"}, {'char_start': 262, 'char_end': 263, 'chars': "'"}, {'char_start': 269, 'char_end': ... | github.com/thatsdone/cinder/commit/f752302d181583a95cf44354aea607ce9d9283f4 | cinder/volume/drivers/storwize_svc.py | cwe-078 | 861 |
cwe-125 | ReadOneMNGImage | static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info,
ExceptionInfo *exception)
{
char
page_geometry[MaxTextExtent];
Image
*image;
MagickBooleanType
logging;
volatile int
first_mng_object,
object_id,
term_chunk_found,
skip_to_iend;
volatile ssize_t
... | static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info,
ExceptionInfo *exception)
{
char
page_geometry[MaxTextExtent];
Image
*image;
MagickBooleanType
logging;
volatile int
first_mng_object,
object_id,
term_chunk_found,
skip_to_iend;
volatile ssize_t
... | {'deleted': [], 'added': [{'line_no': 885, 'char_start': 27353, 'char_end': 27408, 'line': ' if ((i < 0) || (i >= MNG_MAX_OBJECTS))\n'}, {'line_no': 886, 'char_start': 27408, 'char_end': 27436, 'line': ' continue;\n'}]} | {'deleted': [], 'added': [{'char_start': 27373, 'char_end': 27456, 'chars': '(i < 0) || (i >= MNG_MAX_OBJECTS))\n continue;\n if ('}]} | github.com/ImageMagick/ImageMagick/commit/78d4c5db50fbab0b4beb69c46c6167f2c6513dec | coders/png.c | cwe-125 | 17,324 |
cwe-078 | _cmd_to_dict | def _cmd_to_dict(self, cmd):
arg_list = cmd.split()
no_param_args = [
'autodelete',
'autoexpand',
'bytes',
'compressed',
'force',
'nohdr',
]
one_param_args = [
'chapsecret',
'cleanrate',
... | def _cmd_to_dict(self, arg_list):
no_param_args = [
'autodelete',
'autoexpand',
'bytes',
'compressed',
'force',
'nohdr',
]
one_param_args = [
'chapsecret',
'cleanrate',
'copyrate',
... | {'deleted': [{'line_no': 1, 'char_start': 0, 'char_end': 33, 'line': ' def _cmd_to_dict(self, cmd):\n'}], 'added': [{'line_no': 1, 'char_start': 0, 'char_end': 38, 'line': ' def _cmd_to_dict(self, arg_list):\n'}]} | {'deleted': [{'char_start': 27, 'char_end': 41, 'chars': 'cmd):\n '}, {'char_start': 49, 'char_end': 62, 'chars': ' = cmd.split('}], 'added': [{'char_start': 36, 'char_end': 37, 'chars': ':'}]} | github.com/thatsdone/cinder/commit/f752302d181583a95cf44354aea607ce9d9283f4 | cinder/tests/test_storwize_svc.py | cwe-078 | 459 |
cwe-787 | adminchild | void * adminchild(struct clientparam* param) {
int i, res;
char * buf;
char username[256];
char *sb;
char *req = NULL;
struct printparam pp;
int contentlen = 0;
int isform = 0;
pp.inbuf = 0;
pp.cp = param;
buf = myalloc(LINESIZE);
if(!buf) {RETURN(555);}
i = sockgetlinebuf(param, CLIENT, (unsigned char *... | void * adminchild(struct clientparam* param) {
int i, res;
char * buf;
char username[256];
char *sb;
char *req = NULL;
struct printparam pp;
unsigned contentlen = 0;
int isform = 0;
pp.inbuf = 0;
pp.cp = param;
buf = myalloc(LINESIZE);
if(!buf) {RETURN(555);}
i = sockgetlinebuf(param, CLIENT, (unsigned c... | {'deleted': [{'line_no': 8, 'char_start': 147, 'char_end': 168, 'line': ' int contentlen = 0;\n'}, {'line_no': 57, 'char_start': 1557, 'char_end': 1582, 'line': '\t\tcontentlen = atoi(sb);\n'}, {'line_no': 187, 'char_start': 5131, 'char_end': 5242, 'line': '\t\t\t\tprintstr(&pp, "<form method=\\"POST\\" action=\\"/U\\"... | {'deleted': [{'char_start': 150, 'char_end': 151, 'chars': 't'}, {'char_start': 1570, 'char_end': 1571, 'chars': '='}, {'char_start': 1572, 'char_end': 1579, 'chars': 'atoi(sb'}, {'char_start': 5437, 'char_end': 5438, 'chars': 't'}, {'char_start': 5698, 'char_end': 5714, 'chars': 'buf[i] = 0;\n\t\t\t\t'}, {'char_start'... | github.com/z3APA3A/3proxy/commit/3b67dc844789dc0f00e934270c7b349bcb547865 | src/webadmin.c | cwe-787 | 2,300 |
cwe-190 | uvesafb_setcmap | static int uvesafb_setcmap(struct fb_cmap *cmap, struct fb_info *info)
{
struct uvesafb_pal_entry *entries;
int shift = 16 - dac_width;
int i, err = 0;
if (info->var.bits_per_pixel == 8) {
if (cmap->start + cmap->len > info->cmap.start +
info->cmap.len || cmap->start < info->cmap.start)
return -EINVAL;
... | static int uvesafb_setcmap(struct fb_cmap *cmap, struct fb_info *info)
{
struct uvesafb_pal_entry *entries;
int shift = 16 - dac_width;
int i, err = 0;
if (info->var.bits_per_pixel == 8) {
if (cmap->start + cmap->len > info->cmap.start +
info->cmap.len || cmap->start < info->cmap.start)
return -EINVAL;
... | {'deleted': [{'line_no': 12, 'char_start': 321, 'char_end': 384, 'line': '\t\tentries = kmalloc(sizeof(*entries) * cmap->len, GFP_KERNEL);\n'}], 'added': [{'line_no': 12, 'char_start': 321, 'char_end': 376, 'line': '\t\tentries = kmalloc_array(cmap->len, sizeof(*entries),\n'}, {'line_no': 13, 'char_start': 376, 'char_e... | {'deleted': [{'char_start': 357, 'char_end': 369, 'chars': ' * cmap->len'}, {'char_start': 370, 'char_end': 371, 'chars': ' '}], 'added': [{'char_start': 340, 'char_end': 346, 'chars': '_array'}, {'char_start': 347, 'char_end': 358, 'chars': 'cmap->len, '}, {'char_start': 375, 'char_end': 381, 'chars': '\n\t\t\t\t\t'}]... | github.com/torvalds/linux/commit/9f645bcc566a1e9f921bdae7528a01ced5bc3713 | drivers/video/fbdev/uvesafb.c | cwe-190 | 352 |
cwe-078 | test_get_iscsi_ip_active | def test_get_iscsi_ip_active(self):
self.flags(lock_path=self.tempdir)
#record set up
self.clear_mox()
_run_ssh = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh)
self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_run_ssh", _run_ssh)
show_port_cmd = 'showp... | def test_get_iscsi_ip_active(self):
self.flags(lock_path=self.tempdir)
#record set up
self.clear_mox()
_run_ssh = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh)
self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_run_ssh", _run_ssh)
show_port_cmd = ['show... | {'deleted': [{'line_no': 9, 'char_start': 290, 'char_end': 325, 'line': " show_port_cmd = 'showport'\n"}, {'line_no': 12, 'char_start': 397, 'char_end': 441, 'line': " show_port_i_cmd = 'showport -iscsi'\n"}, {'line_no': 16, 'char_start': 579, 'char_end': 627, 'line': " show_port_i_cmd = 'showport ... | {'deleted': [], 'added': [{'char_start': 314, 'char_end': 315, 'chars': '['}, {'char_start': 325, 'char_end': 326, 'chars': ']'}, {'char_start': 425, 'char_end': 426, 'chars': '['}, {'char_start': 435, 'char_end': 437, 'chars': "',"}, {'char_start': 438, 'char_end': 439, 'chars': "'"}, {'char_start': 446, 'char_end': 4... | github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f | cinder/tests/test_hp3par.py | cwe-078 | 393 |
cwe-022 | download_check_files | def download_check_files(self, filelist):
# only admins and allowed users may download
if not cherrypy.session['admin']:
uo = self.useroptions.forUser(self.getUserId())
if not uo.getOptionValue('media.may_download'):
return 'not_permitted'
# make sure ... | def download_check_files(self, filelist):
# only admins and allowed users may download
if not cherrypy.session['admin']:
uo = self.useroptions.forUser(self.getUserId())
if not uo.getOptionValue('media.may_download'):
return 'not_permitted'
# make sure ... | {'deleted': [{'line_no': 9, 'char_start': 383, 'char_end': 411, 'line': " if '/../' in f:\n"}], 'added': [{'line_no': 10, 'char_start': 443, 'char_end': 494, 'line': " if '/../' in f or f.startswith('../'):\n"}, {'line_no': 11, 'char_start': 494, 'char_end': 532, 'line': " return 'i... | {'deleted': [], 'added': [{'char_start': 395, 'char_end': 455, 'chars': "# don't allow to traverse up in the file system\n "}, {'char_start': 469, 'char_end': 625, 'chars': " or f.startswith('../'):\n return 'invalid_file'\n # CVE-2015-8309: do not allow absolute file paths\n ... | github.com/devsnd/cherrymusic/commit/62dec34a1ea0741400dd6b6c660d303dcd651e86 | cherrymusicserver/httphandler.py | cwe-022 | 171 |
cwe-079 | PeerListWidget::addPeer | QStandardItem* PeerListWidget::addPeer(const QString& ip, BitTorrent::TorrentHandle *const torrent, const BitTorrent::PeerInfo &peer)
{
int row = m_listModel->rowCount();
// Adding Peer to peer list
m_listModel->insertRow(row);
m_listModel->setData(m_listModel->index(row, PeerListDelegate::IP), ip);
... | QStandardItem* PeerListWidget::addPeer(const QString& ip, BitTorrent::TorrentHandle *const torrent, const BitTorrent::PeerInfo &peer)
{
int row = m_listModel->rowCount();
// Adding Peer to peer list
m_listModel->insertRow(row);
m_listModel->setData(m_listModel->index(row, PeerListDelegate::IP), ip);
... | {'deleted': [{'line_no': 24, 'char_start': 1441, 'char_end': 1533, 'line': ' m_listModel->setData(m_listModel->index(row, PeerListDelegate::CLIENT), peer.client());\n'}], 'added': [{'line_no': 24, 'char_start': 1441, 'char_end': 1563, 'line': ' m_listModel->setData(m_listModel->index(row, PeerListDelegate::CLIENT... | {'deleted': [], 'added': [{'char_start': 1517, 'char_end': 1546, 'chars': 'Utils::String::toHtmlEscaped('}, {'char_start': 1558, 'char_end': 1559, 'chars': ')'}]} | github.com/qbittorrent/qBittorrent/commit/6ca3e4f094da0a0017cb2d483ec1db6176bb0b16 | src/gui/properties/peerlistwidget.cpp | cwe-079 | 621 |
cwe-022 | new_goal | def new_goal():
"""
new goal
"""
goals_dir_check()
click.echo(chalk.blue('Input a single-word name of the goal:'))
goal_name = input().strip()
if goal_name_exists(goal_name):
click.echo(chalk.red(
'A goal with this name already exists. Please type "yoda goals view" to ... | def new_goal():
"""
new goal
"""
goals_dir_check()
goal_name_not_ok = True
click.echo(chalk.blue('Input a single-word name of the goal:'))
while goal_name_not_ok:
goal_name = input().strip()
if goal_name.isalnum():
goal_name_not_ok = False
else:
... | {'deleted': [{'line_no': 9, 'char_start': 137, 'char_end': 169, 'line': ' goal_name = input().strip()\n'}, {'line_no': 19, 'char_start': 535, 'char_end': 570, 'line': ' deadline = input().strip()\n'}], 'added': [{'line_no': 8, 'char_start': 69, 'char_end': 97, 'line': ' goal_name_not_ok = True\n'}, {'line_... | {'deleted': [], 'added': [{'char_start': 73, 'char_end': 102, 'chars': 'goal_name_not_ok = True\n\n '}, {'char_start': 170, 'char_end': 202, 'chars': 'while goal_name_not_ok:\n '}, {'char_start': 230, 'char_end': 420, 'chars': " if goal_name.isalnum():\n goal_name_not_ok = False\n els... | github.com/yoda-pa/yoda/commit/263946316041601de75638ee303a892f2652cf40 | modules/goals.py | cwe-022 | 252 |
cwe-125 | decode_studio_vop_header | static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
if (get_bits_left(gb) <= 32)
return 0;
s->partitioned_frame = 0;
s->decode_mb = mpeg4_decode_studio_mb;
decode_smpte_tc(ctx, gb);
skip_bits(gb, 10); /* temporal_reference */
... | static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
if (get_bits_left(gb) <= 32)
return 0;
s->partitioned_frame = 0;
s->interlaced_dct = 0;
s->decode_mb = mpeg4_decode_studio_mb;
decode_smpte_tc(ctx, gb);
skip_bits(gb, 10); ... | {'deleted': [], 'added': [{'line_no': 9, 'char_start': 195, 'char_end': 222, 'line': ' s->interlaced_dct = 0;\n'}]} | {'deleted': [], 'added': [{'char_start': 202, 'char_end': 229, 'chars': 'interlaced_dct = 0;\n s->'}]} | github.com/FFmpeg/FFmpeg/commit/1f686d023b95219db933394a7704ad9aa5f01cbb | libavcodec/mpeg4videodec.c | cwe-125 | 624 |
cwe-125 | handle_eac3 | static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track)
{
AC3HeaderInfo *hdr = NULL;
struct eac3_info *info;
int num_blocks, ret;
if (!track->eac3_priv && !(track->eac3_priv = av_mallocz(sizeof(*info))))
return AVERROR(ENOMEM);
info = track->eac3_priv;
if (avpriv_ac3... | static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track)
{
AC3HeaderInfo *hdr = NULL;
struct eac3_info *info;
int num_blocks, ret;
if (!track->eac3_priv && !(track->eac3_priv = av_mallocz(sizeof(*info))))
return AVERROR(ENOMEM);
info = track->eac3_priv;
if (avpriv_ac3... | {'deleted': [{'line_no': 42, 'char_start': 1457, 'char_end': 1543, 'line': ' avpriv_request_sample(track->par, "Multiple independent substreams");\n'}], 'added': [{'line_no': 42, 'char_start': 1457, 'char_end': 1540, 'line': ' avpriv_request_sample(mov->fc, "Multiple independent substreams... | {'deleted': [{'char_start': 1495, 'char_end': 1500, 'chars': 'track'}, {'char_start': 1502, 'char_end': 1505, 'chars': 'par'}], 'added': [{'char_start': 1495, 'char_end': 1498, 'chars': 'mov'}, {'char_start': 1500, 'char_end': 1502, 'chars': 'fc'}]} | github.com/FFmpeg/FFmpeg/commit/95556e27e2c1d56d9e18f5db34d6f756f3011148 | libavformat/movenc.c | cwe-125 | 1,295 |
cwe-079 | manipulate_reservation_action | def manipulate_reservation_action(request: HttpRequest, default_foreward_url: str):
"""
This function is used to alter the reservation beeing build inside
a cookie. This function automatically crafts the required response.
"""
js_string: str = ""
r: GroupReservation = None
u: Profile = get_c... | def manipulate_reservation_action(request: HttpRequest, default_foreward_url: str):
"""
This function is used to alter the reservation beeing build inside
a cookie. This function automatically crafts the required response.
"""
js_string: str = ""
r: GroupReservation = None
u: Profile = get_c... | {'deleted': [{'line_no': 22, 'char_start': 869, 'char_end': 914, 'line': ' sr.notes = request.POST["notes"]\n'}, {'line_no': 42, 'char_start': 1748, 'char_end': 1788, 'line': ' r.notes = request.POST["notes"]\n'}, {'line_no': 44, 'char_start': 1824, 'char_end': 1883, 'line': ' r.responsiblePers... | {'deleted': [], 'added': [{'char_start': 892, 'char_end': 899, 'chars': 'escape('}, {'char_start': 920, 'char_end': 921, 'chars': ')'}, {'char_start': 1774, 'char_end': 1781, 'chars': 'escape('}, {'char_start': 1802, 'char_end': 1803, 'chars': ')'}, {'char_start': 1870, 'char_end': 1877, 'chars': 'escape('}, {'char_sta... | github.com/Technikradio/C3FOCSite/commit/6e330d4d44bbfdfce9993dffea97008276771600 | c3shop/frontpage/management/reservation_actions.py | cwe-079 | 479 |
cwe-089 | save_failure_transaction | def save_failure_transaction(self, user_id, project_id, money):
self.cursor.execute("insert into transactions (project_id,user_id, money, timestamp, state) values (%s, %s, %s, now(), 'failed' )" % (project_id, user_id, money))
self.db.commit() | def save_failure_transaction(self, user_id, project_id, money):
self.cursor.execute("insert into transactions (project_id,user_id, money, timestamp, state) values (%s, %s, "
"%s, now(), 'failed' )", (project_id, user_id, money))
self.db.commit() | {'deleted': [{'line_no': 2, 'char_start': 68, 'char_end': 239, 'line': ' self.cursor.execute("insert into transactions (project_id,user_id, money, timestamp, state) values (%s, %s, %s, now(), \'failed\' )" % (project_id, user_id, money))\n'}], 'added': [{'line_no': 2, 'char_start': 68, 'char_end': 186, 'line': '... | {'deleted': [{'char_start': 206, 'char_end': 208, 'chars': ' %'}], 'added': [{'char_start': 184, 'char_end': 215, 'chars': '"\n "'}, {'char_start': 237, 'char_end': 238, 'chars': ','}]} | github.com/JLucka/kickstarter-dev/commit/e2ffa062697e060fdfbd2eccbb89a8c53a569e0b | backend/transactions/TransactionConnector.py | cwe-089 | 66 |
cwe-078 | _map_vol_to_host | def _map_vol_to_host(self, volume_name, host_name):
"""Create a mapping between a volume to a host."""
LOG.debug(_('enter: _map_vol_to_host: volume %(volume_name)s to '
'host %(host_name)s')
% {'volume_name': volume_name, 'host_name': host_name})
# Che... | def _map_vol_to_host(self, volume_name, host_name):
"""Create a mapping between a volume to a host."""
LOG.debug(_('enter: _map_vol_to_host: volume %(volume_name)s to '
'host %(host_name)s')
% {'volume_name': volume_name, 'host_name': host_name})
# Che... | {'deleted': [{'line_no': 29, 'char_start': 1119, 'char_end': 1194, 'line': " ssh_cmd = ('svctask mkvdiskhostmap -host %(host_name)s -scsi '\n"}, {'line_no': 30, 'char_start': 1194, 'char_end': 1252, 'line': " '%(result_lun)s %(volume_name)s' %\n"}, {'line_no': 31, 'char_start': 1252, 'c... | {'deleted': [{'char_start': 1141, 'char_end': 1142, 'chars': '('}, {'char_start': 1165, 'char_end': 1192, 'chars': ' -host %(host_name)s -scsi '}, {'char_start': 1193, 'char_end': 1216, 'chars': '\n '}, {'char_start': 1218, 'char_end': 1277, 'chars': "%(result_lun)s %(volume_name)s' %\n ... | github.com/thatsdone/cinder/commit/f752302d181583a95cf44354aea607ce9d9283f4 | cinder/volume/drivers/storwize_svc.py | cwe-078 | 630 |
cwe-089 | verify_email | def verify_email(self, member):
query = "SELECT COUNT(email) FROM members WHERE email = '{email}'".format(email = member)
self.cursor.execute(query)
result = self.cursor.fetchone()
if (int(result[0]) > 0):
return True
else:
return False | def verify_email(self, member):
self.cursor.execute("SELECT COUNT(email) FROM members WHERE email = ':email'", {'email':member})
result = self.cursor.fetchone()
if (int(result[0]) > 0):
return True
else:
return False | {'deleted': [{'line_no': 2, 'char_start': 36, 'char_end': 134, 'line': ' query = "SELECT COUNT(email) FROM members WHERE email = \'{email}\'".format(email = member)\n'}, {'line_no': 3, 'char_start': 134, 'char_end': 169, 'line': ' self.cursor.execute(query)\n'}], 'added': [{'line_no': 2, 'char_start': 36,... | {'deleted': [{'char_start': 44, 'char_end': 46, 'chars': 'qu'}, {'char_start': 48, 'char_end': 52, 'chars': 'y = '}, {'char_start': 101, 'char_end': 102, 'chars': '{'}, {'char_start': 107, 'char_end': 108, 'chars': '}'}, {'char_start': 110, 'char_end': 118, 'chars': '.format('}, {'char_start': 123, 'char_end': 126, 'ch... | github.com/kenboo98/291-Mini-Project-I/commit/3080ccb687c79c83954ce703faee8fcceec8c9eb | book_rides/book_rides.py | cwe-089 | 65 |
cwe-089 | overview | @app.route('/overview/<classNum>')
def overview(classNum):
if 'username' in session:
classNoSpace = classNum.split(' ')[0]+classNum.split(' ')[1]
#Save the current course as a session variable.
session['currentCourse'] = classNoSpace
conn = mysql.connect()
cursor = conn.cursor()
cursor.execute("SELECT c... | @app.route('/overview/<classNum>')
def overview(classNum):
if 'username' in session:
classNoSpace = classNum.split(' ')[0]+classNum.split(' ')[1]
#Save the current course as a session variable.
session['currentCourse'] = classNoSpace
conn = mysql.connect()
cursor = conn.cursor()
cursor.execute("SELECT c... | {'deleted': [{'line_no': 12, 'char_start': 294, 'char_end': 408, 'line': '\t\tcursor.execute("SELECT courseName,courseOverview from courses where courseAbbreviation=\'" + classNoSpace + "\'")\n'}], 'added': [{'line_no': 12, 'char_start': 294, 'char_end': 404, 'line': '\t\tcursor.execute("SELECT courseName,courseOvervie... | {'deleted': [{'char_start': 383, 'char_end': 384, 'chars': "'"}, {'char_start': 386, 'char_end': 388, 'chars': '+ '}, {'char_start': 400, 'char_end': 406, 'chars': ' + "\'"'}], 'added': [{'char_start': 383, 'char_end': 385, 'chars': '%s'}, {'char_start': 386, 'char_end': 387, 'chars': ','}, {'char_start': 388, 'char_en... | github.com/CaitlinKennedy/Tech-Track/commit/20ef2d4010f9497b8221524edd0c706e2c6a4147 | src/tech_track.py | cwe-089 | 139 |
cwe-089 | registerPlayer | def registerPlayer(name):
"""Adds a player to the tournament database.
The database assigns a unique serial id number for the player. (This
should be handled by your SQL database schema, not in your Python code.)
Args:
name: the player's full name (need not be unique).
"""
conn = connec... | def registerPlayer(name):
"""Adds a player to the tournament database.
The database assigns a unique serial id number for the player. (This
should be handled by your SQL database schema, not in your Python code.)
Args:
name: the player's full name (need not be unique).
"""
conn = connec... | {'deleted': [{'line_no': 12, 'char_start': 351, 'char_end': 425, 'line': ' cursor.execute("INSERT INTO players (name) VALUES (\'%s\')" % (name,));\n'}], 'added': [{'line_no': 12, 'char_start': 351, 'char_end': 405, 'line': ' query = "INSERT INTO players (name) VALUES (%s);"\n'}, {'line_no': 13, 'char_start': 405,... | {'deleted': [{'char_start': 355, 'char_end': 356, 'chars': 'c'}, {'char_start': 357, 'char_end': 360, 'chars': 'rso'}, {'char_start': 361, 'char_end': 370, 'chars': '.execute('}, {'char_start': 406, 'char_end': 407, 'chars': "'"}, {'char_start': 409, 'char_end': 410, 'chars': "'"}, {'char_start': 413, 'char_end': 414, ... | github.com/sarahkcaplan/tournament/commit/40aba5686059f5f398f6323b1483412c56140cc0 | tournament.py | cwe-089 | 106 |
cwe-125 | parse_hid_report_descriptor | static void parse_hid_report_descriptor(struct gtco *device, char * report,
int length)
{
struct device *ddev = &device->intf->dev;
int x, i = 0;
/* Tag primitive vars */
__u8 prefix;
__u8 size;
__u8 tag;
__u8 type;
__u8 data = 0;
__u16 data16 = 0;
__u32 data32 = 0;
/* For parsing logi... | static void parse_hid_report_descriptor(struct gtco *device, char * report,
int length)
{
struct device *ddev = &device->intf->dev;
int x, i = 0;
/* Tag primitive vars */
__u8 prefix;
__u8 size;
__u8 tag;
__u8 type;
__u8 data = 0;
__u16 data16 = 0;
__u32 data32 = 0;
/* For parsing logi... | {'deleted': [{'line_no': 35, 'char_start': 704, 'char_end': 726, 'line': '\t\tprefix = report[i];\n'}, {'line_no': 36, 'char_start': 726, 'char_end': 727, 'line': '\n'}, {'line_no': 37, 'char_start': 727, 'char_end': 752, 'line': '\t\t/* Skip over prefix */\n'}, {'line_no': 38, 'char_start': 752, 'char_end': 759, 'line... | {'deleted': [{'char_start': 723, 'char_end': 755, 'chars': '];\n\n\t\t/* Skip over prefix */\n\t\ti'}, {'char_start': 987, 'char_end': 988, 'chars': '3'}, {'char_start': 989, 'char_end': 1002, 'chars': '\n\t\t\tsize = 4;'}], 'added': [{'char_start': 723, 'char_end': 725, 'chars': '++'}, {'char_start': 807, 'char_end': ... | github.com/torvalds/linux/commit/a50829479f58416a013a4ccca791336af3c584c7 | drivers/input/tablet/gtco.c | cwe-125 | 2,397 |
cwe-125 | update_read_bitmap_data | static BOOL update_read_bitmap_data(rdpUpdate* update, wStream* s, BITMAP_DATA* bitmapData)
{
WINPR_UNUSED(update);
if (Stream_GetRemainingLength(s) < 18)
return FALSE;
Stream_Read_UINT16(s, bitmapData->destLeft);
Stream_Read_UINT16(s, bitmapData->destTop);
Stream_Read_UINT16(s, bitmapData->destRight);
Stream_... | static BOOL update_read_bitmap_data(rdpUpdate* update, wStream* s, BITMAP_DATA* bitmapData)
{
WINPR_UNUSED(update);
if (Stream_GetRemainingLength(s) < 18)
return FALSE;
Stream_Read_UINT16(s, bitmapData->destLeft);
Stream_Read_UINT16(s, bitmapData->destTop);
Stream_Read_UINT16(s, bitmapData->destRight);
Stream_... | {'deleted': [], 'added': [{'line_no': 21, 'char_start': 699, 'char_end': 740, 'line': '\t\t\tif (Stream_GetRemainingLength(s) < 8)\n'}, {'line_no': 22, 'char_start': 740, 'char_end': 758, 'line': '\t\t\t\treturn FALSE;\n'}, {'line_no': 23, 'char_start': 758, 'char_end': 759, 'line': '\n'}]} | {'deleted': [], 'added': [{'char_start': 702, 'char_end': 762, 'chars': 'if (Stream_GetRemainingLength(s) < 8)\n\t\t\t\treturn FALSE;\n\n\t\t\t'}]} | github.com/FreeRDP/FreeRDP/commit/f8890a645c221823ac133dbf991f8a65ae50d637 | libfreerdp/core/update.c | cwe-125 | 459 |
cwe-787 | rds_rdma_extra_size | int rds_rdma_extra_size(struct rds_rdma_args *args)
{
struct rds_iovec vec;
struct rds_iovec __user *local_vec;
int tot_pages = 0;
unsigned int nr_pages;
unsigned int i;
local_vec = (struct rds_iovec __user *)(unsigned long) args->local_vec_addr;
/* figure out the number of pages in the vector */
for (i = 0; ... | int rds_rdma_extra_size(struct rds_rdma_args *args)
{
struct rds_iovec vec;
struct rds_iovec __user *local_vec;
int tot_pages = 0;
unsigned int nr_pages;
unsigned int i;
local_vec = (struct rds_iovec __user *)(unsigned long) args->local_vec_addr;
if (args->nr_local == 0)
return -EINVAL;
/* figure out the n... | {'deleted': [], 'added': [{'line_no': 11, 'char_start': 255, 'char_end': 281, 'line': '\tif (args->nr_local == 0)\n'}, {'line_no': 12, 'char_start': 281, 'char_end': 299, 'line': '\t\treturn -EINVAL;\n'}, {'line_no': 13, 'char_start': 299, 'char_end': 300, 'line': '\n'}]} | {'deleted': [], 'added': [{'char_start': 256, 'char_end': 301, 'chars': 'if (args->nr_local == 0)\n\t\treturn -EINVAL;\n\n\t'}]} | github.com/torvalds/linux/commit/c095508770aebf1b9218e77026e48345d719b17c | net/rds/rdma.c | cwe-787 | 225 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.