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-416
SMB2_write
SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms, unsigned int *nbytes, struct kvec *iov, int n_vec) { struct smb_rqst rqst; int rc = 0; struct smb2_write_req *req = NULL; struct smb2_write_rsp *rsp = NULL; int resp_buftype; struct kvec rsp_iov; int flags = 0; unsigned int total_len; *nby...
SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms, unsigned int *nbytes, struct kvec *iov, int n_vec) { struct smb_rqst rqst; int rc = 0; struct smb2_write_req *req = NULL; struct smb2_write_rsp *rsp = NULL; int resp_buftype; struct kvec rsp_iov; int flags = 0; unsigned int total_len; *nby...
{'deleted': [{'line_no': 56, 'char_start': 1475, 'char_end': 1505, 'line': '\tcifs_small_buf_release(req);\n'}], 'added': [{'line_no': 73, 'char_start': 2020, 'char_end': 2050, 'line': '\tcifs_small_buf_release(req);\n'}]}
{'deleted': [{'char_start': 1476, 'char_end': 1506, 'chars': 'cifs_small_buf_release(req);\n\t'}], 'added': [{'char_start': 2019, 'char_end': 2049, 'chars': '\n\tcifs_small_buf_release(req);'}]}
github.com/torvalds/linux/commit/6a3eb3360667170988f8a6477f6686242061488a
fs/cifs/smb2pdu.c
cwe-416
673
cwe-476
_kdc_as_rep
_kdc_as_rep(kdc_request_t r, krb5_data *reply, const char *from, struct sockaddr *from_addr, int datagram_reply) { krb5_context context = r->context; krb5_kdc_configuration *config = r->config; KDC_REQ *req = &r->req; KDC_REQ_BODY *b = NULL; AS_REP rep; KDCOptions f; krb5...
_kdc_as_rep(kdc_request_t r, krb5_data *reply, const char *from, struct sockaddr *from_addr, int datagram_reply) { krb5_context context = r->context; krb5_kdc_configuration *config = r->config; KDC_REQ *req = &r->req; KDC_REQ_BODY *b = NULL; AS_REP rep; KDCOptions f; krb5...
{'deleted': [{'line_no': 619, 'char_start': 16727, 'char_end': 16801, 'line': ' if(ret != 0 && ret != HDB_ERR_NOT_FOUND_HERE && reply->length == 0) {\n'}, {'line_no': 626, 'char_start': 16945, 'char_end': 16974, 'line': '\t\t\t\t &r->client_princ->name,\n'}, {'line_no': 627, 'char_start': 16974, 'char_end': 17004, '...
{'deleted': [], 'added': [{'char_start': 16733, 'char_end': 16734, 'chars': ' '}, {'char_start': 16951, 'char_end': 17006, 'chars': 'r->client_princ ?\n '}, {'char_start': 17028, 'char_end': 17035, 'chars': ' : NULL'}, {'char_start': 17042, 'char_end': 17097, 'chars': 'r->client_prin...
github.com/heimdal/heimdal/commit/1a6a6e462dc2ac6111f9e02c6852ddec4849b887
kdc/kerberos5.c
cwe-476
5,675
cwe-078
_get_host_from_connector
def _get_host_from_connector(self, connector): """List the hosts defined in the storage. Return the host name with the given connection info, or None if there is no host fitting that information. """ prefix = self._connector_to_hostname_prefix(connector) LOG.debug(...
def _get_host_from_connector(self, connector): """List the hosts defined in the storage. Return the host name with the given connection info, or None if there is no host fitting that information. """ prefix = self._connector_to_hostname_prefix(connector) LOG.debug(...
{'deleted': [{'line_no': 13, 'char_start': 421, 'char_end': 465, 'line': " ssh_cmd = 'svcinfo lshost -delim !'\n"}], 'added': [{'line_no': 13, 'char_start': 421, 'char_end': 476, 'line': " ssh_cmd = ['svcinfo', 'lshost', '-delim', '!']\n"}]}
{'deleted': [], 'added': [{'char_start': 439, 'char_end': 440, 'chars': '['}, {'char_start': 448, 'char_end': 450, 'chars': "',"}, {'char_start': 451, 'char_end': 452, 'chars': "'"}, {'char_start': 458, 'char_end': 460, 'chars': "',"}, {'char_start': 461, 'char_end': 462, 'chars': "'"}, {'char_start': 468, 'char_end': ...
github.com/thatsdone/cinder/commit/f752302d181583a95cf44354aea607ce9d9283f4
cinder/volume/drivers/storwize_svc.py
cwe-078
331
cwe-125
adjust_scalar_min_max_vals
static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, struct bpf_reg_state *dst_reg, struct bpf_reg_state src_reg) { struct bpf_reg_state *regs = cur_regs(env); u8 opcode = BPF_OP(insn->code); bool src_known, dst_known; s64 smin_val, smax_val; u64 ...
static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, struct bpf_reg_state *dst_reg, struct bpf_reg_state src_reg) { struct bpf_reg_state *regs = cur_regs(env); u8 opcode = BPF_OP(insn->code); bool src_known, dst_known; s64 smin_val, smax_val; u64 ...
{'deleted': [{'line_no': 248, 'char_start': 8087, 'char_end': 8122, 'line': '\t\tcoerce_reg_to_size(&src_reg, 4);\n'}], 'added': [{'line_no': 13, 'char_start': 409, 'char_end': 436, 'line': '\tif (insn_bitness == 32) {\n'}, {'line_no': 14, 'char_start': 436, 'char_end': 500, 'line': '\t\t/* Relevant for 32-bit RSH: Inf...
{'deleted': [{'char_start': 8077, 'char_end': 8112, 'chars': '_reg, 4);\n\t\tcoerce_reg_to_size(&src'}], 'added': [{'char_start': 410, 'char_end': 658, 'chars': "if (insn_bitness == 32) {\n\t\t/* Relevant for 32-bit RSH: Information can propagate towards\n\t\t * LSB, so it isn't sufficient to only truncate the output t...
github.com/torvalds/linux/commit/b799207e1e1816b09e7a5920fbb2d5fcf6edd681
kernel/bpf/verifier.c
cwe-125
2,575
cwe-079
Logger::addPeer
void Logger::addPeer(const QString &ip, bool blocked, const QString &reason) { QWriteLocker locker(&lock); Log::Peer temp = { peerCounter++, QDateTime::currentMSecsSinceEpoch(), ip, blocked, reason }; m_peers.push_back(temp); if (m_peers.size() >= MAX_LOG_MESSAGES) m_peers.pop_front(); em...
void Logger::addPeer(const QString &ip, bool blocked, const QString &reason) { QWriteLocker locker(&lock); Log::Peer temp = { peerCounter++, QDateTime::currentMSecsSinceEpoch(), Utils::String::toHtmlEscaped(ip), blocked, Utils::String::toHtmlEscaped(reason) }; m_peers.push_back(temp); if (m_peers.size...
{'deleted': [{'line_no': 5, 'char_start': 112, 'char_end': 210, 'line': ' Log::Peer temp = { peerCounter++, QDateTime::currentMSecsSinceEpoch(), ip, blocked, reason };\n'}], 'added': [{'line_no': 5, 'char_start': 112, 'char_end': 270, 'line': ' Log::Peer temp = { peerCounter++, QDateTime::currentMSecsSinceEpoch()...
{'deleted': [], 'added': [{'char_start': 187, 'char_end': 216, 'chars': 'Utils::String::toHtmlEscaped('}, {'char_start': 218, 'char_end': 219, 'chars': ')'}, {'char_start': 230, 'char_end': 259, 'chars': 'Utils::String::toHtmlEscaped('}, {'char_start': 265, 'char_end': 266, 'chars': ')'}]}
github.com/qbittorrent/qBittorrent/commit/6ca3e4f094da0a0017cb2d483ec1db6176bb0b16
src/base/logger.cpp
cwe-079
87
cwe-125
readContigTilesIntoBuffer
static int readContigTilesIntoBuffer (TIFF* in, uint8* buf, uint32 imagelength, uint32 imagewidth, uint32 tw, uint32 tl, tsample_t spp, uint16 bps) { int status ...
static int readContigTilesIntoBuffer (TIFF* in, uint8* buf, uint32 imagelength, uint32 imagewidth, uint32 tw, uint32 tl, tsample_t spp, uint16 bps) { int status ...
{'deleted': [{'line_no': 60, 'char_start': 1763, 'char_end': 1803, 'line': ' tilebuf = _TIFFmalloc(tile_buffsize);\n'}], 'added': [{'line_no': 60, 'char_start': 1763, 'char_end': 1829, 'line': ' /* Add 3 padding bytes for extractContigSamplesShifted32bits */\n'}, {'line_no': 61, 'char_start': 1829, 'char_end': 1869, ...
{'deleted': [], 'added': [{'char_start': 1765, 'char_end': 1991, 'chars': '/* Add 3 padding bytes for extractContigSamplesShifted32bits */\n if( tile_buffsize > 0xFFFFFFFFU - 3 )\n {\n TIFFError("readContigTilesIntoBuffer", "Integer overflow when calculating buffer size.");\n exit(-1);\n }\n '}, {'char_st...
github.com/vadz/libtiff/commit/ae9365db1b271b62b35ce018eac8799b1d5e8a53
tools/tiffcrop.c
cwe-125
1,703
cwe-125
dbd_st_prepare
dbd_st_prepare( SV *sth, imp_sth_t *imp_sth, char *statement, SV *attribs) { int i; SV **svp; dTHX; #if MYSQL_VERSION_ID >= SERVER_PREPARE_VERSION #if MYSQL_VERSION_ID < CALL_PLACEHOLDER_VERSION char *str_ptr, *str_last_ptr; #if MYSQL_VERSION_ID < LIMIT_PLACEHOLDER_VERSION int limit_flag=0; #endif #en...
dbd_st_prepare( SV *sth, imp_sth_t *imp_sth, char *statement, SV *attribs) { int i; SV **svp; dTHX; #if MYSQL_VERSION_ID >= SERVER_PREPARE_VERSION #if MYSQL_VERSION_ID < CALL_PLACEHOLDER_VERSION char *str_ptr, *str_last_ptr; #if MYSQL_VERSION_ID < LIMIT_PLACEHOLDER_VERSION int limit_flag=0; #endif #en...
{'deleted': [{'line_no': 17, 'char_start': 324, 'char_end': 356, 'line': ' int col_type, prepare_retval;\n'}, {'line_no': 213, 'char_start': 7021, 'char_end': 7083, 'line': ' int has_statement_fields= imp_sth->stmt->fields != 0;\n'}, {'line_no': 227, 'char_start': 7601, 'char_end': 7614, 'line': ' /*\n...
{'deleted': [{'char_start': 330, 'char_end': 340, 'chars': 'col_type, '}, {'char_start': 7029, 'char_end': 7091, 'chars': 'int has_statement_fields= imp_sth->stmt->fields != 0;\n '}, {'char_start': 7611, 'char_end': 7679, 'chars': '/*\n if this statement has a result set, field types will '}, {'char_s...
github.com/perl5-dbi/DBD-mysql/commit/793b72b1a0baa5070adacaac0e12fd995a6fbabe
dbdimp.c
cwe-125
2,524
cwe-079
mode_receive
def mode_receive(self, request): """ This is called by render_POST when the client is telling us that it is ready to receive data as soon as it is available. This is the basis of a long-polling (comet) mechanism: the server will wait to reply until data is available. ...
def mode_receive(self, request): """ This is called by render_POST when the client is telling us that it is ready to receive data as soon as it is available. This is the basis of a long-polling (comet) mechanism: the server will wait to reply until data is available. ...
{'deleted': [{'line_no': 12, 'char_start': 389, 'char_end': 438, 'line': " csessid = request.args.get('csessid')[0]\n"}], 'added': [{'line_no': 12, 'char_start': 389, 'char_end': 446, 'line': " csessid = cgi.escape(request.args['csessid'][0])\n"}]}
{'deleted': [{'char_start': 419, 'char_end': 424, 'chars': '.get('}, {'char_start': 433, 'char_end': 434, 'chars': ')'}], 'added': [{'char_start': 407, 'char_end': 418, 'chars': 'cgi.escape('}, {'char_start': 430, 'char_end': 431, 'chars': '['}, {'char_start': 440, 'char_end': 441, 'chars': ']'}, {'char_start': 444, 'c...
github.com/evennia/evennia/commit/300261529b82f95414c9d1d7150d6eda4695bb93
evennia/server/portal/webclient_ajax.py
cwe-079
202
cwe-089
check
def check(current_num): try: cursor.execute('SELECT * FROM comics WHERE num="%s"' % current_num) except sqlite3.OperationalError: cursor.execute('CREATE TABLE comics (num text)') return False else: return False if cursor.fetchone() is None else True
def check(current_num): try: cursor.execute('SELECT * FROM comics WHERE num=?', (current_num,)) except sqlite3.OperationalError: cursor.execute('CREATE TABLE comics (num text)') return False else: return False if cursor.fetchone() is None else True
{'deleted': [{'line_no': 3, 'char_start': 33, 'char_end': 109, 'line': ' cursor.execute(\'SELECT * FROM comics WHERE num="%s"\' % current_num)\n'}], 'added': [{'line_no': 3, 'char_start': 33, 'char_end': 108, 'line': " cursor.execute('SELECT * FROM comics WHERE num=?', (current_num,))\n"}]}
{'deleted': [{'char_start': 88, 'char_end': 92, 'chars': '"%s"'}, {'char_start': 93, 'char_end': 95, 'chars': ' %'}], 'added': [{'char_start': 88, 'char_end': 89, 'chars': '?'}, {'char_start': 90, 'char_end': 91, 'chars': ','}, {'char_start': 92, 'char_end': 93, 'chars': '('}, {'char_start': 104, 'char_end': 106, 'char...
github.com/lord63/a_bunch_of_code/commit/c0d67a1312306fd1257c354bfb5d6cac7643aa29
comics/check_comics.py
cwe-089
63
cwe-089
tag_num_to_tag
def tag_num_to_tag(self, tag_num): ''' Returns tag given tag_num. ''' q = "SELECT tag FROM tags WHERE rowid = '" + str(tag_num) + "'" self.query(q) return self.c.fetchone()[0]
def tag_num_to_tag(self, tag_num): ''' Returns tag given tag_num. ''' q = "SELECT tag FROM tags WHERE rowid = ?" self.query(q, tag_num) return self.c.fetchone()[0]
{'deleted': [{'line_no': 4, 'char_start': 83, 'char_end': 155, 'line': ' q = "SELECT tag FROM tags WHERE rowid = \'" + str(tag_num) + "\'"\n'}, {'line_no': 5, 'char_start': 155, 'char_end': 177, 'line': ' self.query(q)\n'}], 'added': [{'line_no': 4, 'char_start': 83, 'char_end': 134, 'line': ' q = ...
{'deleted': [{'char_start': 131, 'char_end': 153, 'chars': '\'" + str(tag_num) + "\''}], 'added': [{'char_start': 131, 'char_end': 132, 'chars': '?'}, {'char_start': 154, 'char_end': 163, 'chars': ', tag_num'}]}
github.com/pukkapies/urop2019/commit/3ca2e2c291d2d5fe262d20a8e0520bdfb622432b
modules/query_lastfm.py
cwe-089
54
cwe-190
rwpng_read_image24_libpng
static pngquant_error rwpng_read_image24_libpng(FILE *infile, png24_image *mainprog_ptr, int verbose) { png_structp png_ptr = NULL; png_infop info_ptr = NULL; png_size_t rowbytes; int color_type, bit_depth; png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, mainprog_ptr, r...
static pngquant_error rwpng_read_image24_libpng(FILE *infile, png24_image *mainprog_ptr, int verbose) { png_structp png_ptr = NULL; png_infop info_ptr = NULL; png_size_t rowbytes; int color_type, bit_depth; png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, mainprog_ptr, r...
{'deleted': [{'line_no': 51, 'char_start': 2054, 'char_end': 2116, 'line': ' if (mainprog_ptr->width > INT_MAX/mainprog_ptr->height) {\n'}, {'line_no': 52, 'char_start': 2116, 'char_end': 2176, 'line': ' png_destroy_read_struct(&png_ptr, &info_ptr, NULL);\n'}, {'line_no': 53, 'char_start': 2176, 'char_end': 2...
{'deleted': [{'char_start': 1993, 'char_end': 2264, 'chars': "/ For overflow safety reject images that won't fit in 32-bit\n if (mainprog_ptr->width > INT_MAX/mainprog_ptr->height) {\n png_destroy_read_struct(&png_ptr, &info_ptr, NULL);\n return PNG_OUT_OF_MEMORY_ERROR; /* not quite true, but whatever...
github.com/pornel/pngquant/commit/b7c217680cda02dddced245d237ebe8c383be285
rwpng.c
cwe-190
2,127
cwe-089
analyze_smashgg
def analyze_smashgg(self, urls, name): LOG.info('we are about to analyze scene {} with {} brackets'.format(name, len(urls))) for url in urls: # Before we process this URL, check to see if we already have sql = "SELECT * FROM analyzed where base_url='{}'".format(url) ...
def analyze_smashgg(self, urls, name): LOG.info('we are about to analyze scene {} with {} brackets'.format(name, len(urls))) for url in urls: # Before we process this URL, check to see if we already have sql = "SELECT * FROM analyzed where base_url='{url}'" args =...
{'deleted': [{'line_no': 5, 'char_start': 236, 'char_end': 311, 'line': ' sql = "SELECT * FROM analyzed where base_url=\'{}\'".format(url)\n'}, {'line_no': 6, 'char_start': 311, 'char_end': 347, 'line': ' res = self.db.exec(sql)\n'}], 'added': [{'line_no': 5, 'char_start': 236, 'char_end': 302, 'l...
{'deleted': [{'char_start': 298, 'char_end': 303, 'chars': '.form'}, {'char_start': 304, 'char_end': 306, 'chars': 't('}, {'char_start': 309, 'char_end': 310, 'chars': ')'}], 'added': [{'char_start': 295, 'char_end': 298, 'chars': 'url'}, {'char_start': 301, 'char_end': 324, 'chars': "\n args = {'u"}, {'char...
github.com/DKelle/Smash_stats/commit/4bb83f3f6ce7d6bebbeb512cd015f9e72cf36d63
validURLs.py
cwe-089
203
cwe-125
ExtractPostscript
static Image *ExtractPostscript(Image *image,const ImageInfo *image_info, MagickOffsetType PS_Offset,ssize_t PS_Size,ExceptionInfo *exception) { char postscript_file[MaxTextExtent]; const MagicInfo *magic_info; FILE *ps_file; ImageInfo *clone_info; Image *image2; unsigned char ...
static Image *ExtractPostscript(Image *image,const ImageInfo *image_info, MagickOffsetType PS_Offset,ssize_t PS_Size,ExceptionInfo *exception) { char postscript_file[MaxTextExtent]; const MagicInfo *magic_info; FILE *ps_file; ImageInfo *clone_info; Image *image2; unsigned char ...
{'deleted': [{'line_no': 52, 'char_start': 1318, 'char_end': 1396, 'line': ' (void) CopyMagickMemory(clone_info->magick,magic_info->name,MaxTextExtent);\n'}], 'added': [{'line_no': 52, 'char_start': 1318, 'char_end': 1387, 'line': ' (void) strncpy(clone_info->magick,magic_info->name,MaxTextExtent);\n'}]}
{'deleted': [{'char_start': 1327, 'char_end': 1329, 'chars': 'Co'}, {'char_start': 1330, 'char_end': 1342, 'chars': 'yMagickMemor'}], 'added': [{'char_start': 1327, 'char_end': 1329, 'chars': 'st'}, {'char_start': 1330, 'char_end': 1333, 'chars': 'ncp'}]}
github.com/ImageMagick/ImageMagick/commit/a251039393f423c7858e63cab6aa98d17b8b7a41
coders/wpg.c
cwe-125
654
cwe-476
keyctl_read_key
long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen) { struct key *key; key_ref_t key_ref; long ret; /* find the key first */ key_ref = lookup_user_key(keyid, 0, 0); if (IS_ERR(key_ref)) { ret = -ENOKEY; goto error; } key = key_ref_to_ptr(key_ref); /* see if we can read it direct...
long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen) { struct key *key; key_ref_t key_ref; long ret; /* find the key first */ key_ref = lookup_user_key(keyid, 0, 0); if (IS_ERR(key_ref)) { ret = -ENOKEY; goto error; } key = key_ref_to_ptr(key_ref); if (test_bit(KEY_FLAG_NEGATIVE,...
{'deleted': [], 'added': [{'line_no': 16, 'char_start': 288, 'char_end': 337, 'line': '\tif (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) {\n'}, {'line_no': 17, 'char_start': 337, 'char_end': 354, 'line': '\t\tret = -ENOKEY;\n'}, {'line_no': 18, 'char_start': 354, 'char_end': 369, 'line': '\t\tgoto error2;\n'}, {'line_no'...
{'deleted': [], 'added': [{'char_start': 289, 'char_end': 374, 'chars': 'if (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) {\n\t\tret = -ENOKEY;\n\t\tgoto error2;\n\t}\n\n\t'}]}
github.com/torvalds/linux/commit/37863c43b2c6464f252862bf2e9768264e961678
security/keys/keyctl.c
cwe-476
334
cwe-190
git_delta_apply
int git_delta_apply( void **out, size_t *out_len, const unsigned char *base, size_t base_len, const unsigned char *delta, size_t delta_len) { const unsigned char *delta_end = delta + delta_len; size_t base_sz, res_sz, alloc_sz; unsigned char *res_dp; *out = NULL; *out_len = 0; /* * Check that the base s...
int git_delta_apply( void **out, size_t *out_len, const unsigned char *base, size_t base_len, const unsigned char *delta, size_t delta_len) { const unsigned char *delta_end = delta + delta_len; size_t base_sz, res_sz, alloc_sz; unsigned char *res_dp; *out = NULL; *out_len = 0; /* * Check that the base s...
{'deleted': [{'line_no': 43, 'char_start': 1128, 'char_end': 1156, 'line': '\t\t\tsize_t off = 0, len = 0;\n'}, {'line_no': 57, 'char_start': 1603, 'char_end': 1648, 'line': '\t\t\tif (base_len < off + len || res_sz < len)\n'}], 'added': [{'line_no': 43, 'char_start': 1128, 'char_end': 1161, 'line': '\t\t\tsize_t off =...
{'deleted': [{'char_start': 1621, 'char_end': 1628, 'chars': 'off + l'}], 'added': [{'char_start': 1154, 'char_end': 1159, 'chars': ', end'}, {'char_start': 1615, 'char_end': 1664, 'chars': 'GIT_ADD_SIZET_OVERFLOW(&end, off, len) ||\n\t\t\t '}, {'char_start': 1677, 'char_end': 1678, 'chars': 'd'}, {'char_start': 171...
github.com/libgit2/libgit2/commit/c1577110467b701dcbcf9439ac225ea851b47d22
src/delta.c
cwe-190
738
cwe-079
history_data
def history_data(start_time, offset=None): """Return history data. Arguments: start_time: select history starting from this timestamp. offset: number of items to skip """ # history atimes are stored as ints, ensure start_time is not a float start_time = int(start_time) hist = ob...
def history_data(start_time, offset=None): """Return history data. Arguments: start_time: select history starting from this timestamp. offset: number of items to skip """ # history atimes are stored as ints, ensure start_time is not a float start_time = int(start_time) hist = ob...
{'deleted': [{'line_no': 18, 'char_start': 603, 'char_end': 674, 'line': ' return [{"url": e.url, "title": e.title or e.url, "time": e.atime}\n'}, {'line_no': 19, 'char_start': 674, 'char_end': 703, 'line': ' for e in entries]\n'}], 'added': [{'line_no': 18, 'char_start': 603, 'char_end': 643, 'line': ' ...
{'deleted': [{'char_start': 673, 'char_end': 685, 'chars': '\n '}], 'added': [{'char_start': 623, 'char_end': 635, 'chars': 'html.escape('}, {'char_start': 640, 'char_end': 641, 'chars': ')'}, {'char_start': 642, 'char_end': 655, 'chars': '\n '}, {'char_start': 665, 'char_end': 677, 'chars': 'html....
github.com/qutebrowser/qutebrowser/commit/4c9360237f186681b1e3f2a0f30c45161cf405c7
qutebrowser/browser/qutescheme.py
cwe-079
177
cwe-125
update_read_icon_info
static BOOL update_read_icon_info(wStream* s, ICON_INFO* iconInfo) { BYTE* newBitMask; if (Stream_GetRemainingLength(s) < 8) return FALSE; Stream_Read_UINT16(s, iconInfo->cacheEntry); /* cacheEntry (2 bytes) */ Stream_Read_UINT8(s, iconInfo->cacheId); /* cacheId (1 byte) */ Stream_Read_UINT8(s, iconInfo->b...
static BOOL update_read_icon_info(wStream* s, ICON_INFO* iconInfo) { BYTE* newBitMask; if (Stream_GetRemainingLength(s) < 8) return FALSE; Stream_Read_UINT16(s, iconInfo->cacheEntry); /* cacheEntry (2 bytes) */ Stream_Read_UINT8(s, iconInfo->cacheId); /* cacheId (1 byte) */ Stream_Read_UINT8(s, iconInfo->b...
{'deleted': [{'line_no': 44, 'char_start': 1148, 'char_end': 1230, 'line': '\tif (Stream_GetRemainingLength(s) < iconInfo->cbBitsMask + iconInfo->cbBitsColor)\n'}, {'line_no': 45, 'char_start': 1230, 'char_end': 1246, 'line': '\t\treturn FALSE;\n'}, {'line_no': 46, 'char_start': 1246, 'char_end': 1247, 'line': '\n'}], ...
{'deleted': [{'char_start': 1149, 'char_end': 1248, 'chars': 'if (Stream_GetRemainingLength(s) < iconInfo->cbBitsMask + iconInfo->cbBitsColor)\n\t\treturn FALSE;\n\n\t'}, {'char_start': 2368, 'char_end': 2368, 'chars': ''}], 'added': [{'char_start': 1164, 'char_end': 1164, 'chars': ''}, {'char_start': 1369, 'char_end':...
github.com/FreeRDP/FreeRDP/commit/6b2bc41935e53b0034fe5948aeeab4f32e80f30f
libfreerdp/core/window.c
cwe-125
769
cwe-125
avr_op_analyze
static OPCODE_DESC* avr_op_analyze(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, CPU_MODEL *cpu) { OPCODE_DESC *opcode_desc; ut16 ins = (buf[1] << 8) | buf[0]; int fail; char *t; // initialize op struct memset (op, 0, sizeof (RAnalOp)); op->ptr = UT64_MAX; op->val = UT64_MAX; op->jump = UT64_M...
static OPCODE_DESC* avr_op_analyze(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, CPU_MODEL *cpu) { OPCODE_DESC *opcode_desc; if (len < 2) { return NULL; } ut16 ins = (buf[1] << 8) | buf[0]; int fail; char *t; // initialize op struct memset (op, 0, sizeof (RAnalOp)); op->ptr = UT64_MAX; op->...
{'deleted': [], 'added': [{'line_no': 3, 'char_start': 142, 'char_end': 158, 'line': '\tif (len < 2) {\n'}, {'line_no': 4, 'char_start': 158, 'char_end': 173, 'line': '\t\treturn NULL;\n'}, {'line_no': 5, 'char_start': 173, 'char_end': 176, 'line': '\t}\n'}]}
{'deleted': [], 'added': [{'char_start': 143, 'char_end': 177, 'chars': 'if (len < 2) {\n\t\treturn NULL;\n\t}\n\t'}]}
github.com/radare/radare2/commit/b35530fa0681b27eba084de5527037ebfb397422
libr/anal/p/anal_avr.c
cwe-125
677
cwe-089
verify_rno
def verify_rno(self, rno): query = "SELECT COUNT(rno) FROM rides WHERE rno = {rno}".format(rno = rno) self.cursor.execute(query) result = self.cursor.fetchone() if (int(result[0]) > 0): return True else: return False
def verify_rno(self, rno): self.cursor.execute("SELECT COUNT(rno) FROM rides WHERE rno = :rno", {'rno': rno}) result = self.cursor.fetchone() if (int(result[0]) > 0): return True else: return False
{'deleted': [{'line_no': 2, 'char_start': 31, 'char_end': 114, 'line': ' query = "SELECT COUNT(rno) FROM rides WHERE rno = {rno}".format(rno = rno)\n'}, {'line_no': 3, 'char_start': 114, 'char_end': 149, 'line': ' self.cursor.execute(query)\n'}], 'added': [{'line_no': 2, 'char_start': 31, 'char_end': 122,...
{'deleted': [{'char_start': 39, 'char_end': 41, 'chars': 'qu'}, {'char_start': 43, 'char_end': 47, 'chars': 'y = '}, {'char_start': 89, 'char_end': 90, 'chars': '{'}, {'char_start': 93, 'char_end': 94, 'chars': '}'}, {'char_start': 95, 'char_end': 103, 'chars': '.format('}, {'char_start': 106, 'char_end': 108, 'chars':...
github.com/kenboo98/291-Mini-Project-I/commit/3080ccb687c79c83954ce703faee8fcceec8c9eb
book_rides/book_rides.py
cwe-089
71
cwe-476
mrb_class_real
mrb_class_real(struct RClass* cl) { if (cl == 0) return NULL; while ((cl->tt == MRB_TT_SCLASS) || (cl->tt == MRB_TT_ICLASS)) { cl = cl->super; } return cl; }
mrb_class_real(struct RClass* cl) { if (cl == 0) return NULL; while ((cl->tt == MRB_TT_SCLASS) || (cl->tt == MRB_TT_ICLASS)) { cl = cl->super; if (cl == 0) return NULL; } return cl; }
{'deleted': [{'line_no': 3, 'char_start': 36, 'char_end': 51, 'line': ' if (cl == 0)\n'}, {'line_no': 4, 'char_start': 51, 'char_end': 68, 'line': ' return NULL;\n'}], 'added': [{'line_no': 3, 'char_start': 36, 'char_end': 64, 'line': ' if (cl == 0) return NULL;\n'}, {'line_no': 6, 'char_start': 151, 'char_end': 1...
{'deleted': [{'char_start': 50, 'char_end': 54, 'chars': '\n '}], 'added': [{'char_start': 149, 'char_end': 179, 'chars': ';\n if (cl == 0) return NULL'}]}
github.com/mruby/mruby/commit/faa4eaf6803bd11669bc324b4c34e7162286bfa3
src/class.c
cwe-476
66
cwe-416
audio_sample_entry_Read
GF_Err audio_sample_entry_Read(GF_Box *s, GF_BitStream *bs) { GF_MPEGAudioSampleEntryBox *ptr; char *data; u8 a, b, c, d; u32 i, size, v, nb_alnum; GF_Err e; u64 pos, start; ptr = (GF_MPEGAudioSampleEntryBox *)s; start = gf_bs_get_position(bs); gf_bs_seek(bs, start + 8); v = gf_bs_read_u16(bs); if (v) pt...
GF_Err audio_sample_entry_Read(GF_Box *s, GF_BitStream *bs) { GF_MPEGAudioSampleEntryBox *ptr; char *data; u8 a, b, c, d; u32 i, size, v, nb_alnum; GF_Err e; u64 pos, start; ptr = (GF_MPEGAudioSampleEntryBox *)s; start = gf_bs_get_position(bs); gf_bs_seek(bs, start + 8); v = gf_bs_read_u16(bs); if (v) pt...
{'deleted': [{'line_no': 58, 'char_start': 1827, 'char_end': 1868, 'line': '\t\t\t\tgf_isom_box_del((GF_Box *)ptr->esd);\n'}], 'added': [{'line_no': 56, 'char_start': 1734, 'char_end': 1764, 'line': '\t\t\textern Bool use_dump_mode;\n'}, {'line_no': 59, 'char_start': 1857, 'char_end': 1918, 'line': '\t\t\t\tif (!use_du...
{'deleted': [], 'added': [{'char_start': 1737, 'char_end': 1767, 'chars': 'extern Bool use_dump_mode;\n\t\t\t'}, {'char_start': 1861, 'char_end': 1881, 'chars': 'if (!use_dump_mode) '}]}
github.com/gpac/gpac/commit/6063b1a011c3f80cee25daade18154e15e4c058c
src/isomedia/box_code_base.c
cwe-416
793
cwe-078
get_output
def get_output(command: str) -> bytes: """ Run a command and return raw output :param str command: the command to run :returns: the stdout output of the command """ return subprocess.check_output(command.split())
def get_output(command: List[str]) -> str: """ Run a command and return raw output :param str command: the command to run :returns: the stdout output of the command """ result = subprocess.run(command, stdout=subprocess.PIPE, check=True) return result.stdout.decode()
{'deleted': [{'line_no': 1, 'char_start': 0, 'char_end': 39, 'line': 'def get_output(command: str) -> bytes:\n'}, {'line_no': 8, 'char_start': 186, 'char_end': 237, 'line': ' return subprocess.check_output(command.split())\n'}], 'added': [{'line_no': 1, 'char_start': 0, 'char_end': 43, 'line': 'def get_output(comman...
{'deleted': [{'char_start': 32, 'char_end': 36, 'chars': 'byte'}, {'char_start': 213, 'char_end': 215, 'chars': '_o'}, {'char_start': 217, 'char_end': 218, 'chars': 'p'}, {'char_start': 220, 'char_end': 221, 'chars': '('}, {'char_start': 223, 'char_end': 227, 'chars': 'mman'}, {'char_start': 228, 'char_end': 234, 'char...
github.com/timothycrosley/isort/commit/1ab38f4f7840a3c19bf961a24630a992a8373a76
isort/hooks.py
cwe-078
53
cwe-125
tensorflow::QuantizeAndDequantizeV2Op::Compute
void Compute(OpKernelContext* ctx) override { const Tensor& input = ctx->input(0); const int depth = (axis_ == -1) ? 1 : input.dim_size(axis_); Tensor input_min_tensor; Tensor input_max_tensor; Tensor* output = nullptr; OP_REQUIRES_OK(ctx, ctx->allocate_output(0, input.shape(), &output)); ...
void Compute(OpKernelContext* ctx) override { const Tensor& input = ctx->input(0); OP_REQUIRES( ctx, (axis_ == -1 || axis_ < input.shape().dims()), errors::InvalidArgument("Shape must be at least rank ", axis_ + 1, " but is rank ", input.shape().dims())); co...
{'deleted': [], 'added': [{'line_no': 3, 'char_start': 89, 'char_end': 106, 'line': ' OP_REQUIRES(\n'}, {'line_no': 4, 'char_start': 106, 'char_end': 166, 'line': ' ctx, (axis_ == -1 || axis_ < input.shape().dims()),\n'}, {'line_no': 5, 'char_start': 166, 'char_end': 241, 'line': ' errors::InvalidArgum...
{'deleted': [], 'added': [{'char_start': 93, 'char_end': 318, 'chars': 'OP_REQUIRES(\n ctx, (axis_ == -1 || axis_ < input.shape().dims()),\n errors::InvalidArgument("Shape must be at least rank ", axis_ + 1,\n " but is rank ", input.shape().dims()));\n '}]}
github.com/tensorflow/tensorflow/commit/eccb7ec454e6617738554a255d77f08e60ee0808
tensorflow/core/kernels/quantize_and_dequantize_op.cc
cwe-125
583
cwe-125
matchCurrentInput
matchCurrentInput( const InString *input, int pos, const widechar *passInstructions, int passIC) { int k; int kk = pos; for (k = passIC + 2; k < passIC + 2 + passInstructions[passIC + 1]; k++) if (input->chars[kk] == ENDSEGMENT || passInstructions[k] != input->chars[kk++]) return 0; return 1; }
matchCurrentInput( const InString *input, int pos, const widechar *passInstructions, int passIC) { int k; int kk = pos; for (k = passIC + 2; ((k < passIC + 2 + passInstructions[passIC + 1]) && (kk < input->length)); k++) if (input->chars[kk] == ENDSEGMENT || passInstructions[k] != input->chars[kk++]) re...
{'deleted': [{'line_no': 5, 'char_start': 124, 'char_end': 198, 'line': '\tfor (k = passIC + 2; k < passIC + 2 + passInstructions[passIC + 1]; k++)\n'}], 'added': [{'line_no': 5, 'char_start': 124, 'char_end': 146, 'line': '\tfor (k = passIC + 2;\n'}, {'line_no': 6, 'char_start': 146, 'char_end': 224, 'line': '\t\t\t((...
{'deleted': [{'char_start': 145, 'char_end': 146, 'chars': ' '}, {'char_start': 192, 'char_end': 193, 'chars': ' '}], 'added': [{'char_start': 145, 'char_end': 151, 'chars': '\n\t\t\t(('}, {'char_start': 196, 'char_end': 206, 'chars': ') && (kk <'}, {'char_start': 207, 'char_end': 227, 'chars': 'input->length));\n\t\t\...
github.com/liblouis/liblouis/commit/5e4089659bb49b3095fa541fa6387b4c40d7396e
liblouis/lou_translateString.c
cwe-125
99
cwe-476
mrb_obj_clone
mrb_obj_clone(mrb_state *mrb, mrb_value self) { struct RObject *p; mrb_value clone; if (mrb_immediate_p(self)) { mrb_raisef(mrb, E_TYPE_ERROR, "can't clone %S", self); } if (mrb_type(self) == MRB_TT_SCLASS) { mrb_raise(mrb, E_TYPE_ERROR, "can't clone singleton class"); } p = (struct RObject*)mrb_...
mrb_obj_clone(mrb_state *mrb, mrb_value self) { struct RObject *p; mrb_value clone; if (mrb_immediate_p(self)) { mrb_raisef(mrb, E_TYPE_ERROR, "can't clone %S", self); } if (mrb_type(self) == MRB_TT_SCLASS) { mrb_raise(mrb, E_TYPE_ERROR, "can't clone singleton class"); } p = (struct RObject*)mrb_...
{'deleted': [{'line_no': 17, 'char_start': 557, 'char_end': 596, 'line': ' p->flags = mrb_obj_ptr(self)->flags;\n'}], 'added': [{'line_no': 17, 'char_start': 557, 'char_end': 618, 'line': ' p->flags |= mrb_obj_ptr(self)->flags & MRB_FLAG_IS_FROZEN;\n'}]}
{'deleted': [], 'added': [{'char_start': 568, 'char_end': 569, 'chars': '|'}, {'char_start': 595, 'char_end': 616, 'chars': ' & MRB_FLAG_IS_FROZEN'}]}
github.com/mruby/mruby/commit/55edae0226409de25e59922807cb09acb45731a2
src/kernel.c
cwe-476
198
cwe-416
dbd_st_fetch
dbd_st_fetch(SV *sth, imp_sth_t* imp_sth) { dTHX; int num_fields, ChopBlanks, i, rc; unsigned long *lengths; AV *av; int av_length, av_readonly; MYSQL_ROW cols; D_imp_dbh_from_sth; MYSQL* svsock= imp_dbh->pmysql; imp_sth_fbh_t *fbh; D_imp_xxh(sth); #if MYSQL_VERSION_ID >=SERVER_PREPARE_VERSION MYS...
dbd_st_fetch(SV *sth, imp_sth_t* imp_sth) { dTHX; int num_fields, ChopBlanks, i, rc; unsigned long *lengths; AV *av; int av_length, av_readonly; MYSQL_ROW cols; D_imp_dbh_from_sth; MYSQL* svsock= imp_dbh->pmysql; imp_sth_fbh_t *fbh; D_imp_xxh(sth); #if MYSQL_VERSION_ID >=SERVER_PREPARE_VERSION MYS...
{'deleted': [], 'added': [{'line_no': 150, 'char_start': 4222, 'char_end': 4284, 'line': ' imp_sth->stmt->bind[i].buffer_length = fbh->length;\n'}, {'line_no': 151, 'char_start': 4284, 'char_end': 4345, 'line': ' imp_sth->stmt->bind[i].buffer = (char *)fbh->data;\n'}]}
{'deleted': [], 'added': [{'char_start': 4222, 'char_end': 4345, 'chars': ' imp_sth->stmt->bind[i].buffer_length = fbh->length;\n imp_sth->stmt->bind[i].buffer = (char *)fbh->data;\n'}]}
github.com/perl5-dbi/DBD-mysql/commit/3619c170461a3107a258d1fd2d00ed4832adb1b1
dbdimp.c
cwe-416
3,447
cwe-078
test_create_invalid_host
def test_create_invalid_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", ...
def test_create_invalid_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", ...
{'deleted': [{'line_no': 13, 'char_start': 505, 'char_end': 558, 'line': " show_host_cmd = 'showhost -verbose fakehost'\n"}, {'line_no': 16, 'char_start': 639, 'char_end': 716, 'line': " create_host_cmd = ('createhost -persona 1 -domain (\\'OpenStack\\',) '\n"}, {'line_no': 17, 'char_start': 716, 'char_en...
{'deleted': [{'char_start': 696, 'char_end': 710, 'chars': " (\\'OpenStack\\"}, {'char_start': 712, 'char_end': 715, 'chars': ") '"}], 'added': [{'char_start': 529, 'char_end': 530, 'chars': '['}, {'char_start': 539, 'char_end': 541, 'chars': "',"}, {'char_start': 542, 'char_end': 543, 'chars': "'"}, {'char_start': 551...
github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f
cinder/tests/test_hp3par.py
cwe-078
337
cwe-078
_create_3par_fibrechan_host
def _create_3par_fibrechan_host(self, hostname, wwn, domain, persona_id): """Create a 3PAR host. Create a 3PAR host, if there is already a host on the 3par using the same wwn but with a different hostname, return the hostname used by 3PAR. """ out = self.common._cli_...
def _create_3par_fibrechan_host(self, hostname, wwns, domain, persona_id): """Create a 3PAR host. Create a 3PAR host, if there is already a host on the 3par using the same wwn but with a different hostname, return the hostname used by 3PAR. """ command = ['createhost...
{'deleted': [{'line_no': 1, 'char_start': 0, 'char_end': 78, 'line': ' def _create_3par_fibrechan_host(self, hostname, wwn, domain, persona_id):\n'}, {'line_no': 8, 'char_start': 289, 'char_end': 366, 'line': " out = self.common._cli_run('createhost -persona %s -domain %s %s %s'\n"}, {'line_no': 9, 'char_star...
{'deleted': [{'char_start': 297, 'char_end': 308, 'chars': 'out = self.'}, {'char_start': 312, 'char_end': 313, 'chars': 'o'}, {'char_start': 314, 'char_end': 324, 'chars': '._cli_run('}, {'char_start': 345, 'char_end': 346, 'chars': '%'}, {'char_start': 356, 'char_end': 365, 'chars': "%s %s %s'"}, {'char_start': 366, ...
github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f
cinder/volume/drivers/san/hp/hp_3par_fc.py
cwe-078
147
cwe-125
read_Header
read_Header(struct archive_read *a, struct _7z_header_info *h, int check_header_id) { struct _7zip *zip = (struct _7zip *)a->format->data; const unsigned char *p; struct _7z_folder *folders; struct _7z_stream_info *si = &(zip->si); struct _7zip_entry *entries; uint32_t folderIndex, indexInFolder; unsigned i;...
read_Header(struct archive_read *a, struct _7z_header_info *h, int check_header_id) { struct _7zip *zip = (struct _7zip *)a->format->data; const unsigned char *p; struct _7z_folder *folders; struct _7z_stream_info *si = &(zip->si); struct _7zip_entry *entries; uint32_t folderIndex, indexInFolder; unsigned i;...
{'deleted': [], 'added': [{'line_no': 90, 'char_start': 1753, 'char_end': 1789, 'line': '\t\t\tif (h->emptyStreamBools != NULL)\n'}, {'line_no': 91, 'char_start': 1789, 'char_end': 1806, 'line': '\t\t\t\treturn (-1);\n'}, {'line_no': 112, 'char_start': 2340, 'char_end': 2374, 'line': '\t\t\tif (h->emptyFileBools != NUL...
{'deleted': [{'char_start': 1808, 'char_end': 1808, 'chars': ''}, {'char_start': 4268, 'char_end': 4268, 'chars': ''}], 'added': [{'char_start': 1756, 'char_end': 1809, 'chars': 'if (h->emptyStreamBools != NULL)\n\t\t\t\treturn (-1);\n\t\t\t'}, {'char_start': 2340, 'char_end': 2391, 'chars': '\t\t\tif (h->emptyFileBool...
github.com/libarchive/libarchive/commit/7f17c791dcfd8c0416e2cd2485b19410e47ef126
libarchive/archive_read_support_format_7zip.c
cwe-125
2,453
cwe-787
patch
static PyObject* patch(PyObject* self, PyObject* args) { char *origData, *newData, *diffBlock, *extraBlock, *diffPtr, *extraPtr; Py_ssize_t origDataLength, newDataLength, diffBlockLength, extraBlockLength; PyObject *controlTuples, *tuple, *results; off_t oldpos, newpos, x, y, z; int i, j, numTuples;...
static PyObject* patch(PyObject* self, PyObject* args) { char *origData, *newData, *diffBlock, *extraBlock, *diffPtr, *extraPtr; Py_ssize_t origDataLength, newDataLength, diffBlockLength, extraBlockLength; PyObject *controlTuples, *tuple, *results; off_t oldpos, newpos, x, y, z; int i, j, numTuples;...
{'deleted': [{'line_no': 42, 'char_start': 1561, 'char_end': 1622, 'line': ' diffPtr + x > diffBlock + diffBlockLength ||\n'}, {'line_no': 43, 'char_start': 1622, 'char_end': 1686, 'line': ' extraPtr + y > extraBlock + extraBlockLength) {\n'}], 'added': [{'line_no': 42, 'char_start': 1561,...
{'deleted': [{'char_start': 1618, 'char_end': 1682, 'chars': ' ||\n extraPtr + y > extraBlock + extraBlockLength'}], 'added': [{'char_start': 2035, 'char_end': 2284, 'chars': '\n if (newpos + y > newDataLength ||\n extraPtr + y > extraBlock + extraBlockLength) {\n PyMem_F...
github.com/ilanschnell/bsdiff4/commit/49a4cee2feef7deaf9d89e5e793a8824930284d7
bsdiff4/core.c
cwe-787
685
cwe-078
test_skip_paths_issue_938
def test_skip_paths_issue_938(tmpdir): base_dir = tmpdir.mkdir('project') config_dir = base_dir.mkdir('conf') config_dir.join('.isort.cfg').write('[isort]\n' 'line_length = 88\n' 'multi_line_output = 4\n' ...
def test_skip_paths_issue_938(tmpdir): base_dir = tmpdir.mkdir('project') config_dir = base_dir.mkdir('conf') config_dir.join('.isort.cfg').write('[isort]\n' 'line_length = 88\n' 'multi_line_output = 4\n' ...
{'deleted': [{'line_no': 25, 'char_start': 1187, 'char_end': 1273, 'line': " results = check_output(['isort', 'dont_skip.py', 'migrations/file_glob_skip.py'])\n"}, {'line_no': 28, 'char_start': 1312, 'char_end': 1357, 'line': " assert b'skipped' not in results.lower()\n"}, {'line_no': 31, 'char_start': 1386, 'cha...
{'deleted': [{'char_start': 1197, 'char_end': 1198, 'chars': 's'}, {'char_start': 1202, 'char_end': 1203, 'chars': 'h'}, {'char_start': 1204, 'char_end': 1211, 'chars': 'ck_outp'}, {'char_start': 1212, 'char_end': 1213, 'chars': 't'}, {'char_start': 1396, 'char_end': 1397, 'chars': 's'}, {'char_start': 1401, 'char_end'...
github.com/timothycrosley/isort/commit/1ab38f4f7840a3c19bf961a24630a992a8373a76
test_isort.py
cwe-078
305
cwe-078
_delete_vdisk
def _delete_vdisk(self, name, force): """Deletes existing vdisks. It is very important to properly take care of mappings before deleting the disk: 1. If no mappings, then it was a vdisk, and can be deleted 2. If it is the source of a flashcopy mapping and copy_rate is 0, the...
def _delete_vdisk(self, name, force): """Deletes existing vdisks. It is very important to properly take care of mappings before deleting the disk: 1. If no mappings, then it was a vdisk, and can be deleted 2. If it is the source of a flashcopy mapping and copy_rate is 0, the...
{'deleted': [{'line_no': 32, 'char_start': 1403, 'char_end': 1449, 'line': " forceflag = '-force' if force else ''\n"}, {'line_no': 33, 'char_start': 1449, 'char_end': 1503, 'line': " cmd_params = {'frc': forceflag, 'name': name}\n"}, {'line_no': 34, 'char_start': 1503, 'char_end': 1569, 'line': " ...
{'deleted': [{'char_start': 1411, 'char_end': 1414, 'chars': 'for'}, {'char_start': 1415, 'char_end': 1420, 'chars': 'eflag'}, {'char_start': 1424, 'char_end': 1428, 'chars': '-for'}, {'char_start': 1429, 'char_end': 1430, 'chars': 'e'}, {'char_start': 1433, 'char_end': 1434, 'chars': 'f'}, {'char_start': 1441, 'char_e...
github.com/thatsdone/cinder/commit/f752302d181583a95cf44354aea607ce9d9283f4
cinder/volume/drivers/storwize_svc.py
cwe-078
468
cwe-079
edit_bundle
@check_document_access_permission() def edit_bundle(request): bundle_id = request.GET.get('bundle') doc = None if bundle_id: doc = Document2.objects.get(id=bundle_id) bundle = Bundle(document=doc) else: bundle = Bundle() coordinators = [dict([('uuid', d.content_object.uuid), ('name', d.content...
@check_document_access_permission() def edit_bundle(request): bundle_id = request.GET.get('bundle') doc = None if bundle_id: doc = Document2.objects.get(id=bundle_id) bundle = Bundle(document=doc) else: bundle = Bundle() coordinators = [dict([('uuid', d.content_object.uuid), ('name', d.content...
{'deleted': [{'line_no': 16, 'char_start': 498, 'char_end': 532, 'line': " 'bundle_json': bundle.json,\n"}, {'line_no': 17, 'char_start': 532, 'char_end': 585, 'line': " 'coordinators_json': json.dumps(coordinators),\n"}], 'added': [{'line_no': 16, 'char_start': 498, 'char_end': 543, 'line': " 'bundle_js...
{'deleted': [], 'added': [{'char_start': 530, 'char_end': 541, 'chars': '_for_html()'}, {'char_start': 593, 'char_end': 617, 'chars': ', cls=JSONEncoderForHTML'}]}
github.com/gethue/hue/commit/6641c62beaa1468082e47d82da5ed758d11c7735
apps/oozie/src/oozie/views/editor2.py
cwe-079
179
cwe-125
ReadMATImage
static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image, *image2=NULL, *rotated_image; PixelPacket *q; unsigned int status; MATHeader MATLAB_HDR; size_t size; size_t CellType; QuantumInfo *quantum_info; ImageInfo *clone_info; int i; ssize_t ldblk; unsign...
static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image, *image2=NULL, *rotated_image; PixelPacket *q; unsigned int status; MATHeader MATLAB_HDR; size_t size; size_t CellType; QuantumInfo *quantum_info; ImageInfo *clone_info; int i; ssize_t ldblk; unsign...
{'deleted': [], 'added': [{'line_no': 336, 'char_start': 12091, 'char_end': 12142, 'line': ' quantum_info=DestroyQuantumInfo(quantum_info);\n'}]}
{'deleted': [], 'added': [{'char_start': 12091, 'char_end': 12142, 'chars': ' quantum_info=DestroyQuantumInfo(quantum_info);\n'}]}
github.com/ImageMagick/ImageMagick/commit/b173a352397877775c51c9a0e9d59eb6ce24c455
coders/mat.c
cwe-125
4,426
cwe-787
avcodec_align_dimensions2
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS]) { int i; int w_align = 1; int h_align = 1; AVPixFmtDescriptor const *desc = av_pix_fmt_desc_get(s->pix_fmt); if (desc) { w_align = 1 << desc->l...
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS]) { int i; int w_align = 1; int h_align = 1; AVPixFmtDescriptor const *desc = av_pix_fmt_desc_get(s->pix_fmt); if (desc) { w_align = 1 << desc->l...
{'deleted': [{'line_no': 129, 'char_start': 3941, 'char_end': 3986, 'line': ' if (s->codec_id == AV_CODEC_ID_JV) {\n'}], 'added': [{'line_no': 120, 'char_start': 3692, 'char_end': 3750, 'line': ' if (s->codec_id == AV_CODEC_ID_INTERPLAY_VIDEO) {\n'}, {'line_no': 121, 'char_start': 3750, 'char_end': 3775, ...
{'deleted': [], 'added': [{'char_start': 3700, 'char_end': 3818, 'chars': 'if (s->codec_id == AV_CODEC_ID_INTERPLAY_VIDEO) {\n w_align = 8;\n h_align = 8;\n }\n '}, {'char_start': 4100, 'char_end': 4158, 'chars': ' ||\n s->codec_id == AV_CODEC_ID_INTERPLAY_VIDEO'}]}
github.com/FFmpeg/FFmpeg/commit/2080bc33717955a0e4268e738acf8c1eeddbf8cb
libavcodec/utils.c
cwe-787
1,890
cwe-089
delete
@jwt_required def delete(self, email): """ Deletes admin with the corresponding email """ return database_utilities.execute_query(f"""delete from admins where email = '{email}'""")
@jwt_required def delete(self, email): """ Deletes admin with the corresponding email """ return database_utilities.execute_query(f"""delete from admins where email = %s""", (email, ))
{'deleted': [{'line_no': 4, 'char_start': 106, 'char_end': 204, 'line': ' return database_utilities.execute_query(f"""delete from admins where email = \'{email}\'""")\n'}], 'added': [{'line_no': 4, 'char_start': 106, 'char_end': 208, 'line': ' return database_utilities.execute_query(f"""delete from admins...
{'deleted': [{'char_start': 191, 'char_end': 193, 'chars': "'{"}, {'char_start': 198, 'char_end': 203, 'chars': '}\'"""'}], 'added': [{'char_start': 191, 'char_end': 199, 'chars': '%s""", ('}, {'char_start': 204, 'char_end': 207, 'chars': ', )'}]}
github.com/sgosal2/tiger-boards-backend/commit/4670109dd613df2f2fe7e8403ebd149df2b55485
apis/admins.py
cwe-089
40
cwe-125
X86_insn_reg_intel
x86_reg X86_insn_reg_intel(unsigned int id, enum cs_ac_type *access) { unsigned int first = 0; unsigned int last = ARR_SIZE(insn_regs_intel) - 1; unsigned int mid = ARR_SIZE(insn_regs_intel) / 2; if (!intel_regs_sorted) { memcpy(insn_regs_intel_sorted, insn_regs_intel, sizeof(insn_regs_intel_sorted)); qsor...
x86_reg X86_insn_reg_intel(unsigned int id, enum cs_ac_type *access) { static bool intel_regs_sorted = false; unsigned int first = 0; unsigned int last = ARR_SIZE(insn_regs_intel) - 1; unsigned int mid; if (!intel_regs_sorted) { memcpy(insn_regs_intel_sorted, insn_regs_intel, sizeof(insn_regs_intel_sorted))...
{'deleted': [{'line_no': 5, 'char_start': 148, 'char_end': 199, 'line': '\tunsigned int mid = ARR_SIZE(insn_regs_intel) / 2;\n'}, {'line_no': 29, 'char_start': 780, 'char_end': 808, 'line': '\t\tmid = (first + last) / 2;\n'}], 'added': [{'line_no': 3, 'char_start': 71, 'char_end': 111, 'line': '\tstatic bool intel_regs...
{'deleted': [{'char_start': 165, 'char_end': 197, 'chars': ' = ARR_SIZE(insn_regs_intel) / 2'}, {'char_start': 779, 'char_end': 807, 'chars': '\n\t\tmid = (first + last) / 2;'}], 'added': [{'char_start': 72, 'char_end': 112, 'chars': 'static bool intel_regs_sorted = false;\n\t'}, {'char_start': 465, 'char_end': 570, 'c...
github.com/aquynh/capstone/commit/87a25bb543c8e4c09b48d4b4a6c7db31ce58df06
arch/X86/X86Mapping.c
cwe-125
266
cwe-190
AllocateDataSet
void AllocateDataSet(cmsIT8* it8) { TABLE* t = GetTable(it8); if (t -> Data) return; // Already allocated t-> nSamples = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_FIELDS")); t-> nPatches = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_SETS")); t-> Data = (char**)AllocChunk (it8, ((cmsUInt32Number) t...
void AllocateDataSet(cmsIT8* it8) { TABLE* t = GetTable(it8); if (t -> Data) return; // Already allocated t-> nSamples = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_FIELDS")); t-> nPatches = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_SETS")); if (t -> nSamples < 0 || t->nSamples > 0x7ffe || t->nPat...
{'deleted': [{'line_no': 10, 'char_start': 260, 'char_end': 392, 'line': ' t-> Data = (char**)AllocChunk (it8, ((cmsUInt32Number) t->nSamples + 1) * ((cmsUInt32Number) t->nPatches + 1) *sizeof (char*));\n'}, {'line_no': 11, 'char_start': 392, 'char_end': 419, 'line': ' if (t->Data == NULL) {\n'}, {'line_no': 13, ...
{'deleted': [{'char_start': 293, 'char_end': 294, 'chars': ' '}, {'char_start': 318, 'char_end': 319, 'chars': ' '}, {'char_start': 356, 'char_end': 357, 'chars': ' '}, {'char_start': 381, 'char_end': 382, 'chars': ' '}], 'added': [{'char_start': 264, 'char_end': 289, 'chars': 'if (t -> nSamples < 0 || '}, {'char_start...
github.com/mm2/Little-CMS/commit/768f70ca405cd3159d990e962d54456773bb8cf8
src/cmscgats.c
cwe-190
160
cwe-125
WriteImageChannels
static MagickBooleanType WriteImageChannels(const PSDInfo *psd_info, const ImageInfo *image_info,Image *image,Image *next_image, const MagickBooleanType separate,ExceptionInfo *exception) { size_t channels, packet_size; unsigned char *compact_pixels; /* Write uncompressed pixels as separate ...
static MagickBooleanType WriteImageChannels(const PSDInfo *psd_info, const ImageInfo *image_info,Image *image,Image *next_image, const MagickBooleanType separate,ExceptionInfo *exception) { size_t channels, packet_size; unsigned char *compact_pixels; /* Write uncompressed pixels as separate ...
{'deleted': [{'line_no': 20, 'char_start': 494, 'char_end': 566, 'line': ' compact_pixels=(unsigned char *) AcquireQuantumMemory(2*channels*\n'}, {'line_no': 21, 'char_start': 566, 'char_end': 632, 'line': ' next_image->columns,packet_size*sizeof(*compact_pixels));\n'}], 'added': [{'line_no': 20, 'char_star...
{'deleted': [], 'added': [{'char_start': 554, 'char_end': 555, 'chars': '('}, {'char_start': 594, 'char_end': 597, 'chars': ')+1'}]}
github.com/ImageMagick/ImageMagick/commit/6f1879d498bcc5cce12fe0c5decb8dbc0f608e5d
coders/psd.c
cwe-125
1,131
cwe-416
mif_process_cmpt
static int mif_process_cmpt(mif_hdr_t *hdr, char *buf) { jas_tvparser_t *tvp; mif_cmpt_t *cmpt; int id; cmpt = 0; tvp = 0; if (!(cmpt = mif_cmpt_create())) { goto error; } cmpt->tlx = 0; cmpt->tly = 0; cmpt->sampperx = 0; cmpt->samppery = 0; cmpt->width = 0; cmpt->height = 0; cmpt->prec = 0; cmpt->sg...
static int mif_process_cmpt(mif_hdr_t *hdr, char *buf) { jas_tvparser_t *tvp; mif_cmpt_t *cmpt; int id; cmpt = 0; tvp = 0; if (!(cmpt = mif_cmpt_create())) { goto error; } cmpt->tlx = 0; cmpt->tly = 0; cmpt->sampperx = 0; cmpt->samppery = 0; cmpt->width = 0; cmpt->height = 0; cmpt->prec = 0; cmpt->sg...
{'deleted': [{'line_no': 60, 'char_start': 1274, 'char_end': 1302, 'line': '\tjas_tvparser_destroy(tvp);\n'}], 'added': [{'line_no': 66, 'char_start': 1401, 'char_end': 1429, 'line': '\tjas_tvparser_destroy(tvp);\n'}]}
{'deleted': [{'char_start': 1275, 'char_end': 1303, 'chars': 'jas_tvparser_destroy(tvp);\n\t'}], 'added': [{'char_start': 1400, 'char_end': 1428, 'chars': '\n\tjas_tvparser_destroy(tvp);'}]}
github.com/mdadams/jasper/commit/df5d2867e8004e51e18b89865bc4aa69229227b3
src/libjasper/mif/mif_cod.c
cwe-416
574
cwe-022
wiki_handle_http_request
wiki_handle_http_request(HttpRequest *req) { HttpResponse *res = http_response_new(req); char *page = http_request_get_path_info(req); char *command = http_request_get_query_string(req); char *wikitext = ""; util_dehttpize(page); /* remove any encoding on the requested ...
wiki_handle_http_request(HttpRequest *req) { HttpResponse *res = http_response_new(req); char *page = http_request_get_path_info(req); char *command = http_request_get_query_string(req); char *wikitext = ""; util_dehttpize(page); /* remove any encoding on the requested ...
{'deleted': [{'line_no': 54, 'char_start': 1350, 'char_end': 1375, 'line': " if (strchr(page, '/'))\n"}], 'added': [{'line_no': 54, 'char_start': 1350, 'char_end': 1382, 'line': ' if (!page_name_is_good(page))\n'}]}
{'deleted': [{'char_start': 1357, 'char_end': 1362, 'chars': 'trchr'}, {'char_start': 1367, 'char_end': 1372, 'chars': ", '/'"}], 'added': [{'char_start': 1356, 'char_end': 1368, 'chars': '!page_name_i'}, {'char_start': 1369, 'char_end': 1374, 'chars': '_good'}]}
github.com/yarolig/didiwiki/commit/5e5c796617e1712905dc5462b94bd5e6c08d15ea
src/wiki.c
cwe-022
795
cwe-416
ReadMATImage
static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image, *image2=NULL, *rotated_image; register Quantum *q; unsigned int status; MATHeader MATLAB_HDR; size_t size; size_t CellType; QuantumInfo *quantum_info; ImageInfo *clone_info; int i; ssize_t ldblk; u...
static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image, *image2=NULL, *rotated_image; register Quantum *q; unsigned int status; MATHeader MATLAB_HDR; size_t size; size_t CellType; QuantumInfo *quantum_info; ImageInfo *clone_info; int i; ssize_t ldblk; u...
{'deleted': [{'line_no': 489, 'char_start': 16851, 'char_end': 16869, 'line': ' if (clone_info)\n'}, {'line_no': 490, 'char_start': 16869, 'char_end': 16914, 'line': ' clone_info=DestroyImageInfo(clone_info);\n'}], 'added': [{'line_no': 506, 'char_start': 17156, 'char_end': 17185, 'line': ' if (tmp == imag...
{'deleted': [{'char_start': 16853, 'char_end': 16916, 'chars': 'if (clone_info)\n clone_info=DestroyImageInfo(clone_info);\n '}], 'added': [{'char_start': 17154, 'char_end': 17218, 'chars': ';\n if (tmp == image2)\n image2=(Image *) NULL'}]}
github.com/ImageMagick/ImageMagick/commit/04178de2247e353fc095846784b9a10fefdbf890
coders/mat.c
cwe-416
4,907
cwe-022
save
async def save(request): # TODO csrf data = await request.post() item = Item(data['src']) # Update name new_src = data.get('new_src') if new_src and new_src != data['src']: # don't need to worry about html unquote shutil.move(item.abspath, settings.STORAGE_DIR + new_src) ...
async def save(request): # TODO csrf data = await request.post() item = Item(data['src']) # Update name new_src = data.get('new_src') if new_src: new_abspath = os.path.abspath(settings.STORAGE_DIR + new_src) if not new_abspath.startswith(settings.STORAGE_DIR): return...
{'deleted': [{'line_no': 8, 'char_start': 155, 'char_end': 198, 'line': " if new_src and new_src != data['src']:\n"}, {'line_no': 10, 'char_start': 247, 'char_end': 313, 'line': ' shutil.move(item.abspath, settings.STORAGE_DIR + new_src)\n'}, {'line_no': 11, 'char_start': 313, 'char_end': 362, 'line': ' ...
{'deleted': [{'char_start': 170, 'char_end': 173, 'chars': 'and'}, {'char_start': 179, 'char_end': 181, 'chars': 'rc'}, {'char_start': 182, 'char_end': 183, 'chars': '!'}, {'char_start': 185, 'char_end': 186, 'chars': 'd'}, {'char_start': 189, 'char_end': 191, 'chars': "['"}, {'char_start': 194, 'char_end': 197, 'chars...
github.com/crccheck/gallery-cms/commit/60dec5c580a779ae27824ed54cb113eca25afdc0
gallery/gallery.py
cwe-022
239
cwe-125
WavpackVerifySingleBlock
int WavpackVerifySingleBlock (unsigned char *buffer, int verify_checksum) { WavpackHeader *wphdr = (WavpackHeader *) buffer; uint32_t checksum_passed = 0, bcount, meta_bc; unsigned char *dp, meta_id, c1, c2; if (strncmp (wphdr->ckID, "wvpk", 4) || wphdr->ckSize + 8 < sizeof (WavpackHeader)) ret...
int WavpackVerifySingleBlock (unsigned char *buffer, int verify_checksum) { WavpackHeader *wphdr = (WavpackHeader *) buffer; uint32_t checksum_passed = 0, bcount, meta_bc; unsigned char *dp, meta_id, c1, c2; if (strncmp (wphdr->ckID, "wvpk", 4) || wphdr->ckSize + 8 < sizeof (WavpackHeader)) ret...
{'deleted': [{'line_no': 60, 'char_start': 1724, 'char_end': 1869, 'line': ' if (*dp++ != (csum & 0xff) || *dp++ != ((csum >> 8) & 0xff) || *dp++ != ((csum >> 16) & 0xff) || *dp++ != ((csum >> 24) & 0xff))\n'}, {'line_no': 66, 'char_start': 1973, 'char_end': 2050, 'line': ' if (*dp++ != (c...
{'deleted': [{'char_start': 1747, 'char_end': 1749, 'chars': '++'}, {'char_start': 1770, 'char_end': 1771, 'chars': '*'}, {'char_start': 1773, 'char_end': 1775, 'chars': '++'}, {'char_start': 1803, 'char_end': 1804, 'chars': '*'}, {'char_start': 1806, 'char_end': 1808, 'chars': '++'}, {'char_start': 1837, 'char_end': 1...
github.com/dbry/WavPack/commit/bba5389dc598a92bdf2b297c3ea34620b6679b5b
src/open_utils.c
cwe-125
707
cwe-078
_delete_host
def _delete_host(self, host_name): """Delete a host on the storage system.""" LOG.debug(_('enter: _delete_host: host %s ') % host_name) ssh_cmd = 'svctask rmhost %s ' % host_name out, err = self._run_ssh(ssh_cmd) # No output should be returned from rmhost self._asse...
def _delete_host(self, host_name): """Delete a host on the storage system.""" LOG.debug(_('enter: _delete_host: host %s ') % host_name) ssh_cmd = ['svctask', 'rmhost', host_name] out, err = self._run_ssh(ssh_cmd) # No output should be returned from rmhost self._asse...
{'deleted': [{'line_no': 6, 'char_start': 158, 'char_end': 209, 'line': " ssh_cmd = 'svctask rmhost %s ' % host_name\n"}], 'added': [{'line_no': 6, 'char_start': 158, 'char_end': 209, 'line': " ssh_cmd = ['svctask', 'rmhost', host_name]\n"}]}
{'deleted': [{'char_start': 191, 'char_end': 195, 'chars': ' %s '}, {'char_start': 196, 'char_end': 198, 'chars': ' %'}], 'added': [{'char_start': 176, 'char_end': 177, 'chars': '['}, {'char_start': 185, 'char_end': 187, 'chars': "',"}, {'char_start': 188, 'char_end': 189, 'chars': "'"}, {'char_start': 196, 'char_end':...
github.com/thatsdone/cinder/commit/f752302d181583a95cf44354aea607ce9d9283f4
cinder/volume/drivers/storwize_svc.py
cwe-078
123
cwe-089
process_form
def process_form(): # see https://docs.python.org/3.4/library/cgi.html for the basic usage # here. form = cgi.FieldStorage() # connect to the database conn = MySQLdb.connect(host = pnsdp.SQL_HOST, user = pnsdp.SQL_USER, passwd = pnsdp.SQL_P...
def process_form(): # see https://docs.python.org/3.4/library/cgi.html for the basic usage # here. form = cgi.FieldStorage() # connect to the database conn = MySQLdb.connect(host = pnsdp.SQL_HOST, user = pnsdp.SQL_USER, passwd = pnsdp.SQL_P...
{'deleted': [{'line_no': 50, 'char_start': 1369, 'char_end': 1479, 'line': ' cursor.execute("""UPDATE games SET state="%s:resignation" WHERE id=%d;""" % (other_player_name,game))\n'}, {'line_no': 63, 'char_start': 1806, 'char_end': 1927, 'line': ' cursor.execute("""INSERT INTO moves(gameID,x,y,letter,time...
{'deleted': [{'char_start': 1450, 'char_end': 1452, 'chars': ' %'}, {'char_start': 1905, 'char_end': 1907, 'chars': ' %'}, {'char_start': 2310, 'char_end': 2312, 'chars': ' %'}], 'added': [{'char_start': 1450, 'char_end': 1451, 'chars': ','}, {'char_start': 1904, 'char_end': 1905, 'chars': ','}, {'char_start': 2308, 'c...
github.com/russ-lewis/ttt_-_python_cgi/commit/6096f43fd4b2d91211eec4614b7960c0816900da
cgi/move.py
cwe-089
617
cwe-089
create_playlist
def create_playlist(name, db): db.execute( "INSERT INTO playlist (name, video_position) VALUES('{name}', 0);".format(name=name))
def create_playlist(name, db): db.execute( "INSERT INTO playlist (name, video_position) VALUES(%s, 0);", (name,))
{'deleted': [{'line_no': 3, 'char_start': 47, 'char_end': 140, 'line': ' "INSERT INTO playlist (name, video_position) VALUES(\'{name}\', 0);".format(name=name))\n'}], 'added': [{'line_no': 3, 'char_start': 47, 'char_end': 125, 'line': ' "INSERT INTO playlist (name, video_position) VALUES(%s, 0);", (name,)...
{'deleted': [{'char_start': 107, 'char_end': 115, 'chars': "'{name}'"}, {'char_start': 121, 'char_end': 128, 'chars': '.format'}, {'char_start': 133, 'char_end': 138, 'chars': '=name'}], 'added': [{'char_start': 107, 'char_end': 109, 'chars': '%s'}, {'char_start': 115, 'char_end': 117, 'chars': ', '}, {'char_start': 12...
github.com/Madmous/playlist/commit/666e52c5f0b8c1f4296e84471637033d9542a7a6
playlist/playlist_repository.py
cwe-089
34
cwe-416
luaD_shrinkstack
void luaD_shrinkstack (lua_State *L) { int inuse = stackinuse(L); int goodsize = inuse + (inuse / 8) + 2*EXTRA_STACK; if (goodsize > LUAI_MAXSTACK) goodsize = LUAI_MAXSTACK; /* respect stack limit */ /* if thread is currently not handling a stack overflow and its good size is smaller than current size...
void luaD_shrinkstack (lua_State *L) { int inuse = stackinuse(L); int goodsize = inuse + BASIC_STACK_SIZE; if (goodsize > LUAI_MAXSTACK) goodsize = LUAI_MAXSTACK; /* respect stack limit */ /* if thread is currently not handling a stack overflow and its good size is smaller than current size, shrink it...
{'deleted': [{'line_no': 3, 'char_start': 68, 'char_end': 122, 'line': ' int goodsize = inuse + (inuse / 8) + 2*EXTRA_STACK;\n'}, {'line_no': 8, 'char_start': 342, 'char_end': 390, 'line': ' if (inuse <= (LUAI_MAXSTACK - EXTRA_STACK) &&\n'}, {'line_no': 9, 'char_start': 390, 'char_end': 421, 'line': ' goodsize <...
{'deleted': [{'char_start': 93, 'char_end': 113, 'chars': '(inuse / 8) + 2*EXTR'}, {'char_start': 389, 'char_end': 395, 'chars': '\n '}], 'added': [{'char_start': 93, 'char_end': 94, 'chars': 'B'}, {'char_start': 95, 'char_end': 98, 'chars': 'SIC'}, {'char_start': 104, 'char_end': 109, 'chars': '_SIZE'}]}
github.com/lua/lua/commit/6298903e35217ab69c279056f925fb72900ce0b7
ldo.c
cwe-416
188
cwe-416
disk_seqf_stop
static void disk_seqf_stop(struct seq_file *seqf, void *v) { struct class_dev_iter *iter = seqf->private; /* stop is called even after start failed :-( */ if (iter) { class_dev_iter_exit(iter); kfree(iter); } }
static void disk_seqf_stop(struct seq_file *seqf, void *v) { struct class_dev_iter *iter = seqf->private; /* stop is called even after start failed :-( */ if (iter) { class_dev_iter_exit(iter); kfree(iter); seqf->private = NULL; } }
{'deleted': [], 'added': [{'line_no': 9, 'char_start': 215, 'char_end': 239, 'line': '\t\tseqf->private = NULL;\n'}]}
{'deleted': [], 'added': [{'char_start': 216, 'char_end': 240, 'chars': '\tseqf->private = NULL;\n\t'}]}
github.com/torvalds/linux/commit/77da160530dd1dc94f6ae15a981f24e5f0021e84
block/genhd.c
cwe-416
61
cwe-089
on_save
def on_save(self): connection = get_connection() cursor = connection.cursor() cursor.execute( f"insert into visitors (ip_address, user_agent, referrer, full_path, visit_time) values ('{self.ip_address}', '{self.user_agent}', '{self.referrer}', '{self.full_path}', '{self.visit_tim...
def on_save(self): connection = get_connection() cursor = connection.cursor() cursor.execute( "insert into visitors (ip_address, user_agent, referrer, full_path, visit_time) values (%s, %s, %s, %s, %s);", (str(self.ip_address), str(self.user_agent), str(self.referrer)...
{'deleted': [{'line_no': 5, 'char_start': 122, 'char_end': 328, 'line': ' f"insert into visitors (ip_address, user_agent, referrer, full_path, visit_time) values (\'{self.ip_address}\', \'{self.user_agent}\', \'{self.referrer}\', \'{self.full_path}\', \'{self.visit_time}\');")\n'}], 'added': [{'line_no': 5, ...
{'deleted': [{'char_start': 134, 'char_end': 135, 'chars': 'f'}, {'char_start': 223, 'char_end': 225, 'chars': "'{"}, {'char_start': 240, 'char_end': 242, 'chars': "}'"}, {'char_start': 244, 'char_end': 246, 'chars': "'{"}, {'char_start': 261, 'char_end': 263, 'chars': "}'"}, {'char_start': 265, 'char_end': 267, 'chars...
github.com/onewyoming/onewyoming/commit/54fc7b076fda2de74eeb55e6b75b28e09ef231c2
experimental/python/buford/model/visitor.py
cwe-089
85
cwe-078
delete_video
@app.route('/delete_video/<filename>') def delete_video(filename): if 'username' in session: #os.remove("static/videos/{}".format(filename)) print(session['username'], file=sys.stdout) data=users.query.filter_by(Username=session['username']).first() video=Video.query.filter_by(UserID=data.UserID,Name=filename)...
@app.route('/delete_video/<filename>') def delete_video(filename): if 'username' in session: #os.remove("static/videos/{}".format(filename)) print(session['username'], file=sys.stdout) data=users.query.filter_by(Username=session['username']).first() video=Video.query.filter_by(UserID=data.UserID,Name=filename)...
{'deleted': [{'line_no': 9, 'char_start': 349, 'char_end': 399, 'line': '\t\t\tos.remove("static/videos/{}".format(filename))\n'}], 'added': [{'line_no': 10, 'char_start': 400, 'char_end': 453, 'line': '\t\t\tos.system("rm static/videos/{}".format(filename))\n'}]}
{'deleted': [], 'added': [{'char_start': 352, 'char_end': 353, 'chars': '#'}, {'char_start': 364, 'char_end': 417, 'chars': 'static/videos/{}".format(filename))\n\t\t\tos.system("rm '}]}
github.com/jmarcello97/CSEC-380-Project/commit/05dcd628aa5879b6e4979c43e7c635075975de09
Trialwebsite/app/app.py
cwe-078
130
cwe-078
_start_fc_map
def _start_fc_map(self, fc_map_id, source, target): try: out, err = self._run_ssh('svctask startfcmap %s' % fc_map_id) except exception.ProcessExecutionError as e: with excutils.save_and_reraise_exception(): LOG.error(_('_start_fc_map: Failed to start FlashCop...
def _start_fc_map(self, fc_map_id, source, target): try: out, err = self._run_ssh(['svctask', 'startfcmap', fc_map_id]) except exception.ProcessExecutionError as e: with excutils.save_and_reraise_exception(): LOG.error(_('_start_fc_map: Failed to start FlashCo...
{'deleted': [{'line_no': 3, 'char_start': 69, 'char_end': 143, 'line': " out, err = self._run_ssh('svctask startfcmap %s' % fc_map_id)\n"}], 'added': [{'line_no': 3, 'char_start': 69, 'char_end': 144, 'line': " out, err = self._run_ssh(['svctask', 'startfcmap', fc_map_id])\n"}]}
{'deleted': [{'char_start': 125, 'char_end': 128, 'chars': ' %s'}, {'char_start': 129, 'char_end': 131, 'chars': ' %'}], 'added': [{'char_start': 106, 'char_end': 107, 'chars': '['}, {'char_start': 115, 'char_end': 117, 'chars': "',"}, {'char_start': 118, 'char_end': 119, 'chars': "'"}, {'char_start': 130, 'char_end': ...
github.com/thatsdone/cinder/commit/f752302d181583a95cf44354aea607ce9d9283f4
cinder/volume/drivers/storwize_svc.py
cwe-078
132
cwe-190
TIFFSeekCustomStream
static MagickOffsetType TIFFSeekCustomStream(const MagickOffsetType offset, const int whence,void *user_data) { PhotoshopProfile *profile; profile=(PhotoshopProfile *) user_data; switch (whence) { case SEEK_SET: default: { if (offset < 0) return(-1); profile->offset=offset...
static MagickOffsetType TIFFSeekCustomStream(const MagickOffsetType offset, const int whence,void *user_data) { PhotoshopProfile *profile; profile=(PhotoshopProfile *) user_data; switch (whence) { case SEEK_SET: default: { if (offset < 0) return(-1); profile->offset=offset...
{'deleted': [], 'added': [{'line_no': 20, 'char_start': 366, 'char_end': 436, 'line': ' if (((offset > 0) && (profile->offset > (SSIZE_MAX-offset))) ||\n'}, {'line_no': 21, 'char_start': 436, 'char_end': 505, 'line': ' ((offset < 0) && (profile->offset < (-SSIZE_MAX-offset))))\n'}, {'line_no': 22, 'char_s...
{'deleted': [], 'added': [{'char_start': 377, 'char_end': 585, 'chars': '(offset > 0) && (profile->offset > (SSIZE_MAX-offset))) ||\n ((offset < 0) && (profile->offset < (-SSIZE_MAX-offset))))\n {\n errno=EOVERFLOW;\n return(-1);\n }\n if (('}]}
github.com/ImageMagick/ImageMagick/commit/fe5f4b85e6b1b54d3b4588a77133c06ade46d891
coders/tiff.c
cwe-190
174
cwe-190
mem_check_range
int mem_check_range(struct rxe_mem *mem, u64 iova, size_t length) { switch (mem->type) { case RXE_MEM_TYPE_DMA: return 0; case RXE_MEM_TYPE_MR: case RXE_MEM_TYPE_FMR: return ((iova < mem->iova) || ((iova + length) > (mem->iova + mem->length))) ? -EFAULT : 0; default: return -EFAULT; } }
int mem_check_range(struct rxe_mem *mem, u64 iova, size_t length) { switch (mem->type) { case RXE_MEM_TYPE_DMA: return 0; case RXE_MEM_TYPE_MR: case RXE_MEM_TYPE_FMR: if (iova < mem->iova || length > mem->length || iova > mem->iova + mem->length - length) return -EFAULT; return 0; default: ...
{'deleted': [{'line_no': 9, 'char_start': 174, 'char_end': 206, 'line': '\t\treturn ((iova < mem->iova) ||\n'}, {'line_no': 10, 'char_start': 206, 'char_end': 258, 'line': '\t\t\t((iova + length) > (mem->iova + mem->length))) ?\n'}, {'line_no': 11, 'char_start': 258, 'char_end': 274, 'line': '\t\t\t-EFAULT : 0;\n'}], '...
{'deleted': [{'char_start': 176, 'char_end': 182, 'chars': 'return'}, {'char_start': 183, 'char_end': 184, 'chars': '('}, {'char_start': 201, 'char_end': 202, 'chars': ')'}, {'char_start': 208, 'char_end': 215, 'chars': '\t((iova'}, {'char_start': 216, 'char_end': 217, 'chars': '+'}, {'char_start': 224, 'char_end': 225...
github.com/torvalds/linux/commit/647bf3d8a8e5777319da92af672289b2a6c4dc66
drivers/infiniband/sw/rxe/rxe_mr.c
cwe-190
106
cwe-476
copyIPv6IfDifferent
static void copyIPv6IfDifferent(void * dest, const void * src) { if(dest != src) { memcpy(dest, src, sizeof(struct in6_addr)); } }
static void copyIPv6IfDifferent(void * dest, const void * src) { if(dest != src && src != NULL) { memcpy(dest, src, sizeof(struct in6_addr)); } }
{'deleted': [{'line_no': 3, 'char_start': 65, 'char_end': 84, 'line': '\tif(dest != src) {\n'}], 'added': [{'line_no': 3, 'char_start': 65, 'char_end': 99, 'line': '\tif(dest != src && src != NULL) {\n'}]}
{'deleted': [], 'added': [{'char_start': 80, 'char_end': 95, 'chars': ' && src != NULL'}]}
github.com/miniupnp/miniupnp/commit/cb8a02af7a5677cf608e86d57ab04241cf34e24f
miniupnpd/pcpserver.c
cwe-476
38
cwe-089
get_tournaments_during_month
def get_tournaments_during_month(db, scene, date): y, m, d = date.split('-') ym_date = '{}-{}'.format(y, m) sql = "select url, date from matches where scene='{}' and date like '%{}%' group by url, date order by date".format(scene, ym_date) res = db.exec(sql) urls = [r[0] for r in res] return url...
def get_tournaments_during_month(db, scene, date): y, m, d = date.split('-') ym_date = '{}-{}'.format(y, m) sql = "select url, date from matches where scene='{scene}' and date like '%{date}%' group by url, date order by date" args = {'scene': scene, 'date': ym_date} res = db.exec(sql, args) urls...
{'deleted': [{'line_no': 4, 'char_start': 116, 'char_end': 252, 'line': ' sql = "select url, date from matches where scene=\'{}\' and date like \'%{}%\' group by url, date order by date".format(scene, ym_date)\n'}, {'line_no': 5, 'char_start': 252, 'char_end': 275, 'line': ' res = db.exec(sql)\n'}], 'added': [{'l...
{'deleted': [{'char_start': 228, 'char_end': 231, 'chars': '.fo'}, {'char_start': 232, 'char_end': 236, 'chars': 'mat('}, {'char_start': 250, 'char_end': 251, 'chars': ')'}], 'added': [{'char_start': 171, 'char_end': 176, 'chars': 'scene'}, {'char_start': 196, 'char_end': 200, 'chars': 'date'}, {'char_start': 237, 'cha...
github.com/DKelle/Smash_stats/commit/4bb83f3f6ce7d6bebbeb512cd015f9e72cf36d63
bracket_utils.py
cwe-089
97
cwe-476
prplcb_xfer_new_send_cb
static gboolean prplcb_xfer_new_send_cb(gpointer data, gint fd, b_input_condition cond) { PurpleXfer *xfer = data; struct im_connection *ic = purple_ic_by_pa(xfer->account); struct prpl_xfer_data *px = xfer->ui_data; PurpleBuddy *buddy; const char *who; buddy = purple_find_buddy(xfer->account, xfer->who); who =...
static gboolean prplcb_xfer_new_send_cb(gpointer data, gint fd, b_input_condition cond) { PurpleXfer *xfer = data; struct im_connection *ic = purple_ic_by_pa(xfer->account); struct prpl_xfer_data *px = xfer->ui_data; PurpleBuddy *buddy; const char *who; buddy = purple_find_buddy(xfer->account, xfer->who); who =...
{'deleted': [], 'added': [{'line_no': 15, 'char_start': 556, 'char_end': 557, 'line': '\n'}, {'line_no': 16, 'char_start': 557, 'char_end': 573, 'line': '\tif (!px->ft) {\n'}, {'line_no': 17, 'char_start': 573, 'char_end': 589, 'line': '\t\treturn FALSE;\n'}, {'line_no': 18, 'char_start': 589, 'char_end': 592, 'line': ...
{'deleted': [], 'added': [{'char_start': 556, 'char_end': 592, 'chars': '\n\tif (!px->ft) {\n\t\treturn FALSE;\n\t}\n'}]}
github.com/bitlbee/bitlbee/commit/30d598ce7cd3f136ee9d7097f39fa9818a272441
protocols/purple/ft.c
cwe-476
235
cwe-089
edit
@mod.route('/edit/<int:cmt_id>', methods=['GET', 'POST']) def edit(cmt_id): m = None if request.method == 'GET': sql = "SELECT * FROM comment where cmt_id = %d;" % (cmt_id) cursor.execute(sql) m = cursor.fetchone() return render_template('comment/edit.html', m=m, cmt_id=cmt_id) ...
@mod.route('/edit/<int:cmt_id>', methods=['GET', 'POST']) def edit(cmt_id): m = None if request.method == 'GET': cursor.execute("SELECT * FROM comment where cmt_id = %s;", (cmt_id,)) m = cursor.fetchone() return render_template('comment/edit.html', m=m, cmt_id=cmt_id) if request.met...
{'deleted': [{'line_no': 5, 'char_start': 121, 'char_end': 189, 'line': ' sql = "SELECT * FROM comment where cmt_id = %d;" % (cmt_id)\n'}, {'line_no': 6, 'char_start': 189, 'char_end': 217, 'line': ' cursor.execute(sql)\n'}, {'line_no': 12, 'char_start': 395, 'char_end': 468, 'line': ' sql = "UPDAT...
{'deleted': [{'char_start': 130, 'char_end': 135, 'chars': 'ql = '}, {'char_start': 174, 'char_end': 175, 'chars': 'd'}, {'char_start': 177, 'char_end': 179, 'chars': ' %'}, {'char_start': 188, 'char_end': 215, 'chars': '\n cursor.execute(sql'}, {'char_start': 404, 'char_end': 409, 'chars': 'ql = '}, {'char_star...
github.com/ulyssetsd/bjtu-sql/commit/17d7b21864b72ba5666f15236474a93268b32ec9
flaskr/flaskr/views/comment.py
cwe-089
219
cwe-125
Get8BIMProperty
static MagickBooleanType Get8BIMProperty(const Image *image,const char *key, ExceptionInfo *exception) { char *attribute, format[MagickPathExtent], name[MagickPathExtent], *resource; const StringInfo *profile; const unsigned char *info; long start, stop; MagickBooleanType...
static MagickBooleanType Get8BIMProperty(const Image *image,const char *key, ExceptionInfo *exception) { char *attribute, format[MagickPathExtent], name[MagickPathExtent], *resource; const StringInfo *profile; const unsigned char *info; long start, stop; MagickBooleanType...
{'deleted': [], 'added': [{'line_no': 90, 'char_start': 2403, 'char_end': 2453, 'line': ' if ((count < 0) || ((size_t) count > length))\n'}, {'line_no': 91, 'char_start': 2453, 'char_end': 2461, 'line': ' {\n'}, {'line_no': 92, 'char_start': 2461, 'char_end': 2480, 'line': ' length=0; \n'}, {'line_no': 9...
{'deleted': [], 'added': [{'char_start': 2412, 'char_end': 2515, 'chars': 'count < 0) || ((size_t) count > length))\n {\n length=0; \n continue;\n }\n if (('}]}
github.com/ImageMagick/ImageMagick/commit/dd84447b63a71fa8c3f47071b09454efc667767b
MagickCore/property.c
cwe-125
1,133
cwe-125
SpliceImage
MagickExport Image *SpliceImage(const Image *image, const RectangleInfo *geometry,ExceptionInfo *exception) { #define SpliceImageTag "Splice/Image" CacheView *image_view, *splice_view; Image *splice_image; MagickBooleanType status; MagickOffsetType progress; RectangleInfo splic...
MagickExport Image *SpliceImage(const Image *image, const RectangleInfo *geometry,ExceptionInfo *exception) { #define SpliceImageTag "Splice/Image" CacheView *image_view, *splice_view; Image *splice_image; MagickBooleanType status; MagickOffsetType progress; RectangleInfo splic...
{'deleted': [{'line_no': 130, 'char_start': 3435, 'char_end': 3511, 'line': ' p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);\n'}, {'line_no': 138, 'char_start': 3734, 'char_end': 3776, 'line': ' for (x=0; x < splice_geometry.x; x++)\n'}, {'line_no': 232, 'char_start': 6932, 'char_end': 70...
{'deleted': [{'char_start': 3752, 'char_end': 3756, 'chars': 'spli'}, {'char_start': 3757, 'char_end': 3761, 'chars': 'e_ge'}, {'char_start': 3763, 'char_end': 3769, 'chars': 'etry.x'}, {'char_start': 7046, 'char_end': 7118, 'chars': ';\n if ((y < 0) || (y >= (ssize_t) splice_image->rows))\n continue'}, {'char_...
github.com/ImageMagick/ImageMagick/commit/7b1cf5784b5bcd85aa9293ecf56769f68c037231
MagickCore/transform.c
cwe-125
2,536
cwe-079
respond_error
def respond_error(self, context, exception): context.respond_server_error() stack = traceback.format_exc() return """ <html> <body> <style> body { font-family: sans-serif; color: #888; ...
def respond_error(self, context, exception): context.respond_server_error() stack = traceback.format_exc() return """ <html> <body> <style> body { font-family: sans-serif; color: #888; ...
{'deleted': [{'line_no': 33, 'char_start': 871, 'char_end': 890, 'line': ' """ % stack\n'}], 'added': [{'line_no': 33, 'char_start': 871, 'char_end': 902, 'line': ' """ % cgi.escape(stack)'}]}
{'deleted': [], 'added': [{'char_start': 885, 'char_end': 896, 'chars': 'cgi.escape('}, {'char_start': 901, 'char_end': 902, 'chars': ')'}]}
github.com/Eugeny/ajenti/commit/d3fc5eb142ff16d55d158afb050af18d5ff09120
ajenti/routing.py
cwe-079
153
cwe-125
java_switch_op
static int java_switch_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { ut8 op_byte = data[0]; ut64 offset = addr - java_get_method_start (); ut8 pos = (offset+1)%4 ? 1 + 4 - (offset+1)%4 : 1; if (op_byte == 0xaa) { // handle a table switch condition if (pos + 8 > len) { return op->size; ...
static int java_switch_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { ut8 op_byte = data[0]; ut64 offset = addr - java_get_method_start (); ut8 pos = (offset+1)%4 ? 1 + 4 - (offset+1)%4 : 1; if (op_byte == 0xaa) { // handle a table switch condition if (pos + 8 + 8 > len) { return op->si...
{'deleted': [{'line_no': 8, 'char_start': 277, 'char_end': 300, 'line': '\t\tif (pos + 8 > len) {\n'}, {'line_no': 11, 'char_start': 324, 'char_end': 370, 'line': '\t\tint min_val = (ut32)(UINT (data, pos + 4)),\n'}, {'line_no': 12, 'char_start': 370, 'char_end': 413, 'line': '\t\t\tmax_val = (ut32)(UINT (data, pos + 8...
{'deleted': [{'char_start': 368, 'char_end': 369, 'chars': ','}, {'char_start': 372, 'char_end': 373, 'chars': '\t'}], 'added': [{'char_start': 291, 'char_end': 295, 'chars': '+ 8 '}, {'char_start': 330, 'char_end': 336, 'chars': 'const '}, {'char_start': 378, 'char_end': 379, 'chars': ';'}, {'char_start': 382, 'char_e...
github.com/radare/radare2/commit/224e6bc13fa353dd3b7f7a2334588f1c4229e58d
libr/anal/p/anal_java.c
cwe-125
489
cwe-416
get_task_ioprio
static int get_task_ioprio(struct task_struct *p) { int ret; ret = security_task_getioprio(p); if (ret) goto out; ret = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, IOPRIO_NORM); if (p->io_context) ret = p->io_context->ioprio; out: return ret; }
static int get_task_ioprio(struct task_struct *p) { int ret; ret = security_task_getioprio(p); if (ret) goto out; ret = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, IOPRIO_NORM); task_lock(p); if (p->io_context) ret = p->io_context->ioprio; task_unlock(p); out: return ret; }
{'deleted': [], 'added': [{'line_no': 9, 'char_start': 178, 'char_end': 193, 'line': '\ttask_lock(p);\n'}, {'line_no': 12, 'char_start': 244, 'char_end': 261, 'line': '\ttask_unlock(p);\n'}]}
{'deleted': [], 'added': [{'char_start': 179, 'char_end': 194, 'chars': 'task_lock(p);\n\t'}, {'char_start': 242, 'char_end': 259, 'chars': ';\n\ttask_unlock(p)'}]}
github.com/torvalds/linux/commit/8ba8682107ee2ca3347354e018865d8e1967c5f4
block/ioprio.c
cwe-416
83
cwe-125
_6502_op
static int _6502_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { char addrbuf[64]; const int buffsize = sizeof (addrbuf) - 1; memset (op, '\0', sizeof (RAnalOp)); op->size = snes_op_get_size (1, 1, &snes_op[data[0]]); //snes-arch is similiar to nes/6502 op->addr = addr; op->type = R_ANAL_OP_T...
static int _6502_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { char addrbuf[64]; const int buffsize = sizeof (addrbuf) - 1; memset (op, '\0', sizeof (RAnalOp)); op->size = snes_op_get_size (1, 1, &snes_op[data[0]]); //snes-arch is similiar to nes/6502 op->addr = addr; op->type = R_ANAL_OP_T...
{'deleted': [{'line_no': 397, 'char_start': 10823, 'char_end': 10845, 'line': '\t\tif (data[1] <= 127)\n'}, {'line_no': 398, 'char_start': 10845, 'char_end': 10886, 'line': '\t\t\top->jump = addr + data[1] + op->size;\n'}, {'line_no': 399, 'char_start': 10886, 'char_end': 10939, 'line': '\t\telse\top->jump = addr - (25...
{'deleted': [], 'added': [{'char_start': 10829, 'char_end': 10847, 'chars': 'len > 1) {\n\t\t\tif ('}, {'char_start': 10862, 'char_end': 10864, 'chars': ' {'}, {'char_start': 10865, 'char_end': 10866, 'chars': '\t'}, {'char_start': 10909, 'char_end': 10912, 'chars': '\t} '}, {'char_start': 10916, 'char_end': 10922, 'ch...
github.com/radare/radare2/commit/bbb4af56003c1afdad67af0c4339267ca38b1017
libr/anal/p/anal_6502.c
cwe-125
7,183
cwe-787
enl_ipc_get
char *enl_ipc_get(const char *msg_data) { static char *message = NULL; static unsigned short len = 0; char buff[13], *ret_msg = NULL; register unsigned char i; unsigned char blen; if (msg_data == IPC_TIMEOUT) { return(IPC_TIMEOUT); } for (i = 0; i < 12; i++) { buff[i] = msg_data[i]; } buff[12] = 0; ble...
char *enl_ipc_get(const char *msg_data) { static char *message = NULL; static size_t len = 0; char buff[13], *ret_msg = NULL; register unsigned char i; unsigned char blen; if (msg_data == IPC_TIMEOUT) { return(IPC_TIMEOUT); } for (i = 0; i < 12; i++) { buff[i] = msg_data[i]; } buff[12] = 0; blen = strl...
{'deleted': [{'line_no': 5, 'char_start': 73, 'char_end': 105, 'line': '\tstatic unsigned short len = 0;\n'}], 'added': [{'line_no': 5, 'char_start': 73, 'char_end': 97, 'line': '\tstatic size_t len = 0;\n'}]}
{'deleted': [{'char_start': 81, 'char_end': 83, 'chars': 'un'}, {'char_start': 85, 'char_end': 87, 'chars': 'gn'}, {'char_start': 88, 'char_end': 94, 'chars': 'd shor'}], 'added': [{'char_start': 83, 'char_end': 84, 'chars': 'z'}, {'char_start': 85, 'char_end': 86, 'chars': '_'}]}
github.com/derf/feh/commit/f7a547b7ef8fc8ebdeaa4c28515c9d72e592fb6d
src/wallpaper.c
cwe-787
218
cwe-089
get_user
def get_user(self): if not hasattr(self, '_user'): qs = "select * from account_access where access_token = '%s'" % self.access_token result = self.db.get(qs) if result: self._user = result else: self._user = None ...
def get_user(self): if not hasattr(self, '_user'): qs = "select * from account_access where access_token = %s" result = self.db.get(qs, self.access_token) if result: self._user = result else: self._user = None r...
{'deleted': [{'line_no': 3, 'char_start': 63, 'char_end': 157, 'line': ' qs = "select * from account_access where access_token = \'%s\'" % self.access_token\n'}, {'line_no': 4, 'char_start': 157, 'char_end': 194, 'line': ' result = self.db.get(qs)\n'}], 'added': [{'line_no': 3, 'char_start': 63, '...
{'deleted': [{'char_start': 131, 'char_end': 132, 'chars': "'"}, {'char_start': 134, 'char_end': 135, 'chars': "'"}, {'char_start': 136, 'char_end': 156, 'chars': ' % self.access_token'}], 'added': [{'char_start': 170, 'char_end': 189, 'chars': ', self.access_token'}]}
github.com/bonbondirac/tsunami/commit/396cc394bd6daaf0ee9c16b1b55a4082eeaac208
src/auth.py
cwe-089
71
cwe-476
rds_cmsg_atomic
int rds_cmsg_atomic(struct rds_sock *rs, struct rds_message *rm, struct cmsghdr *cmsg) { struct page *page = NULL; struct rds_atomic_args *args; int ret = 0; if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct rds_atomic_args)) || rm->atomic.op_active) return -EINVAL; args = CMSG_DATA(cmsg); /* Nonmasked & m...
int rds_cmsg_atomic(struct rds_sock *rs, struct rds_message *rm, struct cmsghdr *cmsg) { struct page *page = NULL; struct rds_atomic_args *args; int ret = 0; if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct rds_atomic_args)) || rm->atomic.op_active) return -EINVAL; args = CMSG_DATA(cmsg); /* Nonmasked & m...
{'deleted': [], 'added': [{'line_no': 90, 'char_start': 2680, 'char_end': 2707, 'line': '\trm->atomic.op_active = 0;\n'}]}
{'deleted': [], 'added': [{'char_start': 2681, 'char_end': 2708, 'chars': 'rm->atomic.op_active = 0;\n\t'}]}
github.com/torvalds/linux/commit/7d11f77f84b27cef452cee332f4e469503084737
net/rds/rdma.c
cwe-476
867
cwe-089
userLogin
def userLogin(self): sqlName="select count(*) from users where name='%s' and \ password='%s';"%(self.name,self.password) checkName=sql.queryDB(self.conn,sqlName) result=checkName[0][0] if result == 0: self.clean() return False else: ...
def userLogin(self): sqlName="select count(*) from users where name=%s and password=%s;" params = [self.name,self.password] checkName=sql.queryDB(self.conn,sqlName,params) result=checkName[0][0] if result == 0: self.clean() return False else: ...
{'deleted': [{'line_no': 3, 'char_start': 26, 'char_end': 92, 'line': ' sqlName="select count(*) from users where name=\'%s\' and \\\n'}, {'line_no': 4, 'char_start': 92, 'char_end': 150, 'line': ' password=\'%s\';"%(self.name,self.password)\n'}, {'line_no': 5, 'char_start': 150, 'char_end': 199, ...
{'deleted': [{'char_start': 81, 'char_end': 82, 'chars': "'"}, {'char_start': 84, 'char_end': 85, 'chars': "'"}, {'char_start': 90, 'char_end': 91, 'chars': '\\'}, {'char_start': 92, 'char_end': 100, 'chars': ' '}, {'char_start': 111, 'char_end': 116, 'chars': 'sword'}, {'char_start': 117, 'char_end': 125, 'char...
github.com/ShaominLi/Twitter_project/commit/5329d91f9e569c95184053c8e7ef596949c33ce9
modules/users.py
cwe-089
77
cwe-476
run
static int run(const CommandLineOptions& options) { IR::Module irModule; // Load the module. if(!loadModule(options.filename, irModule)) { return EXIT_FAILURE; } if(options.onlyCheck) { return EXIT_SUCCESS; } // Compile the module. Runtime::Module* module = nullptr; if(!options.precompiled) { module = Runtime:...
static int run(const CommandLineOptions& options) { IR::Module irModule; // Load the module. if(!loadModule(options.filename, irModule)) { return EXIT_FAILURE; } if(options.onlyCheck) { return EXIT_SUCCESS; } // Compile the module. Runtime::Module* module = nullptr; if(!options.precompiled) { module = Runtime:...
{'deleted': [{'line_no': 119, 'char_start': 3608, 'char_end': 3686, 'line': '\t\t\tMemoryInstance* defaultMemory = Runtime::getDefaultMemory(moduleInstance);\n'}, {'line_no': 120, 'char_start': 3686, 'char_end': 3708, 'line': '\t\t\tif(!defaultMemory)\n'}, {'line_no': 128, 'char_start': 3858, 'char_end': 3898, 'line': ...
{'deleted': [{'char_start': 3611, 'char_end': 3612, 'chars': 'M'}, {'char_start': 3614, 'char_end': 3619, 'chars': 'oryIn'}, {'char_start': 3620, 'char_end': 3623, 'chars': 'tan'}, {'char_start': 3624, 'char_end': 3638, 'chars': 'e* defaultMemo'}, {'char_start': 3639, 'char_end': 3647, 'chars': 'y = Runt'}, {'char_star...
github.com/WAVM/WAVM/commit/31d670b6489e6d708c3b04b911cdf14ac43d846d
Programs/wavm/wavm.cpp
cwe-476
1,429
cwe-125
gf_m2ts_process_pmt
static void gf_m2ts_process_pmt(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *pmt, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status) { u32 info_length, pos, desc_len, evt_type, nb_es,i; u32 nb_sections; u32 data_size; u32 nb_hevc, nb_hevc_temp, nb_shvc, nb_shvc_temp,...
static void gf_m2ts_process_pmt(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *pmt, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status) { u32 info_length, pos, desc_len, evt_type, nb_es,i; u32 nb_sections; u32 data_size; u32 nb_hevc, nb_hevc_temp, nb_shvc, nb_shvc_temp,...
{'deleted': [{'line_no': 413, 'char_start': 14239, 'char_end': 14243, 'line': '\t\t}\n'}, {'line_no': 415, 'char_start': 14244, 'char_end': 14300, 'line': '\t\tif (es->stream_type == GF_M2TS_VIDEO_HEVC) nb_hevc++;\n'}, {'line_no': 416, 'char_start': 14300, 'char_end': 14375, 'line': '\t\telse if (es->stream_type == GF_...
{'deleted': [{'char_start': 14239, 'char_end': 14240, 'chars': '\t'}, {'char_start': 14241, 'char_end': 14244, 'chars': '}\n\n'}], 'added': [{'char_start': 14240, 'char_end': 14241, 'chars': '\t'}, {'char_start': 14297, 'char_end': 14298, 'chars': '\t'}, {'char_start': 14373, 'char_end': 14374, 'chars': '\t'}, {'char_s...
github.com/gpac/gpac/commit/2320eb73afba753b39b7147be91f7be7afc0eeb7
src/media_tools/mpegts.c
cwe-125
5,704
cwe-079
DeletionConfirmationDlg::DeletionConfirmationDlg
DeletionConfirmationDlg(QWidget *parent, const int &size, const QString &name, bool defaultDeleteFiles): QDialog(parent) { setupUi(this); if (size == 1) label->setText(tr("Are you sure you want to delete '%1' from the transfer list?", "Are you sure you want to delete 'ubuntu-linux-iso' from the transfer...
DeletionConfirmationDlg(QWidget *parent, const int &size, const QString &name, bool defaultDeleteFiles): QDialog(parent) { setupUi(this); if (size == 1) label->setText(tr("Are you sure you want to delete '%1' from the transfer list?", "Are you sure you want to delete 'ubuntu-linux-iso' from the transfer...
{'deleted': [{'line_no': 4, 'char_start': 163, 'char_end': 341, 'line': ' label->setText(tr("Are you sure you want to delete \'%1\' from the transfer list?", "Are you sure you want to delete \'ubuntu-linux-iso\' from the transfer list?").arg(name));\n'}], 'added': [{'line_no': 4, 'char_start': 163, 'char_end': 371...
{'deleted': [], 'added': [{'char_start': 333, 'char_end': 362, 'chars': 'Utils::String::toHtmlEscaped('}, {'char_start': 366, 'char_end': 367, 'chars': ')'}]}
github.com/qbittorrent/qBittorrent/commit/6ca3e4f094da0a0017cb2d483ec1db6176bb0b16
src/gui/deletionconfirmationdlg.h
cwe-079
259
cwe-079
init_settings
def init_settings(self, ipython_app, kernel_manager, contents_manager, cluster_manager, session_manager, kernel_spec_manager, config_manager, log, base_url, default_url, settings_overrides, jinja_env_options=None): _tem...
def init_settings(self, ipython_app, kernel_manager, contents_manager, cluster_manager, session_manager, kernel_spec_manager, config_manager, log, base_url, default_url, settings_overrides, jinja_env_options=None): _tem...
{'deleted': [{'line_no': 15, 'char_start': 629, 'char_end': 695, 'line': ' jenv_opt = jinja_env_options if jinja_env_options else {}\n'}], 'added': [{'line_no': 15, 'char_start': 629, 'char_end': 669, 'line': ' jenv_opt = {"autoescape": True}\n'}, {'line_no': 16, 'char_start': 669, 'char_end': 741, 'line'...
{'deleted': [], 'added': [{'char_start': 648, 'char_end': 693, 'chars': '{"autoescape": True}\n jenv_opt.update('}, {'char_start': 739, 'char_end': 741, 'chars': ')\n'}]}
github.com/ipython/ipython/commit/3ab41641cf6fce3860c73d5cf4645aa12e1e5892
IPython/html/notebookapp.py
cwe-079
546
cwe-190
set_geometry
static int set_geometry(unsigned int cmd, struct floppy_struct *g, int drive, int type, struct block_device *bdev) { int cnt; /* sanity checking for parameters. */ if (g->sect <= 0 || g->head <= 0 || /* check for zero in F_SECT_PER_TRACK */ (unsigned char)((g->sect << 2) >> FD_SIZECODE(g)) ...
static int set_geometry(unsigned int cmd, struct floppy_struct *g, int drive, int type, struct block_device *bdev) { int cnt; /* sanity checking for parameters. */ if ((int)g->sect <= 0 || (int)g->head <= 0 || /* check for overflow in max_sector */ (int)(g->sect * g->head) <= 0 || /* c...
{'deleted': [{'line_no': 7, 'char_start': 177, 'char_end': 198, 'line': '\tif (g->sect <= 0 ||\n'}, {'line_no': 8, 'char_start': 198, 'char_end': 219, 'line': '\t g->head <= 0 ||\n'}], 'added': [{'line_no': 7, 'char_start': 177, 'char_end': 203, 'line': '\tif ((int)g->sect <= 0 ||\n'}, {'line_no': 8, 'char_start': 2...
{'deleted': [], 'added': [{'char_start': 182, 'char_end': 187, 'chars': '(int)'}, {'char_start': 208, 'char_end': 213, 'chars': '(int)'}, {'char_start': 220, 'char_end': 302, 'chars': ' <= 0 ||\n\t /* check for overflow in max_sector */\n\t (int)(g->sect * g->head)'}]}
github.com/torvalds/linux/commit/da99466ac243f15fbba65bd261bfc75ffa1532b6
drivers/block/floppy.c
cwe-190
676
cwe-476
chmd_read_headers
static int chmd_read_headers(struct mspack_system *sys, struct mspack_file *fh, struct mschmd_header *chm, int entire) { unsigned int section, name_len, x, errors, num_chunks; unsigned char buf[0x54], *chunk = NULL, *name, *p, *end; struct mschmd_file *fi, *link = NULL; off_t offset, length; int num_e...
static int chmd_read_headers(struct mspack_system *sys, struct mspack_file *fh, struct mschmd_header *chm, int entire) { unsigned int section, name_len, x, errors, num_chunks; unsigned char buf[0x54], *chunk = NULL, *name, *p, *end; struct mschmd_file *fi, *link = NULL; off_t offset, length; int num_e...
{'deleted': [{'line_no': 189, 'char_start': 6005, 'char_end': 6057, 'line': ' /* consider blank filenames to be an error */\n'}, {'line_no': 190, 'char_start': 6057, 'char_end': 6098, 'line': ' if (name_len == 0) goto chunk_end;\n'}, {'line_no': 192, 'char_start': 6129, 'char_end': 6130, 'line': '\n'}], 'adde...
{'deleted': [{'char_start': 6011, 'char_end': 6104, 'chars': '/* consider blank filenames to be an error */\n if (name_len == 0) goto chunk_end;\n '}, {'char_start': 6128, 'char_end': 6129, 'chars': '\n'}], 'added': [{'char_start': 6116, 'char_end': 6254, 'chars': ';\n\n /* ignore blank or one-char (e.g....
github.com/kyz/libmspack/commit/8759da8db6ec9e866cb8eb143313f397f925bb4f
libmspack/mspack/chmd.c
cwe-476
2,672
cwe-190
layer_resize
layer_resize(int layer, int x_size, int y_size) { int old_height; int old_width; struct map_tile* tile; int tile_width; int tile_height; struct map_tile* tilemap; struct map_trigger* trigger; struct map_zone* zone; int x, y, i; old_wid...
layer_resize(int layer, int x_size, int y_size) { int old_height; int old_width; struct map_tile* tile; int tile_width; int tile_height; struct map_tile* tilemap; struct map_trigger* trigger; struct map_zone* zone; size_t til...
{'deleted': [{'line_no': 19, 'char_start': 526, 'char_end': 595, 'line': '\tif (!(tilemap = malloc(x_size * y_size * sizeof(struct map_tile))))\n'}], 'added': [{'line_no': 11, 'char_start': 296, 'char_end': 331, 'line': '\tsize_t tilemap_size;\n'}, {'line_no': 20, 'char_start': 561, 'char_end': 620, 'line'...
{'deleted': [{'char_start': 527, 'char_end': 533, 'chars': 'if (!('}, {'char_start': 546, 'char_end': 549, 'chars': 'loc'}, {'char_start': 557, 'char_end': 558, 'chars': '*'}, {'char_start': 559, 'char_end': 560, 'chars': 'y'}, {'char_start': 566, 'char_end': 567, 'chars': '*'}], 'added': [{'char_start': 296, 'char_end...
github.com/fatcerberus/minisphere/commit/252c1ca184cb38e1acb917aa0e451c5f08519996
src/minisphere/map_engine.c
cwe-190
719
cwe-089
patch
@jwt_required def patch(self, user_id): """ Replaces information of corresponding user_id with request body """ query = f"""update users set user_id = %s """ query += f"""where user_id = '{user_id}'""" json_data = request.get_json() parameters = (json_data['user_id'], ) ...
@jwt_required def patch(self, user_id): """ Replaces information of corresponding user_id with request body """ query = f"""update users set user_id = %s """ query += f"""where user_id = %s""" json_data = request.get_json() parameters = (json_data['user_id'], user_id) ...
{'deleted': [{'line_no': 5, 'char_start': 182, 'char_end': 234, 'line': ' query += f"""where user_id = \'{user_id}\'"""\n'}, {'line_no': 7, 'char_start': 273, 'char_end': 319, 'line': " parameters = (json_data['user_id'], )\n"}], 'added': [{'line_no': 5, 'char_start': 182, 'char_end': 225, 'line': ' ...
{'deleted': [{'char_start': 219, 'char_end': 222, 'chars': "'{u"}, {'char_start': 223, 'char_end': 230, 'chars': "er_id}'"}], 'added': [{'char_start': 219, 'char_end': 220, 'chars': '%'}, {'char_start': 308, 'char_end': 315, 'chars': 'user_id'}]}
github.com/sgosal2/tiger-boards-backend/commit/4670109dd613df2f2fe7e8403ebd149df2b55485
apis/users.py
cwe-089
82
cwe-125
load_tile
static MagickBooleanType load_tile(Image *image,Image *tile_image, XCFDocInfo *inDocInfo,XCFLayerInfo *inLayerInfo,size_t data_length, ExceptionInfo *exception) { ssize_t y; register ssize_t x; register Quantum *q; ssize_t count; unsigned char *graydata; XCFPixelInfo *xcfdat...
static MagickBooleanType load_tile(Image *image,Image *tile_image, XCFDocInfo *inDocInfo,XCFLayerInfo *inLayerInfo,size_t data_length, ExceptionInfo *exception) { ssize_t y; register ssize_t x; register Quantum *q; ssize_t count; unsigned char *graydata; XCFPixelInfo *xcfdat...
{'deleted': [{'line_no': 24, 'char_start': 339, 'char_end': 418, 'line': ' xcfdata=(XCFPixelInfo *) AcquireQuantumMemory(data_length,sizeof(*xcfdata));\n'}], 'added': [{'line_no': 24, 'char_start': 339, 'char_end': 410, 'line': ' xcfdata=(XCFPixelInfo *) AcquireQuantumMemory(MagickMax(data_length,\n'}, {'line_no': 25...
{'deleted': [], 'added': [{'char_start': 387, 'char_end': 397, 'chars': 'MagickMax('}, {'char_start': 408, 'char_end': 451, 'chars': ',\n tile_image->columns*tile_image->rows)'}]}
github.com/ImageMagick/ImageMagick/commit/a2e1064f288a353bc5fef7f79ccb7683759e775c
coders/xcf.c
cwe-125
589
cwe-089
fetch_resultSet
def fetch_resultSet(self, session, id): self._openContainer(session) sid = str(id) if (self.idNormalizer is not None): sid = self.idNormalizer.process_string(session, sid) query = ("SELECT class, data FROM %s WHERE identifier = '%s';" % (self.table, sid)...
def fetch_resultSet(self, session, id): self._openContainer(session) sid = str(id) if (self.idNormalizer is not None): sid = self.idNormalizer.process_string(session, sid) query = ("SELECT class, data FROM %s WHERE identifier = $1;" % (self.table) ...
{'deleted': [{'line_no': 7, 'char_start': 213, 'char_end': 286, 'line': ' query = ("SELECT class, data FROM %s WHERE identifier = \'%s\';" %\n'}, {'line_no': 8, 'char_start': 286, 'char_end': 321, 'line': ' (self.table, sid)\n'}, {'line_no': 10, 'char_start': 340, 'char_end': 373, 'line': ' ...
{'deleted': [{'char_start': 277, 'char_end': 281, 'chars': "'%s'"}, {'char_start': 314, 'char_end': 319, 'chars': ', sid'}, {'char_start': 1338, 'char_end': 1342, 'chars': "'%s'"}, {'char_start': 1354, 'char_end': 1358, 'chars': "'%s'"}, {'char_start': 1398, 'char_end': 1402, 'chars': "'%s'"}, {'char_start': 1406, 'cha...
github.com/cheshire3/cheshire3/commit/d350363b4ea10f102c24c8f26d7b76b006323e8e
cheshire3/sql/resultSetStore.py
cwe-089
382
cwe-079
get
@handler.unsupported_on_local_server @handler.get(handler.HTML) def get(self): """Handle a get request.""" self.render( 'login.html', { 'apiKey': local_config.ProjectConfig().get('firebase.api_key'), 'authDomain': auth.auth_domain(), 'dest': self.request.get('de...
@handler.unsupported_on_local_server @handler.get(handler.HTML) def get(self): """Handle a get request.""" dest = self.request.get('dest') base_handler.check_redirect_url(dest) self.render( 'login.html', { 'apiKey': local_config.ProjectConfig().get('firebase.api_key'), ...
{'deleted': [{'line_no': 9, 'char_start': 280, 'char_end': 326, 'line': " 'dest': self.request.get('dest'),\n"}], 'added': [{'line_no': 5, 'char_start': 117, 'char_end': 153, 'line': " dest = self.request.get('dest')\n"}, {'line_no': 6, 'char_start': 153, 'char_end': 195, 'line': ' base_handler.check_r...
{'deleted': [{'char_start': 300, 'char_end': 318, 'chars': "self.request.get('"}, {'char_start': 322, 'char_end': 324, 'chars': "')"}], 'added': [{'char_start': 121, 'char_end': 200, 'chars': "dest = self.request.get('dest')\n base_handler.check_redirect_url(dest)\n\n "}]}
github.com/google/clusterfuzz/commit/3d66c1146550eecd4e34d47332a8616b435a21fe
src/appengine/handlers/login.py
cwe-079
74
cwe-078
extend_volume
def extend_volume(self, volume, new_size): volume_name = self._get_3par_vol_name(volume['id']) old_size = volume.size growth_size = int(new_size) - old_size LOG.debug("Extending Volume %s from %s to %s, by %s GB." % (volume_name, old_size, new_size, growth_size)) ...
def extend_volume(self, volume, new_size): volume_name = self._get_3par_vol_name(volume['id']) old_size = volume.size growth_size = int(new_size) - old_size LOG.debug("Extending Volume %s from %s to %s, by %s GB." % (volume_name, old_size, new_size, growth_size)) ...
{'deleted': [{'line_no': 8, 'char_start': 331, 'char_end': 406, 'line': ' self._cli_run("growvv -f %s %sg" % (volume_name, growth_size),\n'}, {'line_no': 9, 'char_start': 406, 'char_end': 438, 'line': ' None)\n'}], 'added': [{'line_no': 8, 'char_start': 331, 'char_end': 409, 'line': ...
{'deleted': [{'char_start': 357, 'char_end': 358, 'chars': '"'}, {'char_start': 367, 'char_end': 375, 'chars': ' %s %sg"'}, {'char_start': 376, 'char_end': 379, 'chars': '% ('}, {'char_start': 403, 'char_end': 436, 'chars': '),\n None'}], 'added': [{'char_start': 357, 'char_end': 359, 'chars': ...
github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f
cinder/volume/drivers/san/hp/hp_3par_common.py
cwe-078
139
cwe-476
rfcomm_sock_bind
static int rfcomm_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len) { struct sockaddr_rc *sa = (struct sockaddr_rc *) addr; struct sock *sk = sock->sk; int chan = sa->rc_channel; int err = 0; BT_DBG("sk %p %pMR", sk, &sa->rc_bdaddr); if (!addr || addr->sa_family != AF_BLUETOOTH) return -EINV...
static int rfcomm_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len) { struct sockaddr_rc sa; struct sock *sk = sock->sk; int len, err = 0; if (!addr || addr->sa_family != AF_BLUETOOTH) return -EINVAL; memset(&sa, 0, sizeof(sa)); len = min_t(unsigned int, sizeof(sa), addr_len); memcpy(&sa, a...
{'deleted': [{'line_no': 3, 'char_start': 88, 'char_end': 143, 'line': '\tstruct sockaddr_rc *sa = (struct sockaddr_rc *) addr;\n'}, {'line_no': 5, 'char_start': 172, 'char_end': 200, 'line': '\tint chan = sa->rc_channel;\n'}, {'line_no': 6, 'char_start': 200, 'char_end': 214, 'line': '\tint err = 0;\n'}, {'line_no': 7...
{'deleted': [{'char_start': 108, 'char_end': 109, 'chars': '*'}, {'char_start': 111, 'char_end': 141, 'chars': ' = (struct sockaddr_rc *) addr'}, {'char_start': 177, 'char_end': 197, 'chars': 'chan = sa->rc_channe'}, {'char_start': 198, 'char_end': 202, 'chars': ';\n\ti'}, {'char_start': 203, 'char_end': 204, 'chars': ...
github.com/torvalds/linux/commit/951b6a0717db97ce420547222647bcc40bf1eacd
net/bluetooth/rfcomm/sock.c
cwe-476
262
cwe-078
poll
def poll(self, poll_input): username = poll_input.credentials.username password = poll_input.credentials.password domain = poll_input.credentials.domain if domain is None: opt_str = '--ignore-certificate --authonly -u {} -p {} {}:{}' options = opt_str...
def poll(self, poll_input): username = poll_input.credentials.username password = poll_input.credentials.password domain = poll_input.credentials.domain if domain is None: opt_str = '--ignore-certificate --authonly -u \'{}\' -p \'{}\' {}:{}' options =...
{'deleted': [{'line_no': 7, 'char_start': 217, 'char_end': 291, 'line': " opt_str = '--ignore-certificate --authonly -u {} -p {} {}:{}'\n"}, {'line_no': 12, 'char_start': 439, 'char_end': 519, 'line': " opt_str = '--ignore-certificate --authonly -d {} -u {} -p {} {}:{}'\n"}], 'added': [{'line_no':...
{'deleted': [], 'added': [{'char_start': 275, 'char_end': 277, 'chars': "\\'"}, {'char_start': 279, 'char_end': 281, 'chars': "\\'"}, {'char_start': 285, 'char_end': 287, 'chars': "\\'"}, {'char_start': 289, 'char_end': 291, 'chars': "\\'"}, {'char_start': 511, 'char_end': 513, 'chars': "\\'"}, {'char_start': 515, 'cha...
github.com/DSU-DefSecClub/ScoringEngine/commit/010eefe1ad416c0bdaa16fd59eca0dc8e3086a13
polling/poll_rdp.py
cwe-078
265
cwe-787
gps_tracker
void gps_tracker( void ) { ssize_t unused; int gpsd_sock; char line[256], *temp; struct sockaddr_in gpsd_addr; int ret, is_json, pos; fd_set read_fd; struct timeval timeout; /* attempt to connect to localhost, port 2947 */ pos = 0; gpsd_sock = socket( AF_INET, SOCK_STREAM, 0 ); ...
void gps_tracker( void ) { ssize_t unused; int gpsd_sock; char line[256], *temp; struct sockaddr_in gpsd_addr; int ret, is_json, pos; fd_set read_fd; struct timeval timeout; /* attempt to connect to localhost, port 2947 */ pos = 0; gpsd_sock = socket( AF_INET, SOCK_STREAM, 0 ); ...
{'deleted': [{'line_no': 89, 'char_start': 2379, 'char_end': 2452, 'line': ' \tif( recv( gpsd_sock, line + pos, sizeof( line ) - 1, 0 ) <= 0 )\n'}], 'added': [{'line_no': 89, 'char_start': 2379, 'char_end': 2458, 'line': ' \tif( recv( gpsd_sock, line + pos, sizeof( line ) - pos - 1, 0 ) <= 0 )\n'}]}
{'deleted': [], 'added': [{'char_start': 2438, 'char_end': 2444, 'chars': 'pos - '}]}
github.com/aircrack-ng/aircrack-ng/commit/ff70494dd389ba570dbdbf36f217c28d4381c6b5/
src/airodump-ng.c
cwe-787
1,755
cwe-089
add_post
def add_post(content): """Add a post to the 'database' with the current timestamp.""" db = psycopg2.connect(database=DBNAME) c = db.cursor() c.execute("insert into posts values('%s')" % content) db.commit() db.close()
def add_post(content): """Add a post to the 'database' with the current timestamp.""" db = psycopg2.connect(database=DBNAME) c = db.cursor() c.execute("insert into posts values(%s)",(content,)) db.commit() db.close()
{'deleted': [{'line_no': 5, 'char_start': 147, 'char_end': 203, 'line': ' c.execute("insert into posts values(\'%s\')" % content)\n'}], 'added': [{'line_no': 5, 'char_start': 147, 'char_end': 202, 'line': ' c.execute("insert into posts values(%s)",(content,))\n'}]}
{'deleted': [{'char_start': 185, 'char_end': 186, 'chars': "'"}, {'char_start': 188, 'char_end': 189, 'chars': "'"}, {'char_start': 191, 'char_end': 194, 'chars': ' % '}], 'added': [{'char_start': 189, 'char_end': 191, 'chars': ',('}, {'char_start': 198, 'char_end': 200, 'chars': ',)'}]}
github.com/tfalbo/SuzyMakeup/commit/1a5d6ccf02bec303d454f87a6bb39baed30c205f
vagrant/forum/forumdb.py
cwe-089
58
cwe-089
add_input
def add_input(self, data): connection = self.connect() try: # The following introduces a deliberate security flaw - SQL Injection query = "INSERT INTO crimes (description) VALUES ('{}');".format(data) with connection.cursor() as cursor: cursor.exec...
def add_input(self, data): connection = self.connect() try: # The following introduces a deliberate security flaw - SQL Injection query = "INSERT INTO crimes (description) VALUES (%s);" with connection.cursor() as cursor: cursor.execute(query, data...
{'deleted': [{'line_no': 5, 'char_start': 162, 'char_end': 245, 'line': ' query = "INSERT INTO crimes (description) VALUES (\'{}\');".format(data)\n'}, {'line_no': 7, 'char_start': 293, 'char_end': 331, 'line': ' cursor.execute(query)\n'}], 'added': [{'line_no': 5, 'char_start': 162, 'char_end...
{'deleted': [{'char_start': 224, 'char_end': 228, 'chars': "'{}'"}, {'char_start': 231, 'char_end': 244, 'chars': '.format(data)'}], 'added': [{'char_start': 224, 'char_end': 226, 'chars': '%s'}, {'char_start': 314, 'char_end': 320, 'chars': ', data'}]}
github.com/rwolf527/crimemap/commit/50b0695e0b4c46165e6146f6fac4cd6871d9fdf6
dbhelper.py
cwe-089
72
cwe-089
shame_ask
def shame_ask(name): db = db_connect() cursor = db.cursor() try: cursor.execute(''' SELECT shame FROM people WHERE name='{}' '''.format(name)) shame = cursor.fetchone() db.close() if shame is None: logger.debug('No shame found for name {}'....
def shame_ask(name): db = db_connect() cursor = db.cursor() try: cursor.execute(''' SELECT shame FROM people WHERE name=%(name)s ''', (name, )) shame = cursor.fetchone() db.close() if shame is None: logger.debug('No shame found for name {}'...
{'deleted': [{'line_no': 6, 'char_start': 104, 'char_end': 157, 'line': " SELECT shame FROM people WHERE name='{}'\n"}, {'line_no': 7, 'char_start': 157, 'char_end': 187, 'line': " '''.format(name))\n"}], 'added': [{'line_no': 6, 'char_start': 104, 'char_end': 161, 'line': ' SELECT sham...
{'deleted': [{'char_start': 152, 'char_end': 156, 'chars': "'{}'"}, {'char_start': 172, 'char_end': 179, 'chars': '.format'}], 'added': [{'char_start': 152, 'char_end': 160, 'chars': '%(name)s'}, {'char_start': 176, 'char_end': 178, 'chars': ', '}, {'char_start': 183, 'char_end': 185, 'chars': ', '}]}
github.com/tylarb/KarmaBoi-PCF/commit/c1d00a27d7f6b7eb6f15a3dacd4269654a32c10a
KarmaBoi/dbopts.py
cwe-089
127
cwe-125
sctp_sf_ootb
sctp_disposition_t sctp_sf_ootb(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { struct sctp_chunk *chunk = arg; struct sk_buff *skb = chunk->skb; sctp_chunkhdr_t *ch; sctp_errhdr_t *err; __u8...
sctp_disposition_t sctp_sf_ootb(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { struct sctp_chunk *chunk = arg; struct sk_buff *skb = chunk->skb; sctp_chunkhdr_t *ch; sctp_errhdr_t *err; __u8...
{'deleted': [{'line_no': 56, 'char_start': 1500, 'char_end': 1548, 'line': '\t\t/* Report violation if chunk len overflows */\n'}, {'line_no': 57, 'char_start': 1548, 'char_end': 1604, 'line': '\t\tch_end = ((__u8 *)ch) + SCTP_PAD4(ntohs(ch->length));\n'}, {'line_no': 58, 'char_start': 1604, 'char_end': 1642, 'line': '...
{'deleted': [{'char_start': 1498, 'char_end': 1723, 'chars': '\n\n\t\t/* Report violation if chunk len overflows */\n\t\tch_end = ((__u8 *)ch) + SCTP_PAD4(ntohs(ch->length));\n\t\tif (ch_end > skb_tail_pointer(skb))\n\t\t\treturn sctp_sf_violation_chunklen(net, ep, asoc, type, arg,\n\t\t\t\t\t\t commands);'}], 'added'...
github.com/torvalds/linux/commit/bf911e985d6bbaa328c20c3e05f4eb03de11fdd6
net/sctp/sm_statefuns.c
cwe-125
670
cwe-078
repack
def repack(host, targets, channel='stable'): url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' req = requests.get(url) req.raise_for_status() manifest = toml.loads(req.content) if manifest['manifest-version'] != '2': print('ERROR: unrecognized manifest version %s.' % manifest['ma...
def repack(host, targets, channel='stable'): print("Repacking rust for %s..." % host) url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' req = requests.get(url) req.raise_for_status() manifest = toml.loads(req.content) if manifest['manifest-version'] != '2': print('ERROR: unreco...
{'deleted': [{'line_no': 28, 'char_start': 1161, 'char_end': 1200, 'line': " os.system('rm -rf %s' % install_dir)\n"}, {'line_no': 34, 'char_start': 1424, 'char_end': 1493, 'line': " os.system('tar cjf %s.tar.bz2 %s/*' % (tar_basename, install_dir))\n"}, {'line_no': 35, 'char_start': 1493, 'char_end': 1531, 'line': "...
{'deleted': [{'char_start': 1166, 'char_end': 1170, 'chars': 'syst'}, {'char_start': 1171, 'char_end': 1172, 'chars': 'm'}, {'char_start': 1180, 'char_end': 1183, 'chars': ' %s'}, {'char_start': 1184, 'char_end': 1186, 'chars': ' %'}, {'char_start': 1426, 'char_end': 1427, 'chars': 'o'}, {'char_start': 1428, 'char_end'...
github.com/rillian/rust-build/commit/b8af51e5811fcb35eff9e1e3e91c98490e7a7dcb
repack_rust.py
cwe-078
443
cwe-079
commentcounts
@register.tag @basictag(takes_context=True) def commentcounts(context, filediff, interfilediff=None): """ Returns a JSON array of current comments for a filediff, sorted by line number. Each entry in the array has a dictionary containing the following keys: =========== ==========================...
@register.tag @basictag(takes_context=True) def commentcounts(context, filediff, interfilediff=None): """ Returns a JSON array of current comments for a filediff, sorted by line number. Each entry in the array has a dictionary containing the following keys: =========== ==========================...
{'deleted': [{'line_no': 41, 'char_start': 1548, 'char_end': 1586, 'line': " 'text': comment.text,\n"}], 'added': [{'line_no': 41, 'char_start': 1548, 'char_end': 1594, 'line': " 'text': escape(comment.text),\n"}]}
{'deleted': [], 'added': [{'char_start': 1572, 'char_end': 1579, 'chars': 'escape('}, {'char_start': 1591, 'char_end': 1592, 'chars': ')'}]}
github.com/reviewboard/reviewboard/commit/7a0a9d94555502278534dedcf2d75e9fccce8c3d
reviewboard/reviews/templatetags/reviewtags.py
cwe-079
469
cwe-089
summary
@app.route('/summary', methods=['GET']) def summary(): if 'username' in session: conn = mysql.connect() cursor = conn.cursor() #select the maximum score from the results table cursor.execute("SELECT courseConcentration FROM results WHERE total = (SELECT MAX(total) FROM (SELECT * FROM results WHERE courseId >...
@app.route('/summary', methods=['GET']) def summary(): if 'username' in session: conn = mysql.connect() cursor = conn.cursor() #select the maximum score from the results table cursor.execute("SELECT courseConcentration FROM results WHERE total = (SELECT MAX(total) FROM (SELECT * FROM results WHERE courseId >...
{'deleted': [{'line_no': 9, 'char_start': 185, 'char_end': 397, 'line': '\t\tcursor.execute("SELECT courseConcentration FROM results WHERE total = (SELECT MAX(total) FROM (SELECT * FROM results WHERE courseId > 4) Temp) and courseId > 4 and emailAccount=\'" + session[\'username\'] + "\'");\n'}], 'added': [{'line_no': 9...
{'deleted': [{'char_start': 364, 'char_end': 365, 'chars': "'"}, {'char_start': 367, 'char_end': 369, 'chars': '+ '}, {'char_start': 388, 'char_end': 394, 'chars': ' + "\'"'}], 'added': [{'char_start': 364, 'char_end': 366, 'chars': '%s'}, {'char_start': 367, 'char_end': 368, 'chars': ','}, {'char_start': 369, 'char_en...
github.com/CaitlinKennedy/Tech-Track/commit/20ef2d4010f9497b8221524edd0c706e2c6a4147
src/tech_track.py
cwe-089
125
cwe-125
concat_hash_string
static u_int16_t concat_hash_string(struct ndpi_packet_struct *packet, char *buf, u_int8_t client_hash) { u_int16_t offset = 22, buf_out_len = 0; if(offset+sizeof(u_int32_t) >= packet->payload_packet_len) goto invalid_payload; u_int32_t len = ntohl(*(u_int32_t*)&packet->payload[offset]); offset += 4;...
static u_int16_t concat_hash_string(struct ndpi_packet_struct *packet, char *buf, u_int8_t client_hash) { u_int16_t offset = 22, buf_out_len = 0; if(offset+sizeof(u_int32_t) >= packet->payload_packet_len) goto invalid_payload; u_int32_t len = ntohl(*(u_int32_t*)&packet->payload[offset]); offset += 4;...
{'deleted': [], 'added': [{'line_no': 18, 'char_start': 615, 'char_end': 676, 'line': ' if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)\n'}, {'line_no': 19, 'char_start': 676, 'char_end': 702, 'line': ' goto invalid_payload;\n'}, {'line_no': 24, 'char_start': 824, 'char_end': 885, 'line': ' if(offset+si...
{'deleted': [], 'added': [{'char_start': 617, 'char_end': 704, 'chars': 'if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)\n goto invalid_payload;\n '}, {'char_start': 823, 'char_end': 910, 'chars': '\n if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)\n goto invalid_payload;'}, {'char_start':...
github.com/ntop/nDPI/commit/3bbb0cd3296023f6f922c71d21a1c374d2b0a435
src/lib/protocols/ssh.c
cwe-125
1,049
cwe-089
reportMatch
def reportMatch(winner, loser): """Records the outcome of a single match between two players. Args: winner: the id number of the player who won loser: the id number of the player who lost """ try: int(winner) int(loser) except ValueError: raise ValueError( ...
def reportMatch(winner, loser): """Records the outcome of a single match between two players. Args: winner: the id number of the player who won loser: the id number of the player who lost """ try: int(winner) int(loser) except ValueError: raise ValueError( ...
{'deleted': [{'line_no': 20, 'char_start': 551, 'char_end': 624, 'line': ' statement = "INSERT INTO matches values ({w}, {l})".format(w=w, l=l)\n'}, {'line_no': 21, 'char_start': 624, 'char_end': 649, 'line': ' c.execute(statement)\n'}], 'added': [{'line_no': 20, 'char_start': 551, 'char_end': 611, 'line': ' c...
{'deleted': [{'char_start': 555, 'char_end': 559, 'chars': 'stat'}, {'char_start': 560, 'char_end': 561, 'chars': 'm'}, {'char_start': 562, 'char_end': 563, 'chars': 'n'}, {'char_start': 564, 'char_end': 567, 'chars': ' = '}, {'char_start': 596, 'char_end': 599, 'chars': '{w}'}, {'char_start': 601, 'char_end': 604, 'ch...
github.com/tdnelson2/tournament-db/commit/00f3caeed0e12e806c2808d100908698777d9e98
tournament.py
cwe-089
166
cwe-125
wrap_lines_smart
wrap_lines_smart(ASS_Renderer *render_priv, double max_text_width) { int i; GlyphInfo *cur, *s1, *e1, *s2, *s3; int last_space; int break_type; int exit; double pen_shift_x; double pen_shift_y; int cur_line; int run_offset; TextInfo *text_info = &render_priv->text_info; last...
wrap_lines_smart(ASS_Renderer *render_priv, double max_text_width) { int i; GlyphInfo *cur, *s1, *e1, *s2, *s3; int last_space; int break_type; int exit; double pen_shift_x; double pen_shift_y; int cur_line; int run_offset; TextInfo *text_info = &render_priv->text_info; last...
{'deleted': [{'line_no': 100, 'char_start': 3756, 'char_end': 3819, 'line': ' if (DIFF(l1_new, l2_new) < DIFF(l1, l2)) {\n'}], 'added': [{'line_no': 100, 'char_start': 3756, 'char_end': 3844, 'line': ' if (DIFF(l1_new, l2_new) < DIFF(l1, l2) && w > text_info->glyphs) {\n'}, {'line_...
{'deleted': [], 'added': [{'char_start': 3815, 'char_end': 3840, 'chars': ' && w > text_info->glyphs'}, {'char_start': 3843, 'char_end': 3935, 'chars': '\n if (w->linebreak)\n text_info->n_lines--;'}]}
github.com/libass/libass/commit/b72b283b936a600c730e00875d7d067bded3fc26
libass/ass_render.c
cwe-125
1,486
cwe-476
daemon_AuthUserPwd
daemon_AuthUserPwd(char *username, char *password, char *errbuf) { #ifdef _WIN32 /* * Warning: the user which launches the process must have the * SE_TCB_NAME right. * This corresponds to have the "Act as part of the Operating System" * turned on (administrative tools, local security settings, local * polici...
daemon_AuthUserPwd(char *username, char *password, char *errbuf) { #ifdef _WIN32 /* * Warning: the user which launches the process must have the * SE_TCB_NAME right. * This corresponds to have the "Act as part of the Operating System" * turned on (administrative tools, local security settings, local * polici...
{'deleted': [{'line_no': 98, 'char_start': 3317, 'char_end': 3391, 'line': '\tif (strcmp(user_password, (char *) crypt(password, user_password)) != 0)\n'}], 'added': [{'line_no': 68, 'char_start': 2384, 'char_end': 2407, 'line': '\tchar *crypt_password;\n'}, {'line_no': 99, 'char_start': 3340, 'char_end': 3390, 'line':...
{'deleted': [{'char_start': 3318, 'char_end': 3323, 'chars': 'if (s'}, {'char_start': 3326, 'char_end': 3327, 'chars': 'm'}, {'char_start': 3342, 'char_end': 3343, 'chars': ','}, {'char_start': 3346, 'char_end': 3347, 'chars': 'h'}, {'char_start': 3350, 'char_end': 3351, 'chars': '*'}, {'char_start': 3355, 'char_end': ...
github.com/the-tcpdump-group/libpcap/commit/437b273761adedcbd880f714bfa44afeec186a31
rpcapd/daemon.c
cwe-476
1,050
cwe-078
_cli_run
def _cli_run(self, verb, cli_args): """Runs a CLI command over SSH, without doing any result parsing.""" cli_arg_strings = [] if cli_args: for k, v in cli_args.items(): if k == '': cli_arg_strings.append(" %s" % k) else: ...
def _cli_run(self, cmd): """Runs a CLI command over SSH, without doing any result parsing.""" LOG.debug("SSH CMD = %s " % cmd) (stdout, stderr) = self._run_ssh(cmd, False) # we have to strip out the input and exit lines tmp = stdout.split("\r\n") out = tmp[5:len(tmp...
{'deleted': [{'line_no': 1, 'char_start': 0, 'char_end': 40, 'line': ' def _cli_run(self, verb, cli_args):\n'}, {'line_no': 3, 'char_start': 117, 'char_end': 146, 'line': ' cli_arg_strings = []\n'}, {'line_no': 4, 'char_start': 146, 'char_end': 167, 'line': ' if cli_args:\n'}, {'line_no': 5, 'char_star...
{'deleted': [{'char_start': 23, 'char_end': 29, 'chars': 'verb, '}, {'char_start': 30, 'char_end': 37, 'chars': 'li_args'}, {'char_start': 116, 'char_end': 421, 'chars': '\n cli_arg_strings = []\n if cli_args:\n for k, v in cli_args.items():\n if k == \'\':\n c...
github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f
cinder/volume/drivers/san/hp/hp_3par_common.py
cwe-078
162
cwe-125
string_scan_range
static int string_scan_range(RList *list, const ut8 *buf, 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 (!buf...
static int string_scan_range(RList *list, const ut8 *buf, 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 (!buf...
{'deleted': [{'line_no': 123, 'char_start': 2779, 'char_end': 2786, 'line': '\t\t\t\t\t{\n'}, {'line_no': 124, 'char_start': 2786, 'char_end': 2829, 'line': '\t\t\t\t\t\tconst ut8 *p = buf + str_start - 2;\n'}, {'line_no': 131, 'char_start': 2964, 'char_end': 2971, 'line': '\t\t\t\t\t{\n'}, {'line_no': 132, 'char_star...
{'deleted': [{'char_start': 2810, 'char_end': 2811, 'chars': ' '}, {'char_start': 2995, 'char_end': 2996, 'chars': ' '}], 'added': [{'char_start': 2784, 'char_end': 2803, 'chars': 'if (str_start > 1) '}, {'char_start': 2987, 'char_end': 3006, 'chars': 'if (str_start > 3) '}]}
github.com/radare/radare2/commit/d31c4d3cbdbe01ea3ded16a584de94149ecd31d9
libr/bin/bin.c
cwe-125
1,243
cwe-787
blosc_c
static int blosc_c(struct thread_context* thread_context, int32_t bsize, int32_t leftoverblock, int32_t ntbytes, int32_t maxbytes, const uint8_t* src, const int32_t offset, uint8_t* dest, uint8_t* tmp, uint8_t* tmp2) { blosc2_context* context = thread_context->...
static int blosc_c(struct thread_context* thread_context, int32_t bsize, int32_t leftoverblock, int32_t ntbytes, int32_t destsize, const uint8_t* src, const int32_t offset, uint8_t* dest, uint8_t* tmp, uint8_t* tmp2) { blosc2_context* context = thread_context->...
{'deleted': [{'line_no': 2, 'char_start': 73, 'char_end': 150, 'line': ' int32_t leftoverblock, int32_t ntbytes, int32_t maxbytes,\n'}, {'line_no': 78, 'char_start': 2729, 'char_end': 2768, 'line': ' if (ntbytes + maxout > maxbytes) {\n'}, {'line_no': 80, 'char_start': 2803, 'char_end': 2856, 'line...
{'deleted': [{'char_start': 140, 'char_end': 146, 'chars': 'maxbyt'}, {'char_start': 2756, 'char_end': 2762, 'chars': 'maxbyt'}, {'char_start': 2827, 'char_end': 2833, 'chars': 'maxbyt'}, {'char_start': 5856, 'char_end': 5862, 'chars': 'maxbyt'}], 'added': [{'char_start': 140, 'char_end': 143, 'chars': 'des'}, {'char_s...
github.com/Blosc/c-blosc2/commit/c4c6470e88210afc95262c8b9fcc27e30ca043ee
blosc/blosc2.c
cwe-787
1,796
cwe-416
mark_context_stack
mark_context_stack(mrb_state *mrb, struct mrb_context *c) { size_t i; size_t e; if (c->stack == NULL) return; e = c->stack - c->stbase; if (c->ci) e += c->ci->nregs; if (c->stbase + e > c->stend) e = c->stend - c->stbase; for (i=0; i<e; i++) { mrb_value v = c->stbase[i]; if (!mrb_immediate_p(v))...
mark_context_stack(mrb_state *mrb, struct mrb_context *c) { size_t i; size_t e; mrb_value nil; if (c->stack == NULL) return; e = c->stack - c->stbase; if (c->ci) e += c->ci->nregs; if (c->stbase + e > c->stend) e = c->stend - c->stbase; for (i=0; i<e; i++) { mrb_value v = c->stbase[i]; if (!mr...
{'deleted': [{'line_no': 14, 'char_start': 323, 'char_end': 372, 'line': ' if (mrb_basic_ptr(v)->tt == MRB_TT_FREE) {\n'}, {'line_no': 15, 'char_start': 372, 'char_end': 412, 'line': ' c->stbase[i] = mrb_nil_value();\n'}, {'line_no': 16, 'char_start': 412, 'char_end': 420, 'line': ' }\n'}, {'line_no': ...
{'deleted': [{'char_start': 329, 'char_end': 331, 'chars': 'if'}, {'char_start': 332, 'char_end': 333, 'chars': '('}, {'char_start': 349, 'char_end': 353, 'chars': '->tt'}, {'char_start': 354, 'char_end': 356, 'chars': '=='}, {'char_start': 357, 'char_end': 369, 'chars': 'MRB_TT_FREE)'}, {'char_start': 370, 'char_end':...
github.com/mruby/mruby/commit/5c114c91d4ff31859fcd84cf8bf349b737b90d99
src/gc.c
cwe-416
183
cwe-089
tid_to_tid_num
def tid_to_tid_num(self, tid): ''' Returns tid_num, given tid. ''' q = "SELECT rowid FROM tids WHERE tid = '" + tid + "'" self.query(q) return self.c.fetchone()[0]
def tid_to_tid_num(self, tid): ''' Returns tid_num, given tid. ''' q = "SELECT rowid FROM tids WHERE tid = ?" self.query(q, tid) return self.c.fetchone()[0]
{'deleted': [{'line_no': 4, 'char_start': 80, 'char_end': 143, 'line': ' q = "SELECT rowid FROM tids WHERE tid = \'" + tid + "\'"\n'}, {'line_no': 5, 'char_start': 143, 'char_end': 165, 'line': ' self.query(q)\n'}], 'added': [{'line_no': 4, 'char_start': 80, 'char_end': 131, 'line': ' q = "SELECT r...
{'deleted': [{'char_start': 128, 'char_end': 141, 'chars': '\'" + tid + "\''}], 'added': [{'char_start': 128, 'char_end': 129, 'chars': '?'}, {'char_start': 151, 'char_end': 156, 'chars': ', tid'}]}
github.com/pukkapies/urop2019/commit/3ca2e2c291d2d5fe262d20a8e0520bdfb622432b
modules/query_lastfm.py
cwe-089
52
cwe-476
parse_class
static void parse_class(RBinFile *binfile, RBinDexObj *bin, RBinDexClass *c, int class_index, int *methods, int *sym_count) { struct r_bin_t *rbin = binfile->rbin; char *class_name; int z; const ut8 *p, *p_end; if (!c) { return; } class_name = dex_class_name (bin, c); class_name = r_str_replace (class_...
static void parse_class(RBinFile *binfile, RBinDexObj *bin, RBinDexClass *c, int class_index, int *methods, int *sym_count) { struct r_bin_t *rbin = binfile->rbin; char *class_name; int z; const ut8 *p, *p_end; if (!c) { return; } class_name = dex_class_name (bin, c); class_name = r_str_replace (class_...
{'deleted': [{'line_no': 54, 'char_start': 1421, 'char_end': 1461, 'line': '\t\tint types_list_size = r_read_le32(p);\n'}], 'added': [{'line_no': 54, 'char_start': 1421, 'char_end': 1462, 'line': '\t\tint types_list_size = r_read_le32 (p);\n'}]}
{'deleted': [], 'added': [{'char_start': 1456, 'char_end': 1457, 'chars': ' '}]}
github.com/radare/radare2/commit/1ea23bd6040441a21fbcfba69dce9a01af03f989
libr/bin/p/bin_dex.c
cwe-476
1,339