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-125
php_wddx_push_element
*/ static void php_wddx_push_element(void *user_data, const XML_Char *name, const XML_Char **atts) { st_entry ent; wddx_stack *stack = (wddx_stack *)user_data; if (!strcmp(name, EL_PACKET)) { int i; if (atts) for (i=0; atts[i]; i++) { if (!strcmp(atts[i], EL_VERSION)) { /* nothing for now */ } } ...
*/ static void php_wddx_push_element(void *user_data, const XML_Char *name, const XML_Char **atts) { st_entry ent; wddx_stack *stack = (wddx_stack *)user_data; if (!strcmp(name, EL_PACKET)) { int i; if (atts) for (i=0; atts[i]; i++) { if (!strcmp(atts[i], EL_VERSION)) { /* nothing for now */ } } ...
{'deleted': [], 'added': [{'line_no': 71, 'char_start': 1972, 'char_end': 1983, 'line': '\t\t} else {\n'}, {'line_no': 72, 'char_start': 1983, 'char_end': 2009, 'line': '\t\t\tent.type = ST_BOOLEAN;\n'}, {'line_no': 73, 'char_start': 2009, 'char_end': 2031, 'line': '\t\t\tSET_STACK_VARNAME;\n'}, {'line_no': 74, 'char_s...
{'deleted': [], 'added': [{'char_start': 1975, 'char_end': 2125, 'chars': ' else {\n\t\t\tent.type = ST_BOOLEAN;\n\t\t\tSET_STACK_VARNAME;\n\t\t\tZVAL_FALSE(&ent.data);\n\t\t\twddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));\n\t\t}'}]}
github.com/php/php-src/commit/66fd44209d5ffcb9b3d1bc1b9fd8e35b485040c0
ext/wddx/wddx.c
cwe-125
1,595
cwe-022
_inject_admin_password_into_fs
def _inject_admin_password_into_fs(admin_passwd, fs, execute=None): """Set the root password to admin_passwd admin_password is a root password fs is the path to the base of the filesystem into which to inject the key. This method modifies the instance filesystem directly, and does not require ...
def _inject_admin_password_into_fs(admin_passwd, fs, execute=None): """Set the root password to admin_passwd admin_password is a root password fs is the path to the base of the filesystem into which to inject the key. This method modifies the instance filesystem directly, and does not require ...
{'deleted': [{'line_no': 23, 'char_start': 689, 'char_end': 760, 'line': " utils.execute('cp', os.path.join(fs, 'etc', 'passwd'), tmp_passwd,\n"}, {'line_no': 24, 'char_start': 760, 'char_end': 796, 'line': ' run_as_root=True)\n'}, {'line_no': 25, 'char_start': 796, 'char_end': 867, 'line': " uti...
{'deleted': [{'char_start': 693, 'char_end': 694, 'chars': 'u'}, {'char_start': 696, 'char_end': 701, 'chars': 'ls.ex'}, {'char_start': 703, 'char_end': 704, 'chars': 'u'}, {'char_start': 705, 'char_end': 706, 'chars': 'e'}, {'char_start': 711, 'char_end': 712, 'chars': ','}, {'char_start': 714, 'char_end': 716, 'chars...
github.com/openstack/nova/commit/2427d4a99bed35baefd8f17ba422cb7aae8dcca7
nova/virt/disk/api.py
cwe-022
287
cwe-078
test_create_modify_host
def test_create_modify_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_modify_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': 504, 'char_end': 557, 'line': " show_host_cmd = 'showhost -verbose fakehost'\n"}, {'line_no': 16, 'char_start': 635, 'char_end': 690, 'line': " create_host_cmd = ('createhost -add fakehost '\n"}, {'line_no': 17, 'char_start': 690, 'char_end': 752, 'line': " ...
{'deleted': [{'char_start': 661, 'char_end': 662, 'chars': '('}, {'char_start': 728, 'char_end': 744, 'chars': '12345 1234567890'}, {'char_start': 750, 'char_end': 751, 'chars': ')'}], 'added': [{'char_start': 528, 'char_end': 529, 'chars': '['}, {'char_start': 538, 'char_end': 540, 'chars': "',"}, {'char_start': 541, ...
github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f
cinder/tests/test_hp3par.py
cwe-078
296
cwe-476
store_versioninfo_gnu_verdef
static Sdb *store_versioninfo_gnu_verdef(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { const char *section_name = ""; const char *link_section_name = ""; char *end = NULL; Elf_(Shdr) *link_shdr = NULL; ut8 dfs[sizeof (Elf_(Verdef))] = {0}; Sdb *sdb; int cnt, i; if (shdr->sh_link > bin->ehdr.e_shnum) { return false...
static Sdb *store_versioninfo_gnu_verdef(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { const char *section_name = ""; const char *link_section_name = ""; char *end = NULL; Elf_(Shdr) *link_shdr = NULL; ut8 dfs[sizeof (Elf_(Verdef))] = {0}; Sdb *sdb; int cnt, i; if (shdr->sh_link > bin->ehdr.e_shnum) { return false...
{'deleted': [{'line_no': 39, 'char_start': 1241, 'char_end': 1331, 'line': '\tfor (cnt = 0, i = 0; i >= 0 && cnt < shdr->sh_info && ((char *)defs + i < end); ++cnt) {\n'}, {'line_no': 57, 'char_start': 1885, 'char_end': 1904, 'line': '\t\tif (vdaux < 1) {\n'}, {'line_no': 62, 'char_start': 1972, 'char_end': 2035, 'line...
{'deleted': [{'char_start': 1310, 'char_end': 1311, 'chars': '+'}, {'char_start': 1313, 'char_end': 1319, 'chars': ' < end'}, {'char_start': 2001, 'char_end': 2002, 'chars': '+'}, {'char_start': 2025, 'char_end': 2031, 'chars': ' > end'}, {'char_start': 2812, 'char_end': 2813, 'chars': '+'}, {'char_start': 2835, 'char_...
github.com/radare/radare2/commit/62e39f34b2705131a2d08aff0c2e542c6a52cf0e
libr/bin/format/elf/elf.c
cwe-476
1,452
cwe-078
get_lines
def get_lines(command: str) -> List[str]: """ Run a command and return lines of output :param str command: the command to run :returns: list of whitespace-stripped lines output by command """ stdout = get_output(command) return [line.strip().decode() for line in stdout.splitlines()]
def get_lines(command: List[str]) -> List[str]: """ Run a command and return lines of output :param str command: the command to run :returns: list of whitespace-stripped lines output by command """ stdout = get_output(command) return [line.strip() for line in stdout.splitlines()]
{'deleted': [{'line_no': 1, 'char_start': 0, 'char_end': 42, 'line': 'def get_lines(command: str) -> List[str]:\n'}, {'line_no': 9, 'char_start': 246, 'char_end': 312, 'line': ' return [line.strip().decode() for line in stdout.splitlines()]\n'}], 'added': [{'line_no': 1, 'char_start': 0, 'char_end': 48, 'line': 'def...
{'deleted': [{'char_start': 268, 'char_end': 277, 'chars': '().decode'}], 'added': [{'char_start': 23, 'char_end': 28, 'chars': 'List['}, {'char_start': 31, 'char_end': 32, 'chars': ']'}]}
github.com/timothycrosley/isort/commit/1ab38f4f7840a3c19bf961a24630a992a8373a76
isort/hooks.py
cwe-078
73
cwe-079
get_context_data
def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['comments'] = self.object.comment_set.all().order_by('-time') context['form'] = self.get_form() context['md'] = markdown(self.object.content, extensions=[ ...
def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['comments'] = self.object.comment_set.all().order_by('-time') context['form'] = self.get_form() context['md'] = safe_md(self.object.content) return context
{'deleted': [{'line_no': 5, 'char_start': 215, 'char_end': 269, 'line': " context['md'] = markdown(self.object.content,\n"}, {'line_no': 6, 'char_start': 269, 'char_end': 315, 'line': ' extensions=[\n'}, {'line_no': 7, 'char_start': 315, 'char_end': 381, 'line': " ...
{'deleted': [{'char_start': 239, 'char_end': 240, 'chars': 'm'}, {'char_start': 241, 'char_end': 243, 'chars': 'rk'}, {'char_start': 244, 'char_end': 247, 'chars': 'own'}, {'char_start': 267, 'char_end': 550, 'chars': ",\n extensions=[\n 'markdown.exte...
github.com/Cheng-mq1216/production-practice/commit/333dc34f5feada55d1f6ff1255949ca00dec0f9c
app/Index/views.py
cwe-079
88
cwe-125
hid_input_field
static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt) { unsigned n; unsigned count = field->report_count; unsigned offset = field->report_offset; unsigned size = field->report_size; __s32 min = field->logical_minimum; __s32 max = field->logical_maximum; __...
static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt) { unsigned n; unsigned count = field->report_count; unsigned offset = field->report_offset; unsigned size = field->report_size; __s32 min = field->logical_minimum; __s32 max = field->logical_maximum; __...
{'deleted': [], 'added': [{'line_no': 26, 'char_start': 740, 'char_end': 782, 'line': '\t\t value[n] - min < field->maxusage &&\n'}, {'line_no': 39, 'char_start': 1088, 'char_end': 1134, 'line': '\t\t\t&& field->value[n] - min < field->maxusage\n'}, {'line_no': 45, 'char_start': 1354, 'char_end': 1393, 'line': '\t\t...
{'deleted': [{'char_start': 803, 'char_end': 803, 'chars': ''}, {'char_start': 1225, 'char_end': 1225, 'chars': ''}], 'added': [{'char_start': 746, 'char_end': 788, 'chars': 'value[n] - min < field->maxusage &&\n\t\t '}, {'char_start': 1088, 'char_end': 1134, 'chars': '\t\t\t&& field->value[n] - min < field->maxusag...
github.com/torvalds/linux/commit/50220dead1650609206efe91f0cc116132d59b3f
drivers/hid/hid-core.c
cwe-125
460
cwe-089
add_input
def add_input(self,data): connection = self.connect() try: query = "INSERT INTO crimes (description) VALUES ('{}');".format(data) with connection.cursor() as cursor: cursor.execute(query) connection.commit() finally: connec...
def add_input(self,data): connection = self.connect() try: query = "INSERT INTO crimes (description) VALUES (%s);" with connection.cursor() as cursor: cursor.execute(query,data) connection.commit() finally: connection.close...
{'deleted': [{'line_no': 5, 'char_start': 80, 'char_end': 163, 'line': ' query = "INSERT INTO crimes (description) VALUES (\'{}\');".format(data)\n'}, {'line_no': 7, 'char_start': 211, 'char_end': 249, 'line': ' cursor.execute(query)\n'}], 'added': [{'line_no': 5, 'char_start': 80, 'char_end':...
{'deleted': [{'char_start': 142, 'char_end': 146, 'chars': "'{}'"}, {'char_start': 149, 'char_end': 162, 'chars': '.format(data)'}], 'added': [{'char_start': 142, 'char_end': 144, 'chars': '%s'}, {'char_start': 232, 'char_end': 237, 'chars': ',data'}]}
github.com/sgnab/crime-map-app/commit/209b23bad13594c9cdf18d8788fcba7c8f68d37b
dbhelper.py
cwe-089
58
cwe-190
choose_volume
choose_volume(struct archive_read *a, struct iso9660 *iso9660) { struct file_info *file; int64_t skipsize; struct vd *vd; const void *block; char seenJoliet; vd = &(iso9660->primary); if (!iso9660->opt_support_joliet) iso9660->seenJoliet = 0; if (iso9660->seenJoliet && vd->location > iso9660->joliet.locati...
choose_volume(struct archive_read *a, struct iso9660 *iso9660) { struct file_info *file; int64_t skipsize; struct vd *vd; const void *block; char seenJoliet; vd = &(iso9660->primary); if (!iso9660->opt_support_joliet) iso9660->seenJoliet = 0; if (iso9660->seenJoliet && vd->location > iso9660->joliet.locati...
{'deleted': [{'line_no': 17, 'char_start': 407, 'char_end': 454, 'line': '\tskipsize = LOGICAL_BLOCK_SIZE * vd->location;\n'}, {'line_no': 55, 'char_start': 1599, 'char_end': 1647, 'line': '\t\tskipsize = LOGICAL_BLOCK_SIZE * vd->location;\n'}], 'added': [{'line_no': 17, 'char_start': 407, 'char_end': 463, 'line': '\ts...
{'deleted': [], 'added': [{'char_start': 440, 'char_end': 449, 'chars': '(int64_t)'}, {'char_start': 1642, 'char_end': 1651, 'chars': '(int64_t)'}]}
github.com/libarchive/libarchive/commit/3ad08e01b4d253c66ae56414886089684155af22
libarchive/archive_read_support_format_iso9660.c
cwe-190
862
cwe-022
misc_file_checks
def misc_file_checks(self): print_header("MISC FILE CHECKS") # # Check for recommended and mandatory files # filenames = ("manifest.json", "LICENSE", "README.md", "scripts/install", "scripts/remove", "scripts/upgrade", ...
def misc_file_checks(self): print_header("MISC FILE CHECKS") # # Check for recommended and mandatory files # filenames = ("manifest.json", "LICENSE", "README.md", "scripts/install", "scripts/remove", "scripts/upgrade", ...
{'deleted': [{'line_no': 39, 'char_start': 1268, 'char_end': 1336, 'line': ' if not os.path.isfile(self.path + "/conf/" + filename):\n'}], 'added': [{'line_no': 42, 'char_start': 1425, 'char_end': 1520, 'line': ' if not os.path.isfile(self.path + "/conf/" + filename) or "nginx" not in filename:\n'...
{'deleted': [], 'added': [{'char_start': 1153, 'char_end': 1184, 'chars': 'Analyze nginx conf\n # - '}, {'char_start': 1240, 'char_end': 1292, 'chars': ' - Spot path traversal issue vulnerability\n #'}, {'char_start': 1363, 'char_end': 1437, 'chars': '# Ignore subdirs or filename not containing nginx in t...
github.com/YunoHost/package_linter/commit/f6e98894cfe841aedaa7efd590937f0255193913
package_linter.py
cwe-022
386
cwe-190
authDigestNonceLink
authDigestNonceLink(digest_nonce_h * nonce) { assert(nonce != NULL); ++nonce->references; debugs(29, 9, "nonce '" << nonce << "' now at '" << nonce->references << "'."); }
authDigestNonceLink(digest_nonce_h * nonce) { assert(nonce != NULL); ++nonce->references; assert(nonce->references != 0); // no overflows debugs(29, 9, "nonce '" << nonce << "' now at '" << nonce->references << "'."); }
{'deleted': [], 'added': [{'line_no': 5, 'char_start': 98, 'char_end': 150, 'line': ' assert(nonce->references != 0); // no overflows\n'}]}
{'deleted': [], 'added': [{'char_start': 102, 'char_end': 154, 'chars': 'assert(nonce->references != 0); // no overflows\n '}]}
github.com/squid-cache/squid/commit/eeebf0f37a72a2de08348e85ae34b02c34e9a811
src/auth/digest/Config.cc
cwe-190
53
cwe-089
set_state
def set_state(chat_id, value): settings = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\bases\\settings.db") conn = settings.cursor() conn.execute("update users set state ='" + str(value) + "' where chat_id = '" + str(chat_id) + "'") settings.commit() settings.close()
def set_state(chat_id, value): settings = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\bases\\settings.db") conn = settings.cursor() conn.execute("update users set state = ? where chat_id = ?", (str(value), str(chat_id))) settings.commit() settings.close()
{'deleted': [{'line_no': 4, 'char_start': 160, 'char_end': 264, 'line': ' conn.execute("update users set state =\'" + str(value) + "\' where chat_id = \'" + str(chat_id) + "\'")\n'}], 'added': [{'line_no': 4, 'char_start': 160, 'char_end': 253, 'line': ' conn.execute("update users set state = ? where chat_id = ?"...
{'deleted': [{'char_start': 202, 'char_end': 204, 'chars': '\'"'}, {'char_start': 205, 'char_end': 222, 'chars': '+ str(value) + "\''}, {'char_start': 239, 'char_end': 240, 'chars': "'"}, {'char_start': 242, 'char_end': 243, 'chars': '+'}, {'char_start': 256, 'char_end': 262, 'chars': ' + "\'"'}], 'added': [{'char_star...
github.com/lissrbay/codeforces_bot/commit/cc7f5143445a0030b1149ac60a65b1b1b9c92a90
bot.py
cwe-089
73
cwe-416
snd_pcm_period_elapsed
void snd_pcm_period_elapsed(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime; unsigned long flags; if (PCM_RUNTIME_CHECK(substream)) return; runtime = substream->runtime; snd_pcm_stream_lock_irqsave(substream, flags); if (!snd_pcm_running(substream) || snd_pcm_update_hw_ptr0(substre...
void snd_pcm_period_elapsed(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime; unsigned long flags; if (PCM_RUNTIME_CHECK(substream)) return; runtime = substream->runtime; snd_pcm_stream_lock_irqsave(substream, flags); if (!snd_pcm_running(substream) || snd_pcm_update_hw_ptr0(substre...
{'deleted': [{'line_no': 20, 'char_start': 463, 'char_end': 516, 'line': '\tsnd_pcm_stream_unlock_irqrestore(substream, flags);\n'}], 'added': [{'line_no': 21, 'char_start': 511, 'char_end': 564, 'line': '\tsnd_pcm_stream_unlock_irqrestore(substream, flags);\n'}]}
{'deleted': [{'char_start': 513, 'char_end': 561, 'chars': ');\n\tkill_fasync(&runtime->fasync, SIGIO, POLL_IN'}], 'added': [{'char_start': 464, 'char_end': 512, 'chars': 'kill_fasync(&runtime->fasync, SIGIO, POLL_IN);\n\t'}]}
github.com/torvalds/linux/commit/3aa02cb664c5fb1042958c8d1aa8c35055a2ebc4
sound/core/pcm_lib.c
cwe-416
150
cwe-089
add_month_data_row
def add_month_data_row(self, inverter_serial, ts, etoday, etotal): y = datetime.fromtimestamp(ts) - timedelta(days=1) y_ts = int(datetime(y.year, y.month, y.day, 23, tzinfo=pytz.utc).timestamp()) query = ''' INSERT INTO MonthData ( TimeStamp, Ser...
def add_month_data_row(self, inverter_serial, ts, etoday, etotal): y = datetime.fromtimestamp(ts) - timedelta(days=1) y_ts = int(datetime(y.year, y.month, y.day, 23, tzinfo=pytz.utc).timestamp()) query = ''' INSERT INTO MonthData ( TimeStamp, Ser...
{'deleted': [{'line_no': 13, 'char_start': 434, 'char_end': 454, 'line': ' %s,\n'}, {'line_no': 14, 'char_start': 454, 'char_end': 474, 'line': ' %s,\n'}, {'line_no': 15, 'char_start': 474, 'char_end': 494, 'line': ' %s,\n'}, {'line_no': 16, 'char_start': 494, 'char_end': 51...
{'deleted': [{'char_start': 450, 'char_end': 452, 'chars': '%s'}, {'char_start': 470, 'char_end': 472, 'chars': '%s'}, {'char_start': 490, 'char_end': 492, 'chars': '%s'}, {'char_start': 510, 'char_end': 512, 'chars': '%s'}, {'char_start': 540, 'char_end': 541, 'chars': '%'}, {'char_start': 581, 'char_end': 610, 'chars...
github.com/philipptrenz/s0-bridge/commit/269b48caa05377b7c58c3e6d1622a4429cb5ba65
util/database.py
cwe-089
135
cwe-125
read_quant_matrix_ext
static void read_quant_matrix_ext(MpegEncContext *s, GetBitContext *gb) { int i, j, v; if (get_bits1(gb)) { /* intra_quantiser_matrix */ for (i = 0; i < 64; i++) { v = get_bits(gb, 8); j = s->idsp.idct_permutation[ff_zigzag_direct[i]]; s->intra_matrix[j] ...
static int read_quant_matrix_ext(MpegEncContext *s, GetBitContext *gb) { int i, j, v; if (get_bits1(gb)) { if (get_bits_left(gb) < 64*8) return AVERROR_INVALIDDATA; /* intra_quantiser_matrix */ for (i = 0; i < 64; i++) { v = get_bits(gb, 8); j = s->id...
{'deleted': [{'line_no': 1, 'char_start': 0, 'char_end': 72, 'line': 'static void read_quant_matrix_ext(MpegEncContext *s, GetBitContext *gb)\n'}], 'added': [{'line_no': 1, 'char_start': 0, 'char_end': 71, 'line': 'static int read_quant_matrix_ext(MpegEncContext *s, GetBitContext *gb)\n'}, {'line_no': 6, 'char_start': ...
{'deleted': [{'char_start': 7, 'char_end': 9, 'chars': 'vo'}, {'char_start': 10, 'char_end': 11, 'chars': 'd'}], 'added': [{'char_start': 8, 'char_end': 10, 'chars': 'nt'}, {'char_start': 115, 'char_end': 193, 'chars': '\n if (get_bits_left(gb) < 64*8)\n return AVERROR_INVALIDDATA;'}, {'char_start': 4...
github.com/FFmpeg/FFmpeg/commit/5aba5b89d0b1d73164d3b81764828bb8b20ff32a
libavcodec/mpeg4videodec.c
cwe-125
315
cwe-078
_get_least_used_nsp
def _get_least_used_nsp(self, nspss): """"Return the nsp that has the fewest active vluns.""" # return only the nsp (node:server:port) result = self.common._cli_run('showvlun -a -showcols Port', None) # count the number of nsps (there is 1 for each active vlun) nsp_counts = ...
def _get_least_used_nsp(self, nspss): """"Return the nsp that has the fewest active vluns.""" # return only the nsp (node:server:port) result = self.common._cli_run(['showvlun', '-a', '-showcols', 'Port']) # count the number of nsps (there is 1 for each active vlun) nsp_coun...
{'deleted': [{'line_no': 4, 'char_start': 155, 'char_end': 229, 'line': " result = self.common._cli_run('showvlun -a -showcols Port', None)\n"}], 'added': [{'line_no': 4, 'char_start': 155, 'char_end': 234, 'line': " result = self.common._cli_run(['showvlun', '-a', '-showcols', 'Port'])\n"}]}
{'deleted': [{'char_start': 221, 'char_end': 227, 'chars': ', None'}], 'added': [{'char_start': 193, 'char_end': 194, 'chars': '['}, {'char_start': 203, 'char_end': 205, 'chars': "',"}, {'char_start': 206, 'char_end': 207, 'chars': "'"}, {'char_start': 209, 'char_end': 211, 'chars': "',"}, {'char_start': 212, 'char_end...
github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f
cinder/volume/drivers/san/hp/hp_3par_iscsi.py
cwe-078
256
cwe-078
verify
def verify(self, data): credentials = self._formatCredentials(data, name='current') command = '{} rclone lsjson current:'.format(credentials) try: result = self._execute(command) return { 'result': True, 'message': 'Success', ...
def verify(self, data): credentials = self._formatCredentials(data, name='current') command = [ 'rclone', 'lsjson', 'current:', ] try: result = self._execute(command, credentials) return { 'result': True, ...
{'deleted': [{'line_no': 3, 'char_start': 96, 'char_end': 162, 'line': " command = '{} rclone lsjson current:'.format(credentials)\n"}, {'line_no': 6, 'char_start': 176, 'char_end': 220, 'line': ' result = self._execute(command)\n'}], 'added': [{'line_no': 3, 'char_start': 96, 'char_end': 116, 'line':...
{'deleted': [{'char_start': 115, 'char_end': 118, 'chars': '{} '}, {'char_start': 141, 'char_end': 161, 'chars': '.format(credentials)'}], 'added': [{'char_start': 114, 'char_end': 123, 'chars': '[\n '}, {'char_start': 124, 'char_end': 129, 'chars': " '"}, {'char_start': 135, 'char_end': 141, 'chars': "',\n ...
github.com/FredHutch/motuz/commit/045468cb9bff47bb3bb72268b6d5a3fe44e383db
src/backend/api/utils/rclone_connection.py
cwe-078
104
cwe-078
start
def start(): print("[*] Starting backdoor process") print("[*] Decompressing target to tmp directory...") #subprocess.call("jar -x %s" % target, shell=True) with zipfile.ZipFile(target, 'r') as zip: zip.extractall("tmp") print("[*] Target dumped to tmp directory") print("[*] Modifying m...
def start(): print("[*] Starting backdoor process") print("[*] Decompressing target to tmp directory...") #subprocess.call("jar -x %s" % target, shell=True) with zipfile.ZipFile(target, 'r') as zip: zip.extractall("tmp") print("[*] Target dumped to tmp directory") print("[*] Modifying m...
{'deleted': [{'line_no': 44, 'char_start': 1462, 'char_end': 1539, 'line': ' if subprocess.call("javac -cp tmp/ tmp/%s" % backdoor, shell=True) != 0:\n'}], 'added': [{'line_no': 45, 'char_start': 1540, 'char_end': 1623, 'line': " if subprocess.call(['javac','-cp','tmp/','tmp/%s'%backdoor],shell=False) != 0:\n"}]}
{'deleted': [], 'added': [{'char_start': 1466, 'char_end': 1467, 'chars': '#'}, {'char_start': 1531, 'char_end': 1614, 'chars': "e) != 0:\n if subprocess.call(['javac','-cp','tmp/','tmp/%s'%backdoor],shell=Fals"}]}
github.com/Atticuss/ajar/commit/5ed8aba271ad20e6168f2e3bd6c25ba89b84484f
ajar.py
cwe-078
483
cwe-787
idn2_to_ascii_4i
idn2_to_ascii_4i (const uint32_t * input, size_t inlen, char * output, int flags) { uint32_t *input_u32; uint8_t *input_u8, *output_u8; size_t length; int rc; if (!input) { if (output) *output = 0; return IDN2_OK; } input_u32 = (uint32_t *) malloc ((inlen + 1) * sizeof(uint32_t)); i...
idn2_to_ascii_4i (const uint32_t * input, size_t inlen, char * output, int flags) { uint32_t *input_u32; uint8_t *input_u8, *output_u8; size_t length; int rc; if (!input) { if (output) *output = 0; return IDN2_OK; } input_u32 = (uint32_t *) malloc ((inlen + 1) * sizeof(uint32_t)); i...
{'deleted': [{'line_no': 41, 'char_start': 933, 'char_end': 977, 'line': '\tstrcpy (output, (const char *) output_u8);\n'}, {'line_no': 43, 'char_start': 978, 'char_end': 1001, 'line': ' free(output_u8);\n'}], 'added': [{'line_no': 40, 'char_start': 915, 'char_end': 963, 'line': ' size_t len = strlen ((char *...
{'deleted': [{'char_start': 951, 'char_end': 957, 'chars': 'const '}], 'added': [{'char_start': 921, 'char_end': 1063, 'chars': 'size_t len = strlen ((char *) output_u8);\n\n if (len > 63)\n {\n\t free (output_u8);\n\t return IDN2_TOO_BIG_DOMAIN;\n }\n\n '}, {'char_start': 1124, 'char_end': 11...
github.com/libidn/libidn2/commit/e4d1558aa2c1c04a05066ee8600f37603890ba8c
lib/lookup.c
cwe-787
349
cwe-416
r_anal_bb_free
R_API void r_anal_bb_free(RAnalBlock *bb) { if (!bb) { return; } r_anal_cond_free (bb->cond); R_FREE (bb->fingerprint); r_anal_diff_free (bb->diff); bb->diff = NULL; R_FREE (bb->op_bytes); r_anal_switch_op_free (bb->switch_op); bb->switch_op = NULL; bb->fingerprint = NULL; bb->cond = NULL; R_FREE (bb->lab...
R_API void r_anal_bb_free(RAnalBlock *bb) { if (!bb) { return; } r_anal_cond_free (bb->cond); R_FREE (bb->fingerprint); r_anal_diff_free (bb->diff); bb->diff = NULL; R_FREE (bb->op_bytes); r_anal_switch_op_free (bb->switch_op); bb->switch_op = NULL; bb->fingerprint = NULL; bb->cond = NULL; R_FREE (bb->lab...
{'deleted': [{'line_no': 34, 'char_start': 686, 'char_end': 700, 'line': '\tR_FREE (bb);\n'}], 'added': [{'line_no': 34, 'char_start': 686, 'char_end': 703, 'line': '\tif (bb->next) {\n'}, {'line_no': 36, 'char_start': 726, 'char_end': 751, 'line': '\t\tbb->next->prev = NULL;\n'}, {'line_no': 37, 'char_start': 751, 'ch...
{'deleted': [], 'added': [{'char_start': 687, 'char_end': 755, 'chars': 'if (bb->next) {\n\t\t// avoid double free\n\t\tbb->next->prev = NULL;\n\t}\n\t'}, {'char_start': 767, 'char_end': 782, 'chars': ' // double free'}]}
github.com/radare/radare2/commit/90b71c017a7fa9732fe45fd21b245ee051b1f548
libr/anal/bb.c
cwe-416
265
cwe-416
TraceBezier
static MagickBooleanType TraceBezier(MVGInfo *mvg_info, const size_t number_coordinates) { double alpha, *coefficients, weight; PointInfo end, point, *points; PrimitiveInfo *primitive_info; register PrimitiveInfo *p; register ssize_t i, j; size_t control_po...
static MagickBooleanType TraceBezier(MVGInfo *mvg_info, const size_t number_coordinates) { double alpha, *coefficients, weight; PointInfo end, point, *points; PrimitiveInfo *primitive_info; register PrimitiveInfo *p; register ssize_t i, j; size_t control_po...
{'deleted': [{'line_no': 57, 'char_start': 1342, 'char_end': 1405, 'line': ' quantum=MagickMin(quantum/number_coordinates,BezierQuantum);\n'}], 'added': [{'line_no': 58, 'char_start': 1405, 'char_end': 1468, 'line': ' quantum=MagickMin(quantum/number_coordinates,BezierQuantum);\n'}, {'line_no': 80, 'char_start': 2403...
{'deleted': [{'char_start': 1344, 'char_end': 1407, 'chars': 'quantum=MagickMin(quantum/number_coordinates,BezierQuantum);\n '}], 'added': [{'char_start': 1344, 'char_end': 1407, 'chars': 'primitive_info=(*mvg_info->primitive_info)+mvg_info->offset;\n '}, {'char_start': 2402, 'char_end': 2465, 'chars': '\n primitive...
github.com/ImageMagick/ImageMagick/commit/ecf7c6b288e11e7e7f75387c5e9e93e423b98397
MagickCore/draw.c
cwe-416
1,081
cwe-089
login
def login(self, username, password): select_query = """ SELECT client_id, username, balance, message FROM Clients WHERE username = '{}' AND password = '{}' LIMIT 1 """.format(username, password) cursor = self.__conn.cursor() cursor.ex...
def login(self, username, password): select_query = """ SELECT client_id, username, balance, message FROM Clients WHERE username = ? AND password = ? LIMIT 1 """ cursor = self.__conn.cursor() cursor.execute(select_query, (username, pa...
{'deleted': [{'line_no': 5, 'char_start': 150, 'char_end': 204, 'line': " WHERE username = '{}' AND password = '{}'\n"}, {'line_no': 7, 'char_start': 224, 'char_end': 263, 'line': ' """.format(username, password)\n'}, {'line_no': 11, 'char_start': 303, 'char_end': 340, 'line': ' cursor.execute(...
{'deleted': [{'char_start': 179, 'char_end': 183, 'chars': "'{}'"}, {'char_start': 199, 'char_end': 203, 'chars': "'{}'"}, {'char_start': 235, 'char_end': 262, 'chars': '.format(username, password)'}], 'added': [{'char_start': 179, 'char_end': 180, 'chars': '?'}, {'char_start': 196, 'char_end': 197, 'chars': '?'}, {'ch...
github.com/AnetaStoycheva/Programming101_HackBulgaria/commit/c0d6f4b8fe83a375832845a45952b5153e4c34f3
Week_9/sql_manager.py
cwe-089
100
cwe-089
get_secrets
def get_secrets(self, from_date_added=0): secrets = [] for row in self.cursor.execute('SELECT encrypted, json_id, date_added FROM secret WHERE date_added > %s ORDER BY date_added DESC' % from_date_added): aes_key, json_id, date_added = cryptlib.eciesDecrypt(row[0], self.privkey), row[1], row[2] if aes_key !=...
def get_secrets(self, from_date_added=0): secrets = [] for row in self.cursor.execute('SELECT encrypted, json_id, date_added FROM secret WHERE date_added > ? ORDER BY date_added DESC', (from_date_added,)): aes_key, json_id, date_added = cryptlib.eciesDecrypt(row[0], self.privkey), row[1], row[2] if aes_key !...
{'deleted': [{'line_no': 3, 'char_start': 58, 'char_end': 210, 'line': "\t\tfor row in self.cursor.execute('SELECT encrypted, json_id, date_added FROM secret WHERE date_added > %s ORDER BY date_added DESC' % from_date_added):\n"}], 'added': [{'line_no': 3, 'char_start': 58, 'char_end': 211, 'line': "\t\tfor row in self...
{'deleted': [{'char_start': 161, 'char_end': 163, 'chars': '%s'}, {'char_start': 189, 'char_end': 191, 'chars': ' %'}], 'added': [{'char_start': 161, 'char_end': 162, 'chars': '?'}, {'char_start': 188, 'char_end': 189, 'chars': ','}, {'char_start': 190, 'char_end': 191, 'chars': '('}, {'char_start': 206, 'char_end': 20...
github.com/imachug/ZeroMailProxy/commit/8f62d024c6c4c957079d147e59f26d15c07dc888
zeromail.py
cwe-089
125
cwe-476
open_ssl_connection
open_ssl_connection (rfbClient *client, int sockfd, rfbBool anonTLS, rfbCredential *cred) { SSL_CTX *ssl_ctx = NULL; SSL *ssl = NULL; int n, finished = 0; X509_VERIFY_PARAM *param; uint8_t verify_crls = cred->x509Credential.x509CrlVerifyMode; if (!(ssl_ctx = SSL_CTX_new(SSLv23_client_method()))) { rf...
open_ssl_connection (rfbClient *client, int sockfd, rfbBool anonTLS, rfbCredential *cred) { SSL_CTX *ssl_ctx = NULL; SSL *ssl = NULL; int n, finished = 0; X509_VERIFY_PARAM *param; uint8_t verify_crls; if (!(ssl_ctx = SSL_CTX_new(SSLv23_client_method()))) { rfbClientLog("Could not create new SSL cont...
{'deleted': [{'line_no': 7, 'char_start': 189, 'char_end': 253, 'line': ' uint8_t verify_crls = cred->x509Credential.x509CrlVerifyMode;\n'}], 'added': [{'line_no': 7, 'char_start': 189, 'char_end': 212, 'line': ' uint8_t verify_crls;\n'}, {'line_no': 20, 'char_start': 452, 'char_end': 510, 'line': ' verify_crls = ...
{'deleted': [{'char_start': 210, 'char_end': 251, 'chars': ' = cred->x509Credential.x509CrlVerifyMode'}], 'added': [{'char_start': 451, 'char_end': 509, 'chars': '\n verify_crls = cred->x509Credential.x509CrlVerifyMode;'}]}
github.com/LibVNC/libvncserver/commit/33441d90a506d5f3ae9388f2752901227e430553
libvncclient/tls_openssl.c
cwe-476
981
cwe-089
get_top_author
def get_top_author(top_num): """ query the top(top_num) popular author top_num => list of [author, count] """ cmd = """SELECT authors.name,author_result.num FROM authors JOIN (SELECT SUM(article_result.num) as num, article_result.aut...
def get_top_author(top_num): """ query the top(top_num) popular author top_num => list of [author, count] """ cmd = """SELECT authors.name,author_result.num FROM authors JOIN (SELECT SUM(article_result.num) as num, article_result.aut...
{'deleted': [{'line_no': 21, 'char_start': 931, 'char_end': 998, 'line': ' ORDER BY num DESC LIMIT {}""".format(top_num)\r\n'}, {'line_no': 22, 'char_start': 998, 'char_end': 1027, 'line': ' return execute_query(cmd)\r\n'}], 'added': [{'line_no': 21, 'char_start': 931, 'char_end': 982, 'line': ' ...
{'deleted': [{'char_start': 975, 'char_end': 977, 'chars': '{}'}, {'char_start': 980, 'char_end': 985, 'chars': '.form'}, {'char_start': 987, 'char_end': 988, 'chars': '('}, {'char_start': 995, 'char_end': 996, 'chars': ')'}], 'added': [{'char_start': 975, 'char_end': 977, 'chars': '%s'}, {'char_start': 980, 'char_end'...
github.com/thugasin/udacity-homework-logAnalyzer/commit/506f25f9a1caee7f17034adf7c75e0efbc88082b
logAnalyzerDb.py
cwe-089
177
cwe-022
render
def render(self, request): action = "download" if "action" in request.args: action = request.args["action"][0] if "file" in request.args: filename = request.args["file"][0].decode('utf-8', 'ignore').encode('utf-8') filename = re.sub("^/+", "/", os.path.realpath(filename)) if not os.path.exists(file...
def render(self, request): action = "download" if "action" in request.args: action = request.args["action"][0] if "file" in request.args: filename = lenient_force_utf_8(request.args["file"][0]) filename = sanitise_filename_slashes(os.path.realpath(filename)) if not os.path.exists(filename): ret...
{'deleted': [{'line_no': 7, 'char_start': 149, 'char_end': 229, 'line': '\t\t\tfilename = request.args["file"][0].decode(\'utf-8\', \'ignore\').encode(\'utf-8\')\n'}, {'line_no': 8, 'char_start': 229, 'char_end': 290, 'line': '\t\t\tfilename = re.sub("^/+", "/", os.path.realpath(filename))\n'}], 'added': [{'line_no': 7...
{'deleted': [{'char_start': 186, 'char_end': 227, 'chars': ".decode('utf-8', 'ignore').encode('utf-8'"}, {'char_start': 243, 'char_end': 244, 'chars': 'r'}, {'char_start': 245, 'char_end': 246, 'chars': '.'}, {'char_start': 247, 'char_end': 249, 'chars': 'ub'}, {'char_start': 250, 'char_end': 262, 'chars': '"^/+", "/",...
github.com/E2OpenPlugins/e2openplugin-OpenWebif/commit/a846b7664eda3a4c51a452e00638cf7337dc2013
plugin/controllers/file.py
cwe-022
590
cwe-089
update_theory_base
def update_theory_base(tag, link): theory = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\theory.db") conn = theory.cursor() conn.execute("insert into " + str(tag) + " values (?)", (str(link), )) theory.commit() theory.close()
def update_theory_base(tag, link): theory = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\theory.db") conn = theory.cursor() conn.execute("insert into ? values (?)", (tag, str(link))) theory.commit() theory.close()
{'deleted': [{'line_no': 4, 'char_start': 151, 'char_end': 226, 'line': ' conn.execute("insert into " + str(tag) + " values (?)", (str(link), ))\n'}], 'added': [{'line_no': 4, 'char_start': 151, 'char_end': 214, 'line': ' conn.execute("insert into ? values (?)", (tag, str(link)))\n'}]}
{'deleted': [{'char_start': 181, 'char_end': 197, 'chars': '" + str(tag) + "'}, {'char_start': 221, 'char_end': 223, 'chars': ', '}], 'added': [{'char_start': 181, 'char_end': 182, 'chars': '?'}, {'char_start': 197, 'char_end': 202, 'chars': 'tag, '}]}
github.com/lissrbay/codeforces_bot/commit/cc7f5143445a0030b1149ac60a65b1b1b9c92a90
bases/update.py
cwe-089
64
cwe-125
ReadSUNImage
static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define RMT_EQUAL_RGB 1 #define RMT_NONE 0 #define RMT_RAW 2 #define RT_STANDARD 1 #define RT_ENCODED 2 #define RT_FORMAT_RGB 3 typedef struct _SUNInfo { unsigned int magic, width, height, depth, ...
static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define RMT_EQUAL_RGB 1 #define RMT_NONE 0 #define RMT_RAW 2 #define RT_STANDARD 1 #define RT_ENCODED 2 #define RT_FORMAT_RGB 3 typedef struct _SUNInfo { unsigned int magic, width, height, depth, ...
{'deleted': [{'line_no': 201, 'char_start': 6237, 'char_end': 6310, 'line': ' ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");\n'}, {'line_no': 217, 'char_start': 7201, 'char_end': 7274, 'line': ' ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");\n'}, {'line_no': 221, 'char_...
{'deleted': [{'char_start': 6284, 'char_end': 6286, 'chars': 'Me'}, {'char_start': 6289, 'char_end': 6295, 'chars': 'yAlloc'}, {'char_start': 6296, 'char_end': 6304, 'chars': 'tionFail'}, {'char_start': 7248, 'char_end': 7250, 'chars': 'Me'}, {'char_start': 7253, 'char_end': 7259, 'chars': 'yAlloc'}, {'char_start': 726...
github.com/ImageMagick/ImageMagick/commit/6b4aff0f117b978502ee5bcd6e753c17aec5a961
coders/sun.c
cwe-125
3,541
cwe-476
hash_accept
static int hash_accept(struct socket *sock, struct socket *newsock, int flags) { struct sock *sk = sock->sk; struct alg_sock *ask = alg_sk(sk); struct hash_ctx *ctx = ask->private; struct ahash_request *req = &ctx->req; char state[crypto_ahash_statesize(crypto_ahash_reqtfm(req))]; struct sock *sk2; struct alg_so...
static int hash_accept(struct socket *sock, struct socket *newsock, int flags) { struct sock *sk = sock->sk; struct alg_sock *ask = alg_sk(sk); struct hash_ctx *ctx = ask->private; struct ahash_request *req = &ctx->req; char state[crypto_ahash_statesize(crypto_ahash_reqtfm(req))]; struct sock *sk2; struct alg_so...
{'deleted': [{'line_no': 13, 'char_start': 365, 'char_end': 405, 'line': '\terr = crypto_ahash_export(req, state);\n'}, {'line_no': 24, 'char_start': 563, 'char_end': 580, 'line': '\tctx2->more = 1;\n'}], 'added': [{'line_no': 11, 'char_start': 354, 'char_end': 366, 'line': '\tbool more;\n'}, {'line_no': 14, 'char_star...
{'deleted': [{'char_start': 577, 'char_end': 578, 'chars': '1'}], 'added': [{'char_start': 355, 'char_end': 367, 'chars': 'bool more;\n\t'}, {'char_start': 378, 'char_end': 413, 'chars': 'lock_sock(sk);\n\tmore = ctx->more;\n\t'}, {'char_start': 418, 'char_end': 425, 'chars': ' more ?'}, {'char_start': 457, 'char_end':...
github.com/torvalds/linux/commit/4afa5f9617927453ac04b24b584f6c718dfb4f45
crypto/algif_hash.c
cwe-476
215
cwe-125
ape_decode_frame
static int ape_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { AVFrame *frame = data; const uint8_t *buf = avpkt->data; APEContext *s = avctx->priv_data; uint8_t *sample8; int16_t *sample16; int32_t *sample24; int i, ch, ...
static int ape_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { AVFrame *frame = data; const uint8_t *buf = avpkt->data; APEContext *s = avctx->priv_data; uint8_t *sample8; int16_t *sample16; int32_t *sample24; int i, ch, ...
{'deleted': [{'line_no': 67, 'char_start': 2347, 'char_end': 2392, 'line': ' if (!nblocks || nblocks > INT_MAX) {\n'}, {'line_no': 93, 'char_start': 3163, 'char_end': 3220, 'line': ' av_fast_malloc(&s->decoded_buffer, &s->decoded_size,\n'}, {'line_no': 94, 'char_start': 3220, 'char_end': 3301, 'line': ' ...
{'deleted': [{'char_start': 3167, 'char_end': 3186, 'chars': 'av_fast_malloc(&s->'}, {'char_start': 3200, 'char_end': 3213, 'chars': ', &s->decoded'}, {'char_start': 3218, 'char_end': 3231, 'chars': ',\n '}, {'char_start': 3232, 'char_end': 3238, 'chars': ' '}], 'added': [{'char_start': 349, 'char_end': ...
github.com/FFmpeg/FFmpeg/commit/ba4beaf6149f7241c8bd85fe853318c2f6837ad0
libavcodec/apedec.c
cwe-125
1,396
cwe-078
test_create_host
def test_create_host(self): self.flags(lock_path=self.tempdir) #record self.clear_mox() self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "get_cpg", self.fake_get_cpg) self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "get_domain", ...
def test_create_host(self): self.flags(lock_path=self.tempdir) #record self.clear_mox() self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "get_cpg", self.fake_get_cpg) self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "get_domain", ...
{'deleted': [{'line_no': 13, 'char_start': 501, 'char_end': 554, 'line': " show_host_cmd = 'showhost -verbose fakehost'\n"}, {'line_no': 16, 'char_start': 635, 'char_end': 712, 'line': " create_host_cmd = ('createhost -persona 1 -domain (\\'OpenStack\\',) '\n"}, {'line_no': 17, 'char_start': 712, 'char_en...
{'deleted': [{'char_start': 692, 'char_end': 706, 'chars': " (\\'OpenStack\\"}, {'char_start': 708, 'char_end': 711, 'chars': ") '"}], 'added': [{'char_start': 525, 'char_end': 526, 'chars': '['}, {'char_start': 535, 'char_end': 537, 'chars': "',"}, {'char_start': 538, 'char_end': 539, 'chars': "'"}, {'char_start': 547...
github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f
cinder/tests/test_hp3par.py
cwe-078
295
cwe-079
handle_file
def handle_file(u: Profile, headline: str, category: str, text: str, file): m: Media = Media() upload_base_path: str = 'uploads/' + str(date.today().year) high_res_file_name = upload_base_path + '/HIGHRES_' + ntpath.basename(file.name.replace(" ", "_")) low_res_file_name = upload_base_path + '/LOWRES_' ...
def handle_file(u: Profile, headline: str, category: str, text: str, file): m: Media = Media() upload_base_path: str = 'uploads/' + str(date.today().year) high_res_file_name = upload_base_path + '/HIGHRES_' + ntpath.basename(file.name.replace(" ", "_")) low_res_file_name = upload_base_path + '/LOWRES_' ...
{'deleted': [{'line_no': 21, 'char_start': 1021, 'char_end': 1039, 'line': ' m.text = text\n'}, {'line_no': 22, 'char_start': 1039, 'char_end': 1081, 'line': ' m.cachedText = compile_markdown(text)\n'}, {'line_no': 23, 'char_start': 1081, 'char_end': 1107, 'line': ' m.category = category\n'}, {'line_no': 26, '...
{'deleted': [], 'added': [{'char_start': 1034, 'char_end': 1041, 'chars': 'escape('}, {'char_start': 1045, 'char_end': 1046, 'chars': ')'}, {'char_start': 1083, 'char_end': 1090, 'chars': 'escape('}, {'char_start': 1094, 'char_end': 1095, 'chars': ')'}, {'char_start': 1114, 'char_end': 1121, 'chars': 'escape('}, {'char...
github.com/Technikradio/C3FOCSite/commit/6e330d4d44bbfdfce9993dffea97008276771600
c3shop/frontpage/management/mediatools/media_actions.py
cwe-079
363
cwe-190
futex_requeue
static int futex_requeue(u32 __user *uaddr1, unsigned int flags, u32 __user *uaddr2, int nr_wake, int nr_requeue, u32 *cmpval, int requeue_pi) { union futex_key key1 = FUTEX_KEY_INIT, key2 = FUTEX_KEY_INIT; int drop_count = 0, task_count = 0, ret; struct futex_pi_state *pi_state = NULL; struct futex_hash_bu...
static int futex_requeue(u32 __user *uaddr1, unsigned int flags, u32 __user *uaddr2, int nr_wake, int nr_requeue, u32 *cmpval, int requeue_pi) { union futex_key key1 = FUTEX_KEY_INIT, key2 = FUTEX_KEY_INIT; int drop_count = 0, task_count = 0, ret; struct futex_pi_state *pi_state = NULL; struct futex_hash_bu...
{'deleted': [], 'added': [{'line_no': 12, 'char_start': 392, 'char_end': 428, 'line': '\tif (nr_wake < 0 || nr_requeue < 0)\n'}, {'line_no': 13, 'char_start': 428, 'char_end': 446, 'line': '\t\treturn -EINVAL;\n'}, {'line_no': 14, 'char_start': 446, 'char_end': 447, 'line': '\n'}]}
{'deleted': [], 'added': [{'char_start': 393, 'char_end': 448, 'chars': 'if (nr_wake < 0 || nr_requeue < 0)\n\t\treturn -EINVAL;\n\n\t'}]}
github.com/torvalds/linux/commit/fbe0e839d1e22d88810f3ee3e2f1479be4c0aa4a
kernel/futex.c
cwe-190
2,348
cwe-022
list
def list(self, keyfilter='/'): path = os.path.join(self.namespace, keyfilter) if path != '/': path = path.rstrip('/') try: result = self.etcd.read(path, recursive=True) except etcd.EtcdKeyNotFound: return None except etcd.EtcdException as e...
def list(self, keyfilter='/'): path = self._absolute_key(keyfilter) if path != '/': path = path.rstrip('/') try: result = self.etcd.read(path, recursive=True) except etcd.EtcdKeyNotFound: return None except etcd.EtcdException as err: ...
{'deleted': [{'line_no': 2, 'char_start': 35, 'char_end': 90, 'line': ' path = os.path.join(self.namespace, keyfilter)\n'}], 'added': [{'line_no': 2, 'char_start': 35, 'char_end': 80, 'line': ' path = self._absolute_key(keyfilter)\n'}]}
{'deleted': [{'char_start': 50, 'char_end': 63, 'chars': 'os.path.join('}, {'char_start': 68, 'char_end': 69, 'chars': 'n'}, {'char_start': 70, 'char_end': 72, 'chars': 'me'}, {'char_start': 73, 'char_end': 76, 'chars': 'pac'}, {'char_start': 77, 'char_end': 79, 'chars': ', '}], 'added': [{'char_start': 55, 'char_end':...
github.com/latchset/custodia/commit/785fc87f38b4811bc4ce43a0a9b2267ee7d500b4
custodia/store/etcdstore.py
cwe-022
167
cwe-089
delete_playlist
def delete_playlist(id, db): db.execute("DELETE FROM playlist where id={id};".format(id=id))
def delete_playlist(id, db): db.execute("DELETE FROM playlist where id=%s;", (id,))
{'deleted': [{'line_no': 2, 'char_start': 29, 'char_end': 96, 'line': ' db.execute("DELETE FROM playlist where id={id};".format(id=id))\n'}], 'added': [{'line_no': 2, 'char_start': 29, 'char_end': 87, 'line': ' db.execute("DELETE FROM playlist where id=%s;", (id,))\n'}]}
{'deleted': [{'char_start': 75, 'char_end': 79, 'chars': '{id}'}, {'char_start': 81, 'char_end': 88, 'chars': '.format'}, {'char_start': 91, 'char_end': 94, 'chars': '=id'}], 'added': [{'char_start': 75, 'char_end': 77, 'chars': '%s'}, {'char_start': 79, 'char_end': 81, 'chars': ', '}, {'char_start': 84, 'char_end': 85...
github.com/Madmous/playlist/commit/666e52c5f0b8c1f4296e84471637033d9542a7a6
playlist/playlist_repository.py
cwe-089
24
cwe-787
handle_PORT
static void handle_PORT(ctrl_t *ctrl, char *str) { int a, b, c, d, e, f; char addr[INET_ADDRSTRLEN]; struct sockaddr_in sin; if (ctrl->data_sd > 0) { uev_io_stop(&ctrl->data_watcher); close(ctrl->data_sd); ctrl->data_sd = -1; } /* Convert PORT command's argument to IP address + port */ sscanf(str, "%d,%d...
static void handle_PORT(ctrl_t *ctrl, char *str) { int a, b, c, d, e, f; char addr[INET_ADDRSTRLEN]; struct sockaddr_in sin; if (ctrl->data_sd > 0) { uev_io_stop(&ctrl->data_watcher); close(ctrl->data_sd); ctrl->data_sd = -1; } /* Convert PORT command's argument to IP address + port */ sscanf(str, "%d,%d...
{'deleted': [{'line_no': 15, 'char_start': 360, 'char_end': 403, 'line': '\tsprintf(addr, "%d.%d.%d.%d", a, b, c, d);\n'}], 'added': [{'line_no': 15, 'char_start': 360, 'char_end': 418, 'line': '\tsnprintf(addr, sizeof(addr), "%d.%d.%d.%d", a, b, c, d);\n'}]}
{'deleted': [], 'added': [{'char_start': 362, 'char_end': 363, 'chars': 'n'}, {'char_start': 374, 'char_end': 388, 'chars': ', sizeof(addr)'}]}
github.com/troglobit/uftpd/commit/0fb2c031ce0ace07cc19cd2cb2143c4b5a63c9dd
src/ftpcmd.c
cwe-787
290
cwe-089
all_deposits
def all_deposits(self,coin): sql = "SELECT * FROM deposits WHERE coin='%s'" % coin self.cursor.execute(sql) return self.cursor.fetchall()
def all_deposits(self,coin): sql = "SELECT * FROM deposits WHERE coin='%s'" self.cursor.execute(sql, (coin,)) return self.cursor.fetchall()
{'deleted': [{'line_no': 2, 'char_start': 33, 'char_end': 95, 'line': ' sql = "SELECT * FROM deposits WHERE coin=\'%s\'" % coin\n'}, {'line_no': 3, 'char_start': 95, 'char_end': 128, 'line': ' self.cursor.execute(sql)\n'}], 'added': [{'line_no': 2, 'char_start': 33, 'char_end': 88, 'line': ' sql = ...
{'deleted': [{'char_start': 87, 'char_end': 94, 'chars': ' % coin'}], 'added': [{'char_start': 119, 'char_end': 128, 'chars': ', (coin,)'}]}
github.com/ktechmidas/garlictipsbot/commit/7c262255f933cb721109ac4be752b5b7599275aa
deposit.py
cwe-089
38
cwe-089
followFriends
def followFriends(self,userid,friendid): sqlText="insert into friends values(%d,%d);"%(friendid,userid) result=sql.insertDB(self.conn,sqlText) return result;
def followFriends(self,userid,friendid): sqlText="insert into friends values(%s,%s);" params=[friendid,userid] result=sql.insertDB(self.conn,sqlText,params) return result;
{'deleted': [{'line_no': 2, 'char_start': 45, 'char_end': 116, 'line': ' sqlText="insert into friends values(%d,%d);"%(friendid,userid)\n'}, {'line_no': 3, 'char_start': 116, 'char_end': 163, 'line': ' result=sql.insertDB(self.conn,sqlText)\n'}], 'added': [{'line_no': 2, 'char_start': 45, 'char_end': 98, ...
{'deleted': [{'char_start': 90, 'char_end': 91, 'chars': 'd'}, {'char_start': 93, 'char_end': 94, 'chars': 'd'}, {'char_start': 97, 'char_end': 99, 'chars': '%('}, {'char_start': 114, 'char_end': 115, 'chars': ')'}], 'added': [{'char_start': 90, 'char_end': 91, 'chars': 's'}, {'char_start': 93, 'char_end': 94, 'chars':...
github.com/ShaominLi/Twitter_project/commit/5329d91f9e569c95184053c8e7ef596949c33ce9
modules/users.py
cwe-089
46
cwe-125
parallel_process_irp_create
static UINT parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* irp) { char* path = NULL; int status; UINT32 PathLength; Stream_Seek(irp->input, 28); /* DesiredAccess(4) AllocationSize(8), FileAttributes(4) */ /* SharedAccess(4) CreateDisposition(4), CreateOptions(4) */ Stream_Read_UINT32(irp->input, Pat...
static UINT parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* irp) { char* path = NULL; int status; WCHAR* ptr; UINT32 PathLength; if (!Stream_SafeSeek(irp->input, 28)) return ERROR_INVALID_DATA; /* DesiredAccess(4) AllocationSize(8), FileAttributes(4) */ /* SharedAccess(4) CreateDisposition(4), Crea...
{'deleted': [{'line_no': 6, 'char_start': 132, 'char_end': 162, 'line': '\tStream_Seek(irp->input, 28);\n'}, {'line_no': 10, 'char_start': 330, 'char_end': 423, 'line': '\tstatus = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)Stream_Pointer(irp->input), PathLength / 2,\n'}, {'line_no': 11, 'char_start': 423, 'char_end': 475,...
{'deleted': [{'char_start': 331, 'char_end': 332, 'chars': 's'}, {'char_start': 333, 'char_end': 345, 'chars': 'atus = Conve'}, {'char_start': 346, 'char_end': 367, 'chars': 'tFromUnicode(CP_UTF8,'}, {'char_start': 368, 'char_end': 370, 'chars': '0,'}, {'char_start': 417, 'char_end': 422, 'chars': ' / 2,'}, {'char_star...
github.com/FreeRDP/FreeRDP/commit/795842f4096501fcefc1a7f535ccc8132feb31d7
channels/parallel/client/parallel_main.c
cwe-125
334
cwe-476
filter_session_io
filter_session_io(struct io *io, int evt, void *arg) { struct filter_session *fs = arg; char *line = NULL; ssize_t len; log_trace(TRACE_IO, "filter session: %p: %s %s", fs, io_strevent(evt), io_strio(io)); switch (evt) { case IO_DATAIN: nextline: line = io_getline(fs->io, &len); /* No complete line re...
filter_session_io(struct io *io, int evt, void *arg) { struct filter_session *fs = arg; char *line = NULL; ssize_t len; log_trace(TRACE_IO, "filter session: %p: %s %s", fs, io_strevent(evt), io_strio(io)); switch (evt) { case IO_DATAIN: nextline: line = io_getline(fs->io, &len); /* No complete line re...
{'deleted': [{'line_no': 21, 'char_start': 409, 'char_end': 410, 'line': '\n'}, {'line_no': 22, 'char_start': 410, 'char_end': 433, 'line': '\tcase IO_DISCONNECTED:\n'}, {'line_no': 23, 'char_start': 433, 'char_end': 452, 'line': '\t\tio_free(fs->io);\n'}, {'line_no': 24, 'char_start': 452, 'char_end': 469, 'line': '\t...
{'deleted': [{'char_start': 409, 'char_end': 478, 'chars': '\n\tcase IO_DISCONNECTED:\n\t\tio_free(fs->io);\n\t\tfs->io = NULL;\n\t\tbreak;\n'}], 'added': []}
github.com/openbsd/src/commit/6c3220444ed06b5796dedfd53a0f4becd903c0d1
usr.sbin/smtpd/lka_filter.c
cwe-476
150
cwe-125
mpeg4_decode_studio_block
static int mpeg4_decode_studio_block(MpegEncContext *s, int32_t block[64], int n) { Mpeg4DecContext *ctx = s->avctx->priv_data; int cc, dct_dc_size, dct_diff, code, j, idx = 1, group = 0, run = 0, additional_code_len, sign, mismatch; VLC *cur_vlc = &ctx->studio_intra_tab[0]; uint8_t *const scan...
static int mpeg4_decode_studio_block(MpegEncContext *s, int32_t block[64], int n) { Mpeg4DecContext *ctx = s->avctx->priv_data; int cc, dct_dc_size, dct_diff, code, j, idx = 1, group = 0, run = 0, additional_code_len, sign, mismatch; VLC *cur_vlc = &ctx->studio_intra_tab[0]; uint8_t *const scan...
{'deleted': [], 'added': [{'line_no': 86, 'char_start': 2920, 'char_end': 2946, 'line': ' if (idx > 63)\n'}, {'line_no': 87, 'char_start': 2946, 'char_end': 2990, 'line': ' return AVERROR_INVALIDDATA;\n'}, {'line_no': 92, 'char_start': 3154, 'char_end': 3180, 'line': ' if (idx > 63)...
{'deleted': [{'char_start': 2954, 'char_end': 2954, 'chars': ''}, {'char_start': 3215, 'char_end': 3215, 'chars': ''}], 'added': [{'char_start': 2932, 'char_end': 3002, 'chars': 'if (idx > 63)\n return AVERROR_INVALIDDATA;\n '}, {'char_start': 3154, 'char_end': 3224, 'chars': ' if (...
github.com/FFmpeg/FFmpeg/commit/d227ed5d598340e719eff7156b1aa0a4469e9a6a
libavcodec/mpeg4videodec.c
cwe-125
1,165
cwe-125
Cipher::blowfishECB
QByteArray Cipher::blowfishECB(QByteArray cipherText, bool direction) { QCA::Initializer init; QByteArray temp = cipherText; //do padding ourselves if (direction) { while ((temp.length() % 8) != 0) temp.append('\0'); } else { temp = b64ToByte(temp); while ((temp....
QByteArray Cipher::blowfishECB(QByteArray cipherText, bool direction) { QCA::Initializer init; QByteArray temp = cipherText; //do padding ourselves if (direction) { while ((temp.length() % 8) != 0) temp.append('\0'); } else { // ECB Blowfish encodes in blocks of 12 chars...
{'deleted': [{'line_no': 25, 'char_start': 689, 'char_end': 708, 'line': ' if (direction)\n'}], 'added': [{'line_no': 14, 'char_start': 358, 'char_end': 397, 'line': ' if ((temp.length() % 12) != 0)\n'}, {'line_no': 15, 'char_start': 397, 'char_end': 428, 'line': ' return cipherText;\n'}, {'line_no...
{'deleted': [], 'added': [{'char_start': 275, 'char_end': 437, 'chars': '// ECB Blowfish encodes in blocks of 12 chars, so anything else is malformed input\n if ((temp.length() % 12) != 0)\n return cipherText;\n\n '}, {'char_start': 869, 'char_end': 966, 'chars': ' {\n // Sanity check\n ...
github.com/quassel/quassel/commit/8b5ecd226f9208af3074b33d3b7cf5e14f55b138
src/core/cipher.cpp
cwe-125
214
cwe-476
formUpdateBuffer
formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form) { Buffer save; char *p; int spos, epos, rows, c_rows, pos, col = 0; Line *l; copyBuffer(&save, buf); gotoLine(buf, a->start.line); switch (form->type) { case FORM_TEXTAREA: case FORM_INPUT_TEXT: case FORM_INPUT_FILE: ...
formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form) { Buffer save; char *p; int spos, epos, rows, c_rows, pos, col = 0; Line *l; copyBuffer(&save, buf); gotoLine(buf, a->start.line); switch (form->type) { case FORM_TEXTAREA: case FORM_INPUT_TEXT: case FORM_INPUT_FILE: ...
{'deleted': [], 'added': [{'line_no': 70, 'char_start': 1647, 'char_end': 1667, 'line': '\t if (l == NULL)\n'}, {'line_no': 71, 'char_start': 1667, 'char_end': 1676, 'line': '\t\tbreak;\n'}]}
{'deleted': [], 'added': [{'char_start': 1656, 'char_end': 1685, 'chars': 'l == NULL)\n\t\tbreak;\n\t if ('}]}
github.com/tats/w3m/commit/7fdc83b0364005a0b5ed869230dd81752ba022e8
form.c
cwe-476
808
cwe-089
get_markets
@app.route('/get_markets') def get_markets(): asset_id = request.args.get('asset_id') if not isObject(asset_id): ws.send('{"id":1, "method":"call", "params":[0,"lookup_asset_symbols",[["' + asset_id + '"], 0]]}') result_l = ws.recv() j_l = json.loads(result_l) asset_id = j_l["re...
@app.route('/get_markets') def get_markets(): asset_id = request.args.get('asset_id') if not isObject(asset_id): ws.send('{"id":1, "method":"call", "params":[0,"lookup_asset_symbols",[["' + asset_id + '"], 0]]}') result_l = ws.recv() j_l = json.loads(result_l) asset_id = j_l["re...
{'deleted': [{'line_no': 15, 'char_start': 408, 'char_end': 469, 'line': ' query = "SELECT * FROM markets WHERE aid=\'"+asset_id+"\'"\n'}, {'line_no': 16, 'char_start': 469, 'char_end': 492, 'line': ' cur.execute(query)\n'}], 'added': [{'line_no': 15, 'char_start': 408, 'char_end': 457, 'line': ' query = "SELE...
{'deleted': [{'char_start': 453, 'char_end': 457, 'chars': '\'"+a'}, {'char_start': 458, 'char_end': 467, 'chars': 'set_id+"\''}], 'added': [{'char_start': 453, 'char_end': 454, 'chars': '%'}, {'char_start': 478, 'char_end': 491, 'chars': ', (asset_id,)'}]}
github.com/VinChain/vinchain-python-api-backend/commit/b78088a551fbb712121269c6eb7f43ede120ff60
api.py
cwe-089
148
cwe-089
markTokenUsedExternal
def markTokenUsedExternal(token, optStr=""): conn, c = connectDB() req = "UPDATE {} SET \"options_selected\"='{}' WHERE token='{}'".format(CFG("tokens_table_name"), \ optStr, token) c.execute(req) closeDB(conn)
def markTokenUsedExternal(token, optStr=""): conn, c = connectDB() req = "UPDATE {} SET \"options_selected\"=? WHERE token=?".format(CFG("tokens_table_name")) c.execute(req, (optStr, token,)) closeDB(conn)
{'deleted': [{'line_no': 3, 'char_start': 71, 'char_end': 175, 'line': ' req = "UPDATE {} SET \\"options_selected\\"=\'{}\' WHERE token=\'{}\'".format(CFG("tokens_table_name"), \\\n'}, {'line_no': 4, 'char_start': 175, 'char_end': 210, 'line': ' optStr, token)\n'}, {'line_no': 5, 'char_start': 210...
{'deleted': [{'char_start': 117, 'char_end': 121, 'chars': "'{}'"}, {'char_start': 134, 'char_end': 138, 'chars': "'{}'"}, {'char_start': 171, 'char_end': 174, 'chars': ', \\'}, {'char_start': 175, 'char_end': 177, 'chars': ' '}, {'char_start': 181, 'char_end': 182, 'chars': ' '}, {'char_start': 183, 'char_end': 195, ...
github.com/FAUSheppy/simple-python-poll/commit/186c5ff5cdf58272e253a1bb432419ee50d93109
database.py
cwe-089
64
cwe-125
DecodePSDPixels
static ssize_t DecodePSDPixels(const size_t number_compact_pixels, const unsigned char *compact_pixels,const ssize_t depth, const size_t number_pixels,unsigned char *pixels) { #define CheckNumberCompactPixels \ if (packets == 0) \ return(i); \ packets-- #define CheckNumberPixels(count) \ if (((ssize_t) i...
static ssize_t DecodePSDPixels(const size_t number_compact_pixels, const unsigned char *compact_pixels,const ssize_t depth, const size_t number_pixels,unsigned char *pixels) { #define CheckNumberCompactPixels \ if (packets == 0) \ return(i); \ packets-- #define CheckNumberPixels(count) \ if (((ssize_t) i...
{'deleted': [{'line_no': 124, 'char_start': 3556, 'char_end': 3588, 'line': ' CheckNumberCompactPixels;\n'}], 'added': [{'line_no': 86, 'char_start': 2325, 'char_end': 2357, 'line': ' CheckNumberCompactPixels;\n'}]}
{'deleted': [{'char_start': 3555, 'char_end': 3587, 'chars': '\n CheckNumberCompactPixels;'}], 'added': [{'char_start': 2331, 'char_end': 2363, 'chars': 'CheckNumberCompactPixels;\n '}]}
github.com/ImageMagick/ImageMagick/commit/30eec879c8b446b0ea9a3bb0da1a441cc8482bc4
coders/psd.c
cwe-125
1,174
cwe-079
mode_close
def mode_close(self, request): """ This is called by render_POST when the client is signalling that it is about to be closed. Args: request (Request): Incoming request. """ csessid = request.args.get('csessid')[0] try: sess = self.ses...
def mode_close(self, request): """ This is called by render_POST when the client is signalling that it is about to be closed. Args: request (Request): Incoming request. """ csessid = cgi.escape(request.args['csessid'][0]) try: sess = ...
{'deleted': [{'line_no': 10, 'char_start': 231, 'char_end': 280, 'line': " csessid = request.args.get('csessid')[0]\n"}], 'added': [{'line_no': 10, 'char_start': 231, 'char_end': 288, 'line': " csessid = cgi.escape(request.args['csessid'][0])\n"}]}
{'deleted': [{'char_start': 261, 'char_end': 266, 'chars': '.get('}, {'char_start': 275, 'char_end': 276, 'chars': ')'}], 'added': [{'char_start': 249, 'char_end': 260, 'chars': 'cgi.escape('}, {'char_start': 272, 'char_end': 273, 'chars': '['}, {'char_start': 282, 'char_end': 283, 'chars': ']'}, {'char_start': 286, 'c...
github.com/evennia/evennia/commit/300261529b82f95414c9d1d7150d6eda4695bb93
evennia/server/portal/webclient_ajax.py
cwe-079
104
cwe-089
delete_event
def delete_event(self, event_id): sql = """DELETE FROM events WHERE event_id = {0} """.format(event_id) affected_count = self.cur.execute(sql) self.conn.commit() return affected_count
def delete_event(self, event_id): sql = """ DELETE FROM events WHERE event_id = %s """ affected_count = self.cur.execute(sql, (event_id,)) self.conn.commit() return affected_count
{'deleted': [{'line_no': 2, 'char_start': 38, 'char_end': 74, 'line': ' sql = """DELETE FROM events\n'}, {'line_no': 3, 'char_start': 74, 'char_end': 112, 'line': ' WHERE event_id = {0}\n'}, {'line_no': 4, 'char_start': 112, 'char_end': 150, 'line': ' """.format(event_id)\n'}, {'l...
{'deleted': [{'char_start': 88, 'char_end': 91, 'chars': ' '}, {'char_start': 108, 'char_end': 111, 'chars': '{0}'}, {'char_start': 112, 'char_end': 115, 'chars': ' '}, {'char_start': 132, 'char_end': 149, 'chars': '.format(event_id)'}], 'added': [{'char_start': 55, 'char_end': 70, 'chars': '\n '}, {'c...
github.com/jgayfer/spirit/commit/01c846c534c8d3cf6763f8b7444a0efe2caa3799
db/dbase.py
cwe-089
49
cwe-125
ReadSGIImage
static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType status; MagickSizeType number_pixels; MemoryInfo *pixel_info; register Quantum *q; register ssize_t i, x; register unsigned char *p; SGIInfo iris_...
static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType status; MagickSizeType number_pixels; MemoryInfo *pixel_info; register Quantum *q; register ssize_t i, x; register unsigned char *p; SGIInfo iris_...
{'deleted': [{'line_no': 102, 'char_start': 2912, 'char_end': 2962, 'line': ' image->depth=(size_t) MagickMin((size_t) 8*\n'}, {'line_no': 103, 'char_start': 2962, 'char_end': 3023, 'line': ' iris_info.bytes_per_pixel,MAGICKCORE_QUANTUM_DEPTH);\n'}], 'added': [{'line_no': 102, 'char_start': 2912, 'char_end'...
{'deleted': [{'char_start': 2961, 'char_end': 2970, 'chars': '\n '}], 'added': [{'char_start': 2987, 'char_end': 2996, 'chars': '\n '}, {'char_start': 3176, 'char_end': 3284, 'chars': '\n if (EOFBlob(image) != MagickFalse)\n ThrowReaderException(CorruptImageError,"ImproperImageHeader");'}]}
github.com/ImageMagick/ImageMagick/commit/7afcf9f71043df15508e46f079387bd4689a738d
coders/sgi.c
cwe-125
3,922
cwe-078
_delete_3par_host
def _delete_3par_host(self, hostname): self._cli_run('removehost %s' % hostname, None)
def _delete_3par_host(self, hostname): self._cli_run(['removehost', hostname])
{'deleted': [{'line_no': 2, 'char_start': 43, 'char_end': 98, 'line': " self._cli_run('removehost %s' % hostname, None)\n"}], 'added': [{'line_no': 2, 'char_start': 43, 'char_end': 90, 'line': " self._cli_run(['removehost', hostname])\n"}]}
{'deleted': [{'char_start': 76, 'char_end': 79, 'chars': ' %s'}, {'char_start': 80, 'char_end': 82, 'chars': ' %'}, {'char_start': 91, 'char_end': 97, 'chars': ', None'}], 'added': [{'char_start': 65, 'char_end': 66, 'chars': '['}, {'char_start': 78, 'char_end': 79, 'chars': ','}, {'char_start': 88, 'char_end': 89, 'ch...
github.com/thatsdone/cinder/commit/c55589b131828f3a595903f6796cb2d0babb772f
cinder/volume/drivers/san/hp/hp_3par_common.py
cwe-078
28
cwe-089
getFileCacheID
def getFileCacheID(self, pth): """ Returns ID of a cached file on Telegram from DB. None if file doesn't exist or has no cached ID. :param pth: :return: """ command = "SELECT file_id FROM {0} WHERE path='{1}'".format(TABLE_NAME, pth) data = self._run_command(command) try: data = data[0][0] except...
def getFileCacheID(self, pth): """ Returns ID of a cached file on Telegram from DB. None if file doesn't exist or has no cached ID. :param pth: :return: """ command = "SELECT file_id FROM {0} WHERE path=?;".format(TABLE_NAME) params = (pth,) data = self._run_command(command, params) try: data = d...
{'deleted': [{'line_no': 7, 'char_start': 168, 'char_end': 247, 'line': '\t\tcommand = "SELECT file_id FROM {0} WHERE path=\'{1}\'".format(TABLE_NAME, pth)\n'}, {'line_no': 8, 'char_start': 247, 'char_end': 283, 'line': '\t\tdata = self._run_command(command)\n'}], 'added': [{'line_no': 7, 'char_start': 168, 'char_end':...
{'deleted': [{'char_start': 216, 'char_end': 221, 'chars': "'{1}'"}, {'char_start': 240, 'char_end': 241, 'chars': ','}], 'added': [{'char_start': 216, 'char_end': 218, 'chars': '?;'}, {'char_start': 237, 'char_end': 247, 'chars': ')\n\t\tparams'}, {'char_start': 248, 'char_end': 251, 'chars': '= ('}, {'char_start': 25...
github.com/Highstaker/Picture-sender-telegram-bot/commit/db4bc6adb41e086418761426ff4958a81c30adca
file_db.py
cwe-089
106
cwe-787
keycompare_mb
keycompare_mb (const struct line *a, const struct line *b) { struct keyfield *key = keylist; /* For the first iteration only, the key positions have been precomputed for us. */ char *texta = a->keybeg; char *textb = b->keybeg; char *lima = a->keylim; char *limb = b->keylim; size_t mblength_a, mblen...
keycompare_mb (const struct line *a, const struct line *b) { struct keyfield *key = keylist; /* For the first iteration only, the key positions have been precomputed for us. */ char *texta = a->keybeg; char *textb = b->keybeg; char *lima = a->keylim; char *limb = b->keylim; size_t mblength_a, mblen...
{'deleted': [{'line_no': 108, 'char_start': 5967, 'char_end': 6032, 'line': ' char *copy_a = (char *) xmalloc (lena + 1 + lenb + 1);\n'}, {'line_no': 109, 'char_start': 6032, 'char_end': 6076, 'line': ' char *copy_b = copy_a + lena + 1;\n'}], 'added': [{'line_no': 108, 'char_start': 5967, 'char_end': ...
{'deleted': [{'char_start': 6017, 'char_end': 6021, 'chars': '1 + '}, {'char_start': 6028, 'char_end': 6029, 'chars': '1'}], 'added': [{'char_start': 5977, 'char_end': 6046, 'chars': 'if (SIZE_MAX - lenb - 2 < lena)\n xalloc_die ();\n '}, {'char_start': 6071, 'char_end': 6072, 'chars': 'n'}, {'char_...
github.com/pixelb/coreutils/commit/bea5e36cc876ed627bb5e0eca36fdfaa6465e940
src/sort.c
cwe-787
1,707
cwe-079
edit_coordinator
@check_document_access_permission() def edit_coordinator(request): coordinator_id = request.GET.get('coordinator') doc = None if coordinator_id: doc = Document2.objects.get(id=coordinator_id) coordinator = Coordinator(document=doc) else: coordinator = Coordinator() api = get_oozie(request.user...
@check_document_access_permission() def edit_coordinator(request): coordinator_id = request.GET.get('coordinator') doc = None if coordinator_id: doc = Document2.objects.get(id=coordinator_id) coordinator = Coordinator(document=doc) else: coordinator = Coordinator() api = get_oozie(request.user...
{'deleted': [{'line_no': 27, 'char_start': 915, 'char_end': 959, 'line': " 'coordinator_json': coordinator.json,\n"}, {'line_no': 28, 'char_start': 959, 'char_end': 1029, 'line': " 'credentials_json': json.dumps(credentials.credentials.keys()),\n"}, {'line_no': 29, 'char_start': 1029, 'char_end': 1076, 'line'...
{'deleted': [], 'added': [{'char_start': 957, 'char_end': 968, 'chars': '_for_html()'}, {'char_start': 1037, 'char_end': 1061, 'chars': ', cls=JSONEncoderForHTML'}, {'char_start': 1108, 'char_end': 1132, 'chars': ', cls=JSONEncoderForHTML'}]}
github.com/gethue/hue/commit/6641c62beaa1468082e47d82da5ed758d11c7735
apps/oozie/src/oozie/views/editor2.py
cwe-079
271
cwe-089
retrieve_video
def retrieve_video(id, playlist_id, db): db.execute("SELECT id, position from video WHERE id={id} and playlist_id={playlist_id};".format( id=id, playlist_id=playlist_id)) row = db.fetchone() return row
def retrieve_video(id, playlist_id, db): db.execute( "SELECT id, position from video WHERE id=%s and playlist_id=%s;", (id, playlist_id)) row = db.fetchone() return row
{'deleted': [{'line_no': 2, 'char_start': 41, 'char_end': 142, 'line': ' db.execute("SELECT id, position from video WHERE id={id} and playlist_id={playlist_id};".format(\n'}, {'line_no': 3, 'char_start': 142, 'char_end': 183, 'line': ' id=id, playlist_id=playlist_id))\n'}], 'added': [{'line_no': 2, 'char_star...
{'deleted': [{'char_start': 97, 'char_end': 101, 'chars': '{id}'}, {'char_start': 118, 'char_end': 125, 'chars': '{playli'}, {'char_start': 126, 'char_end': 131, 'chars': 't_id}'}, {'char_start': 133, 'char_end': 140, 'chars': '.format'}, {'char_start': 141, 'char_end': 153, 'chars': '\n id='}, {'char_start': 15...
github.com/Madmous/playlist/commit/666e52c5f0b8c1f4296e84471637033d9542a7a6
video/video_repository.py
cwe-089
54
cwe-476
IRC_PROTOCOL_CALLBACK
IRC_PROTOCOL_CALLBACK(352) { char *pos_attr, *pos_hopcount, *pos_realname, *str_host; int arg_start, length; struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick; IRC_PROTOCOL_MIN_ARGS(5); /* silently ignore malformed 352 message (missing infos) */ if (argc < 8) return WE...
IRC_PROTOCOL_CALLBACK(352) { char *pos_attr, *pos_hopcount, *pos_realname, *str_host; int arg_start, length; struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick; IRC_PROTOCOL_MIN_ARGS(5); /* silently ignore malformed 352 message (missing infos) */ if (argc < 8) return WE...
{'deleted': [{'line_no': 20, 'char_start': 430, 'char_end': 488, 'line': ' arg_start = (strcmp (argv[8], "*") == 0) ? 9 : 8;\n'}], 'added': [{'line_no': 20, 'char_start': 430, 'char_end': 504, 'line': ' arg_start = ((argc > 9) && (strcmp (argv[8], "*") == 0)) ? 9 : 8;\n'}]}
{'deleted': [], 'added': [{'char_start': 451, 'char_end': 466, 'chars': '(argc > 9) && ('}, {'char_start': 492, 'char_end': 493, 'chars': ')'}]}
github.com/weechat/weechat/commit/9904cb6d2eb40f679d8ff6557c22d53a3e3dc75a
src/plugins/irc/irc-protocol.c
cwe-476
859
cwe-125
tflite::GetOptionalInputTensor
const TfLiteTensor* GetOptionalInputTensor(const TfLiteContext* context, const TfLiteNode* node, int index) { const bool use_tensor = index < node->inputs->size && node->inputs->data[index] != kTfLiteOptionalTensor; if (use_tensor) { return Ge...
const TfLiteTensor* GetOptionalInputTensor(const TfLiteContext* context, const TfLiteNode* node, int index) { return GetInput(context, node, index); }
{'deleted': [{'line_no': 3, 'char_start': 153, 'char_end': 209, 'line': ' const bool use_tensor = index < node->inputs->size &&\n'}, {'line_no': 4, 'char_start': 209, 'char_end': 287, 'line': ' node->inputs->data[index] != kTfLiteOptionalTensor;\n'}, {'line_no': 5, 'char_start': 287, 'char_end...
{'deleted': [{'char_start': 155, 'char_end': 311, 'chars': 'const bool use_tensor = index < node->inputs->size &&\n node->inputs->data[index] != kTfLiteOptionalTensor;\n if (use_tensor) {\n '}, {'char_start': 321, 'char_end': 328, 'chars': 'Mutable'}, {'char_start': 355, 'char_end': 377, 'c...
github.com/tensorflow/tensorflow/commit/00302787b788c5ff04cb6f62aed5a74d936e86c0
tensorflow/lite/kernels/kernel_util.cc
cwe-125
83
cwe-416
rm_read_multi
static int rm_read_multi(AVFormatContext *s, AVIOContext *pb, AVStream *st, char *mime) { int number_of_streams = avio_rb16(pb); int number_of_mdpr; int i, ret; unsigned size2; for (i = 0; i<number_of_streams; i++) avio_rb16(pb); number_of_mdpr = avio_rb16(pb); ...
static int rm_read_multi(AVFormatContext *s, AVIOContext *pb, AVStream *st, char *mime) { int number_of_streams = avio_rb16(pb); int number_of_mdpr; int i, ret; unsigned size2; for (i = 0; i<number_of_streams; i++) avio_rb16(pb); number_of_mdpr = avio_rb16(pb); ...
{'deleted': [{'line_no': 35, 'char_start': 1195, 'char_end': 1249, 'line': ' size2, mime);\n'}], 'added': [{'line_no': 35, 'char_start': 1195, 'char_end': 1249, 'line': ' size2, NULL);\n'}]}
{'deleted': [{'char_start': 1242, 'char_end': 1246, 'chars': 'mime'}], 'added': [{'char_start': 1242, 'char_end': 1246, 'chars': 'NULL'}]}
github.com/FFmpeg/FFmpeg/commit/a7e032a277452366771951e29fd0bf2bd5c029f0
libavformat/rmdec.c
cwe-416
374
cwe-125
saa7164_bus_get
int saa7164_bus_get(struct saa7164_dev *dev, struct tmComResInfo* msg, void *buf, int peekonly) { struct tmComResBusInfo *bus = &dev->bus; u32 bytes_to_read, write_distance, curr_grp, curr_gwp, new_grp, buf_size, space_rem; struct tmComResInfo msg_tmp; int ret = SAA_ERR_BAD_PARAMETER; saa7164_bus_verify(dev); ...
int saa7164_bus_get(struct saa7164_dev *dev, struct tmComResInfo* msg, void *buf, int peekonly) { struct tmComResBusInfo *bus = &dev->bus; u32 bytes_to_read, write_distance, curr_grp, curr_gwp, new_grp, buf_size, space_rem; struct tmComResInfo msg_tmp; int ret = SAA_ERR_BAD_PARAMETER; saa7164_bus_verify(dev); ...
{'deleted': [{'line_no': 82, 'char_start': 2348, 'char_end': 2387, 'line': '\t\tmemcpy(msg, &msg_tmp, sizeof(*msg));\n'}, {'line_no': 127, 'char_start': 3732, 'char_end': 3767, 'line': '\t\t\t/* msg wraps around the ring */\n'}, {'line_no': 128, 'char_start': 3767, 'char_end': 3831, 'line': '\t\t\tmemcpy_fromio(msg, bu...
{'deleted': [{'char_start': 2348, 'char_end': 2387, 'chars': '\t\tmemcpy(msg, &msg_tmp, sizeof(*msg));\n'}, {'char_start': 3732, 'char_end': 3921, 'chars': '\t\t\t/* msg wraps around the ring */\n\t\t\tmemcpy_fromio(msg, bus->m_pdwGetRing + curr_grp, space_rem);\n\t\t\tmemcpy_fromio((u8 *)msg + space_rem, bus->m_pdwGet...
github.com/stoth68000/media-tree/commit/354dd3924a2e43806774953de536257548b5002c
drivers/media/pci/saa7164/saa7164-bus.c
cwe-125
1,559
cwe-089
get_all_referrers
@app.route('/get_all_referrers') def get_all_referrers(): account_id = request.args.get('account_id') if not isObject(account_id): ws.send('{"id":1, "method":"call", "params":[0,"lookup_account_names",[["' + account_id + '"], 0]]}') result_l = ws.recv() j_l = json.loads(result_l) ...
@app.route('/get_all_referrers') def get_all_referrers(): account_id = request.args.get('account_id') if not isObject(account_id): ws.send('{"id":1, "method":"call", "params":[0,"lookup_account_names",[["' + account_id + '"], 0]]}') result_l = ws.recv() j_l = json.loads(result_l) ...
{'deleted': [{'line_no': 15, 'char_start': 430, 'char_end': 500, 'line': ' query = "select * from referrers where referrer=\'"+account_id+"\'"\n'}, {'line_no': 16, 'char_start': 500, 'char_end': 523, 'line': ' cur.execute(query)\n'}], 'added': [{'line_no': 15, 'char_start': 430, 'char_end': 486, 'line': ' quer...
{'deleted': [{'char_start': 482, 'char_end': 498, 'chars': '\'"+account_id+"\''}], 'added': [{'char_start': 482, 'char_end': 484, 'chars': '%s'}, {'char_start': 507, 'char_end': 522, 'chars': ', (account_id,)'}]}
github.com/VinChain/vinchain-python-api-backend/commit/b78088a551fbb712121269c6eb7f43ede120ff60
api.py
cwe-089
150
cwe-190
PyImaging_MapBuffer
PyImaging_MapBuffer(PyObject* self, PyObject* args) { Py_ssize_t y, size; Imaging im; PyObject* target; Py_buffer view; char* mode; char* codec; PyObject* bbox; Py_ssize_t offset; int xsize, ysize; int stride; int ystep; if (!PyArg_ParseTuple(args, "O(ii)sOn(sii)", &tar...
PyImaging_MapBuffer(PyObject* self, PyObject* args) { Py_ssize_t y, size; Imaging im; PyObject* target; Py_buffer view; char* mode; char* codec; PyObject* bbox; Py_ssize_t offset; int xsize, ysize; int stride; int ystep; if (!PyArg_ParseTuple(args, "O(ii)sOn(sii)", &tar...
{'deleted': [], 'added': [{'line_no': 34, 'char_start': 812, 'char_end': 848, 'line': ' if (ysize > INT_MAX / stride) {\n'}, {'line_no': 35, 'char_start': 848, 'char_end': 921, 'line': ' PyErr_SetString(PyExc_MemoryError, "Integer overflow in ysize");\n'}, {'line_no': 36, 'char_start': 921, 'char_end': 942, '...
{'deleted': [], 'added': [{'char_start': 816, 'char_end': 953, 'chars': 'if (ysize > INT_MAX / stride) {\n PyErr_SetString(PyExc_MemoryError, "Integer overflow in ysize");\n return NULL;\n }\n\n '}, {'char_start': 988, 'char_end': 1134, 'chars': '\n\n if (offset > SIZE_MAX - size) {\n PyEr...
github.com/python-pillow/Pillow/commit/c50ebe6459a131a1ea8ca531f10da616d3ceaa0f
map.c
cwe-190
525
cwe-078
openscript
openscript( char_u *name, int directly) /* when TRUE execute directly */ { if (curscript + 1 == NSCRIPT) { emsg(_(e_nesting)); return; } #ifdef FEAT_EVAL if (ignore_script) /* Not reading from script, also don't open one. Warning message? */ return; #endif if (scriptin[curscript] != N...
openscript( char_u *name, int directly) /* when TRUE execute directly */ { if (curscript + 1 == NSCRIPT) { emsg(_(e_nesting)); return; } // Disallow sourcing a file in the sandbox, the commands would be executed // later, possibly outside of the sandbox. if (check_secure()) return; ...
{'deleted': [], 'added': [{'line_no': 10, 'char_start': 160, 'char_end': 161, 'line': '\n'}, {'line_no': 13, 'char_start': 287, 'char_end': 311, 'line': ' if (check_secure())\n'}, {'line_no': 14, 'char_start': 311, 'char_end': 320, 'line': '\treturn;\n'}, {'line_no': 15, 'char_start': 320, 'char_end': 321, 'line': '...
{'deleted': [], 'added': [{'char_start': 160, 'char_end': 321, 'chars': '\n // Disallow sourcing a file in the sandbox, the commands would be executed\n // later, possibly outside of the sandbox.\n if (check_secure())\n\treturn;\n\n'}]}
github.com/vim/vim/commit/53575521406739cf20bbe4e384d88e7dca11f040
src/getchar.c
cwe-078
498
cwe-078
test_settings_path_skip_issue_909
def test_settings_path_skip_issue_909(tmpdir): base_dir = tmpdir.mkdir('project') config_dir = base_dir.mkdir('conf') config_dir.join('.isort.cfg').write('[isort]\n' 'skip =\n' ' file_to_be_skipped.py\n' ...
def test_settings_path_skip_issue_909(tmpdir): base_dir = tmpdir.mkdir('project') config_dir = base_dir.mkdir('conf') config_dir.join('.isort.cfg').write('[isort]\n' 'skip =\n' ' file_to_be_skipped.py\n' ...
{'deleted': [{'line_no': 24, 'char_start': 1201, 'char_end': 1249, 'line': " check_output(['isort', '--check-only'])\n"}, {'line_no': 25, 'char_start': 1249, 'char_end': 1338, 'line': " results = check_output(['isort', '--check-only', '--settings-path=conf/.isort.cfg'])\n"}, {'line_no': 28, 'char_start': 1377...
{'deleted': [{'char_start': 1209, 'char_end': 1216, 'chars': 'check_o'}, {'char_start': 1217, 'char_end': 1218, 'chars': 't'}, {'char_start': 1220, 'char_end': 1221, 'chars': 't'}, {'char_start': 1259, 'char_end': 1260, 'chars': 's'}, {'char_start': 1264, 'char_end': 1265, 'chars': 'h'}, {'char_start': 1266, 'char_end'...
github.com/timothycrosley/isort/commit/1ab38f4f7840a3c19bf961a24630a992a8373a76
test_isort.py
cwe-078
257
cwe-787
next_state_val
next_state_val(CClassNode* cc, OnigCodePoint *vs, OnigCodePoint v, int* vs_israw, int v_israw, enum CCVALTYPE intype, enum CCVALTYPE* type, enum CCSTATE* state, ScanEnv* env) { int r; switch (*state) { case CCS_VALUE: if (*type == CCV_SB) { BITSET_SET_BIT(cc->bs, (int )(*vs)); ...
next_state_val(CClassNode* cc, OnigCodePoint *vs, OnigCodePoint v, int* vs_israw, int v_israw, enum CCVALTYPE intype, enum CCVALTYPE* type, enum CCSTATE* state, ScanEnv* env) { int r; switch (*state) { case CCS_VALUE: if (*type == CCV_SB) { if (*vs > 0xff) return ONIGE...
{'deleted': [], 'added': [{'line_no': 11, 'char_start': 276, 'char_end': 298, 'line': ' if (*vs > 0xff)\n'}, {'line_no': 12, 'char_start': 298, 'char_end': 349, 'line': ' return ONIGERR_INVALID_CODE_POINT_VALUE;\n'}, {'line_no': 13, 'char_start': 349, 'char_end': 350, 'line': '\n'}]}
{'deleted': [], 'added': [{'char_start': 282, 'char_end': 356, 'chars': 'if (*vs > 0xff)\n return ONIGERR_INVALID_CODE_POINT_VALUE;\n\n '}]}
github.com/kkos/oniguruma/commit/b4bf968ad52afe14e60a2dc8a95d3555c543353a
src/regparse.c
cwe-787
558
cwe-089
__init__.view_grocery_list
def view_grocery_list(): print("grocery== list") groceryListFrame = Frame(self) groceryListFrame.rowconfigure(0, weight=1) groceryListFrame.columnconfigure(0, weight=1) groceryListFrame.rowconfigure(1, weight=3) groceryListFrame.columnconfi...
def view_grocery_list(): print("grocery== list") groceryListFrame = Frame(self) groceryListFrame.rowconfigure(0, weight=1) groceryListFrame.columnconfigure(0, weight=1) groceryListFrame.rowconfigure(1, weight=3) groceryListFrame.columnconfi...
{'deleted': [{'line_no': 20, 'char_start': 745, 'char_end': 822, 'line': ' selection = cursor.execute("""SELECT * FROM """ + tableName)\n'}], 'added': [{'line_no': 20, 'char_start': 745, 'char_end': 827, 'line': ' selection = cursor.execute("""SELECT * FROM ?;""", (tableName, ))\n'}]}
{'deleted': [{'char_start': 809, 'char_end': 811, 'chars': '+ '}], 'added': [{'char_start': 805, 'char_end': 807, 'chars': '?;'}, {'char_start': 810, 'char_end': 811, 'chars': ','}, {'char_start': 812, 'char_end': 813, 'chars': '('}, {'char_start': 822, 'char_end': 825, 'chars': ', )'}]}
github.com/trishamoyer/RecipePlanner-Python/commit/44d2ce370715d9344fad34b3b749322ab095a925
mealPlan.py
cwe-089
336
cwe-476
upnp_redirect
upnp_redirect(const char * rhost, unsigned short eport, const char * iaddr, unsigned short iport, const char * protocol, const char * desc, unsigned int leaseduration) { int proto, r; char iaddr_old[32]; char rhost_old[32]; unsigned short iport_old; struct in_addr address;...
upnp_redirect(const char * rhost, unsigned short eport, const char * iaddr, unsigned short iport, const char * protocol, const char * desc, unsigned int leaseduration) { int proto, r; char iaddr_old[32]; char rhost_old[32]; unsigned short iport_old; struct in_addr address;...
{'deleted': [], 'added': [{'line_no': 25, 'char_start': 767, 'char_end': 768, 'line': '\n'}, {'line_no': 26, 'char_start': 768, 'char_end': 787, 'line': '\tif (desc == NULL)\n'}, {'line_no': 27, 'char_start': 787, 'char_end': 831, 'line': '\t\tdesc = "";\t/* assume empty description */\n'}, {'line_no': 28, 'char_start'...
{'deleted': [], 'added': [{'char_start': 767, 'char_end': 832, 'chars': '\n\tif (desc == NULL)\n\t\tdesc = "";\t/* assume empty description */\n\n'}]}
github.com/miniupnp/miniupnp/commit/f321c2066b96d18afa5158dfa2d2873a2957ef38
miniupnpd/upnpredirect.c
cwe-476
1,182
cwe-125
opmov
static int opmov(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; st64 offset = 0; int mod = 0; int base = 0; int rex = 0; ut64 immediate = 0; if (op->operands[1].type & OT_CONSTANT) { if (!op->operands[1].is_good_flag) { return -1; } if (op->operands[1].immediate == -1) { return -1; } immediat...
static int opmov(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; st64 offset = 0; int mod = 0; int base = 0; int rex = 0; ut64 immediate = 0; if (op->operands[1].type & OT_CONSTANT) { if (!op->operands[1].is_good_flag) { return -1; } if (op->operands[1].immediate == -1) { return -1; } immediat...
{'deleted': [{'line_no': 352, 'char_start': 9435, 'char_end': 9493, 'line': '\t\t\tdata[l++] = SEG_REG_PREFIXES[op->operands[1].regs[0]];\n'}, {'line_no': 354, 'char_start': 9514, 'char_end': 9561, 'line': '\t\t\tdata[l++] = op->operands[0].reg << 3 | 0x5;\n'}], 'added': [{'line_no': 352, 'char_start': 9435, 'char_end'...
{'deleted': [], 'added': [{'char_start': 9490, 'char_end': 9494, 'chars': ' % 6'}, {'char_start': 9533, 'char_end': 9541, 'chars': '(((ut32)'}, {'char_start': 9560, 'char_end': 9561, 'chars': ')'}, {'char_start': 9566, 'char_end': 9567, 'chars': ')'}]}
github.com/radare/radare2/commit/f17bfd9f1da05f30f23a4dd05e9d2363e1406948
libr/asm/p/asm_x86_nz.c
cwe-125
5,165
cwe-078
IsBlacklistedArg
bool IsBlacklistedArg(const base::CommandLine::CharType* arg) { #if defined(OS_WIN) const auto converted = base::WideToUTF8(arg); const char* a = converted.c_str(); #else const char* a = arg; #endif static const char* prefixes[] = {"--", "-", "/"}; int prefix_length = 0; for (auto& prefix : prefixes) { ...
bool IsBlacklistedArg(const base::CommandLine::CharType* arg) { #if defined(OS_WIN) const auto converted = base::WideToUTF8(arg); const char* a = converted.c_str(); #else const char* a = arg; #endif static const char* prefixes[] = {"--", "-", "/"}; int prefix_length = 0; for (auto& prefix : prefixes) { ...
{'deleted': [{'line_no': 21, 'char_start': 500, 'char_end': 549, 'line': ' std::string switch_name(a, strcspn(a, "="));\n'}], 'added': [{'line_no': 21, 'char_start': 500, 'char_end': 530, 'line': ' std::string switch_name =\n'}, {'line_no': 22, 'char_start': 530, 'char_end': 597, 'line': ' base::ToLowerASC...
{'deleted': [], 'added': [{'char_start': 527, 'char_end': 574, 'chars': ' =\n base::ToLowerASCII(base::StringPiece'}, {'char_start': 592, 'char_end': 593, 'chars': ')'}]}
github.com/electron/electron/commit/ce361a12e355f9e1e99c989f1ea056c9e502dbe7
atom/app/command_line_args.cc
cwe-078
214
cwe-022
cut
def cut(self, key): try: self.etcd.delete(os.path.join(self.namespace, key)) except etcd.EtcdKeyNotFound: return False except etcd.EtcdException as err: log_error("Error removing key %s: [%r]" % (key, repr(err))) raise CSStoreError('Error occur...
def cut(self, key): try: self.etcd.delete(self._absolute_key(key)) except etcd.EtcdKeyNotFound: return False except etcd.EtcdException as err: log_error("Error removing key %s: [%r]" % (key, repr(err))) raise CSStoreError('Error occurred while ...
{'deleted': [{'line_no': 3, 'char_start': 37, 'char_end': 101, 'line': ' self.etcd.delete(os.path.join(self.namespace, key))\n'}], 'added': [{'line_no': 3, 'char_start': 37, 'char_end': 91, 'line': ' self.etcd.delete(self._absolute_key(key))\n'}]}
{'deleted': [{'char_start': 66, 'char_end': 79, 'chars': 'os.path.join('}, {'char_start': 84, 'char_end': 85, 'chars': 'n'}, {'char_start': 86, 'char_end': 88, 'chars': 'me'}, {'char_start': 89, 'char_end': 92, 'chars': 'pac'}, {'char_start': 93, 'char_end': 95, 'chars': ', '}], 'added': [{'char_start': 71, 'char_end':...
github.com/latchset/custodia/commit/785fc87f38b4811bc4ce43a0a9b2267ee7d500b4
custodia/store/etcdstore.py
cwe-022
85
cwe-078
mkdir
def mkdir(self, data, path): credentials = self._formatCredentials(data, name='current') command = ( '{credentials} ' 'rclone touch current:{path}/.keep' ).format( credentials=credentials, path=path, ) try: result ...
def mkdir(self, data, path): credentials = self._formatCredentials(data, name='current') command = [ 'rclone', 'touch', 'current:{}/.keep'.format(path), ] try: result = self._execute(command, credentials) return { ...
{'deleted': [{'line_no': 3, 'char_start': 101, 'char_end': 102, 'line': '\n'}, {'line_no': 4, 'char_start': 102, 'char_end': 122, 'line': ' command = (\n'}, {'line_no': 5, 'char_start': 122, 'char_end': 151, 'line': " '{credentials} '\n"}, {'line_no': 6, 'char_start': 151, 'char_end': 199, 'line': " ...
{'deleted': [{'char_start': 101, 'char_end': 102, 'chars': '\n'}, {'char_start': 120, 'char_end': 121, 'chars': '('}, {'char_start': 135, 'char_end': 137, 'chars': '{c'}, {'char_start': 138, 'char_end': 145, 'chars': 'edentia'}, {'char_start': 146, 'char_end': 149, 'chars': 's} '}, {'char_start': 164, 'char_end': 171, ...
github.com/FredHutch/motuz/commit/045468cb9bff47bb3bb72268b6d5a3fe44e383db
src/backend/api/utils/rclone_connection.py
cwe-078
101
cwe-416
Magick::Image::read
void Magick::Image::read(MagickCore::Image *image, MagickCore::ExceptionInfo *exceptionInfo) { // Ensure that multiple image frames were not read. if (image != (MagickCore::Image *) NULL && image->next != (MagickCore::Image *) NULL) { MagickCore::Image *next; // Destroy any extra im...
void Magick::Image::read(MagickCore::Image *image, MagickCore::ExceptionInfo *exceptionInfo) { // Ensure that multiple image frames were not read. if (image != (MagickCore::Image *) NULL && image->next != (MagickCore::Image *) NULL) { MagickCore::Image *next; // Destroy any extra im...
{'deleted': [], 'added': [{'line_no': 25, 'char_start': 799, 'char_end': 813, 'line': ' return;\n'}]}
{'deleted': [], 'added': [{'char_start': 803, 'char_end': 817, 'chars': ' return;\n '}]}
github.com/ImageMagick/ImageMagick/commit/8c35502217c1879cb8257c617007282eee3fe1cc
Magick++/lib/Image.cpp
cwe-416
203
cwe-787
WritePSDChannel
static size_t WritePSDChannel(const PSDInfo *psd_info, const ImageInfo *image_info,Image *image,Image *next_image, const QuantumType quantum_type, unsigned char *compact_pixels, MagickOffsetType size_offset,const MagickBooleanType separate, ExceptionInfo *exception) { int y; MagickBooleanType monoc...
static size_t WritePSDChannel(const PSDInfo *psd_info, const ImageInfo *image_info,Image *image,Image *next_image, const QuantumType quantum_type, unsigned char *compact_pixels, MagickOffsetType size_offset,const MagickBooleanType separate, ExceptionInfo *exception) { int y; MagickBooleanType monoc...
{'deleted': [{'line_no': 56, 'char_start': 1009, 'char_end': 1062, 'line': ' quantum_info=AcquireQuantumInfo(image_info,image);\n'}], 'added': [{'line_no': 56, 'char_start': 1009, 'char_end': 1067, 'line': ' quantum_info=AcquireQuantumInfo(image_info,next_image);\n'}]}
{'deleted': [], 'added': [{'char_start': 1054, 'char_end': 1059, 'chars': 'next_'}]}
github.com/ImageMagick/ImageMagick/commit/91cc3f36f2ccbd485a0456bab9aebe63b635da88
coders/psd.c
cwe-787
924
cwe-190
SWFInput_readSBits
SWFInput_readSBits(SWFInput input, int number) { int num = SWFInput_readBits(input, number); if ( num & (1<<(number-1)) ) return num - (1<<number); else return num; }
SWFInput_readSBits(SWFInput input, int number) { int num = SWFInput_readBits(input, number); if(number && num & (1<<(number-1))) return num - (1<<number); else return num; }
{'deleted': [{'line_no': 5, 'char_start': 95, 'char_end': 125, 'line': '\tif ( num & (1<<(number-1)) )\n'}], 'added': [{'line_no': 5, 'char_start': 95, 'char_end': 132, 'line': '\tif(number && num & (1<<(number-1)))\n'}]}
{'deleted': [{'char_start': 98, 'char_end': 99, 'chars': ' '}, {'char_start': 122, 'char_end': 123, 'chars': ' '}], 'added': [{'char_start': 98, 'char_end': 105, 'chars': '(number'}, {'char_start': 106, 'char_end': 108, 'chars': '&&'}]}
github.com/libming/libming/commit/2223f7a1e431455a1411bee77c90db94a6f8e8fe
src/blocks/input.c
cwe-190
55
cwe-416
wwunpack
int wwunpack(uint8_t *exe, uint32_t exesz, uint8_t *wwsect, struct cli_exe_section *sects, uint16_t scount, uint32_t pe, int desc) { uint8_t *structs = wwsect + 0x2a1, *compd, *ccur, *unpd, *ucur, bc; uint32_t src, srcend, szd, bt, bits; int error=0, i; cli_dbgmsg("in wwunpack\n"); while (1) { if (!CLI_I...
int wwunpack(uint8_t *exe, uint32_t exesz, uint8_t *wwsect, struct cli_exe_section *sects, uint16_t scount, uint32_t pe, int desc) { uint8_t *structs = wwsect + 0x2a1, *compd, *ccur, *unpd, *ucur, bc; uint32_t src, srcend, szd, bt, bits; int error=0, i; cli_dbgmsg("in wwunpack\n"); while (1) { if (!CLI_I...
{'deleted': [], 'added': [{'line_no': 155, 'char_start': 3541, 'char_end': 3613, 'line': ' if (!CLI_ISCONTAINED(wwsect, sects[scount].rsz, wwsect+0x295, 4) ||\n'}, {'line_no': 156, 'char_start': 3613, 'char_end': 3703, 'line': ' !CLI_ISCONTAINED(wwsect, sects[scount].rsz, wwsect+0x295+sects[scount].rva, 4) ||...
{'deleted': [], 'added': [{'char_start': 3545, 'char_end': 3906, 'chars': 'if (!CLI_ISCONTAINED(wwsect, sects[scount].rsz, wwsect+0x295, 4) ||\n !CLI_ISCONTAINED(wwsect, sects[scount].rsz, wwsect+0x295+sects[scount].rva, 4) ||\n !CLI_ISCONTAINED(wwsect, sects[scount].rsz, wwsect+0x295+sects[scount].rva+0x...
github.com/vrtadmin/clamav-devel/commit/dfc00cd3301a42b571454b51a6102eecf58407bc
libclamav/wwunpack.c
cwe-416
1,656
cwe-416
mrb_io_initialize_copy
mrb_io_initialize_copy(mrb_state *mrb, mrb_value copy) { mrb_value orig; mrb_value buf; struct mrb_io *fptr_copy; struct mrb_io *fptr_orig; mrb_bool failed = TRUE; mrb_get_args(mrb, "o", &orig); fptr_copy = (struct mrb_io *)DATA_PTR(copy); if (fptr_copy != NULL) { fptr_finalize(mrb, fptr_copy, FALS...
mrb_io_initialize_copy(mrb_state *mrb, mrb_value copy) { mrb_value orig; mrb_value buf; struct mrb_io *fptr_copy; struct mrb_io *fptr_orig; mrb_bool failed = TRUE; mrb_get_args(mrb, "o", &orig); fptr_orig = io_get_open_fptr(mrb, orig); fptr_copy = (struct mrb_io *)DATA_PTR(copy); if (fptr_copy != NUL...
{'deleted': [{'line_no': 16, 'char_start': 408, 'char_end': 451, 'line': ' fptr_orig = io_get_open_fptr(mrb, orig);\n'}], 'added': [{'line_no': 10, 'char_start': 208, 'char_end': 251, 'line': ' fptr_orig = io_get_open_fptr(mrb, orig);\n'}]}
{'deleted': [{'char_start': 405, 'char_end': 448, 'chars': ');\n fptr_orig = io_get_open_fptr(mrb, orig'}], 'added': [{'char_start': 215, 'char_end': 258, 'chars': 'orig = io_get_open_fptr(mrb, orig);\n fptr_'}]}
github.com/mruby/mruby/commit/b51b21fc63c9805862322551387d9036f2b63433
mrbgems/mruby-io/src/io.c
cwe-416
423
cwe-787
opj_pi_create_decode
opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image, opj_cp_t *p_cp, OPJ_UINT32 p_tile_no) { /* loop */ OPJ_UINT32 pino; OPJ_UINT32 compno, resno; /* to store w, h, dx and dy fro all components and resolutions */ OPJ_UINT32 * l_tmp_data; OPJ_UINT32 ** l_tmp_ptr; /* encoding pramete...
opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image, opj_cp_t *p_cp, OPJ_UINT32 p_tile_no) { /* loop */ OPJ_UINT32 pino; OPJ_UINT32 compno, resno; /* to store w, h, dx and dy fro all components and resolutions */ OPJ_UINT32 * l_tmp_data; OPJ_UINT32 ** l_tmp_ptr; /* encoding pramete...
{'deleted': [{'line_no': 86, 'char_start': 2139, 'char_end': 2242, 'line': '\tl_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16));\n'}], 'added': [{'line_no': 86, 'char_start': 2139, 'char_end': 2180, 'line': '\t/* prevent an integer overflow issue */\n'}, {'line_no': 87...
{'deleted': [], 'added': [{'char_start': 2140, 'char_end': 2269, 'chars': '/* prevent an integer overflow issue */\n\tl_current_pi->include = 00;\n\tif (l_step_l <= (SIZE_MAX / (l_tcp->numlayers + 1U)))\n\t{\n\t\t'}, {'char_start': 2370, 'char_end': 2374, 'chars': '\n\t}\n'}]}
github.com/uclouvain/openjpeg/commit/c16bc057ba3f125051c9966cf1f5b68a05681de4
src/lib/openjp2/pi.c
cwe-787
1,762
cwe-078
fetch
def fetch(url): '''Download and verify a package url.''' base = os.path.basename(url) print('Fetching %s...' % base) fetch_file(url + '.asc') fetch_file(url) fetch_file(url + '.sha256') fetch_file(url + '.asc.sha256') print('Verifying %s...' % base) # TODO: check for verification failure. os.system(...
def fetch(url): '''Download and verify a package url.''' base = os.path.basename(url) print('Fetching %s...' % base) fetch_file(url + '.asc') fetch_file(url) fetch_file(url + '.sha256') fetch_file(url + '.asc.sha256') print('Verifying %s...' % base) # TODO: check for verification failure. subprocess...
{'deleted': [{'line_no': 11, 'char_start': 308, 'char_end': 350, 'line': " os.system('shasum -c %s.sha256' % base)\n"}, {'line_no': 12, 'char_start': 350, 'char_end': 396, 'line': " os.system('shasum -c %s.asc.sha256' % base)\n"}, {'line_no': 13, 'char_start': 396, 'char_end': 449, 'line': " os.system('gpg --verify ...
{'deleted': [{'char_start': 312, 'char_end': 313, 'chars': '.'}, {'char_start': 314, 'char_end': 317, 'chars': 'yst'}, {'char_start': 318, 'char_end': 319, 'chars': 'm'}, {'char_start': 331, 'char_end': 332, 'chars': '%'}, {'char_start': 341, 'char_end': 348, 'chars': ' % base'}, {'char_start': 353, 'char_end': 355, 'c...
github.com/rillian/rust-build/commit/b8af51e5811fcb35eff9e1e3e91c98490e7a7dcb
repack_rust.py
cwe-078
160
cwe-022
create_dump_dir_from_problem_data
struct dump_dir *create_dump_dir_from_problem_data(problem_data_t *problem_data, const char *base_dir_name) { INITIALIZE_LIBREPORT(); char *type = problem_data_get_content_or_NULL(problem_data, FILENAME_ANALYZER); if (!type) { error_msg(_("Missing required item: '%s'"), FILENAME_ANALYZER); ...
struct dump_dir *create_dump_dir_from_problem_data(problem_data_t *problem_data, const char *base_dir_name) { INITIALIZE_LIBREPORT(); char *type = problem_data_get_content_or_NULL(problem_data, FILENAME_ANALYZER); if (!type) { error_msg(_("Missing required item: '%s'"), FILENAME_ANALYZER); ...
{'deleted': [{'line_no': 90, 'char_start': 2743, 'char_end': 2817, 'line': " /* only files should contain '/' and those are handled earlier */\n"}, {'line_no': 91, 'char_start': 2817, 'char_end': 2866, 'line': " if (name[0] == '.' || strchr(name, '/'))\n"}, {'line_no': 92, 'char_start': 2866, 'char_end': ...
{'deleted': [{'char_start': 2709, 'char_end': 2963, 'chars': '\n continue;\n }\n\n /* only files should contain \'/\' and those are handled earlier */\n if (name[0] == \'.\' || strchr(name, \'/\'))\n {\n error_msg("Problem data field name contains disallowed chars: \'%s...
github.com/abrt/libreport/commit/239c4f7d1f47265526b39ad70106767d00805277
src/lib/create_dump_dir.c
cwe-022
933
cwe-022
compose_path
char *compose_path(ctrl_t *ctrl, char *path) { struct stat st; static char rpath[PATH_MAX]; char *name, *ptr; char dir[PATH_MAX] = { 0 }; strlcpy(dir, ctrl->cwd, sizeof(dir)); DBG("Compose path from cwd: %s, arg: %s", ctrl->cwd, path ?: ""); if (!path || !strlen(path)) goto check; if (path) { if (path[0] ...
char *compose_path(ctrl_t *ctrl, char *path) { struct stat st; static char rpath[PATH_MAX]; char *name, *ptr; char dir[PATH_MAX] = { 0 }; strlcpy(dir, ctrl->cwd, sizeof(dir)); DBG("Compose path from cwd: %s, arg: %s", ctrl->cwd, path ?: ""); if (!path || !strlen(path)) goto check; if (path) { if (path[0] ...
{'deleted': [{'line_no': 63, 'char_start': 1460, 'char_end': 1514, 'line': '\tif (!chrooted && strncmp(dir, home, strlen(home))) {\n'}], 'added': [{'line_no': 63, 'char_start': 1460, 'char_end': 1516, 'line': '\tif (!chrooted && strncmp(rpath, home, strlen(home))) {\n'}]}
{'deleted': [{'char_start': 1486, 'char_end': 1488, 'chars': 'di'}], 'added': [{'char_start': 1487, 'char_end': 1491, 'chars': 'path'}]}
github.com/troglobit/uftpd/commit/455b47d3756aed162d2d0ef7f40b549f3b5b30fe
src/common.c
cwe-022
512
cwe-022
get_paths
def get_paths(base_path: pathlib.Path): data_file = pathlib.Path(str(base_path) + ".data") metadata_file = pathlib.Path(str(base_path) + ".meta") return data_file, metadata_file
def get_paths(root: str, sub_path: str) \ -> typing.Tuple[pathlib.Path, pathlib.Path]: base_path = flask.safe_join(root, sub_path) data_file = pathlib.Path(base_path + ".data") metadata_file = pathlib.Path(base_path + ".meta") return data_file, metadata_file
{'deleted': [{'line_no': 1, 'char_start': 0, 'char_end': 40, 'line': 'def get_paths(base_path: pathlib.Path):\n'}], 'added': [{'line_no': 1, 'char_start': 0, 'char_end': 42, 'line': 'def get_paths(root: str, sub_path: str) \\\n'}, {'line_no': 2, 'char_start': 42, 'char_end': 95, 'line': ' -> typing.Tuple[pathlib...
{'deleted': [{'char_start': 18, 'char_end': 19, 'chars': '_'}, {'char_start': 23, 'char_end': 24, 'chars': ':'}, {'char_start': 38, 'char_end': 39, 'chars': ':'}, {'char_start': 69, 'char_end': 73, 'chars': 'str('}, {'char_start': 82, 'char_end': 83, 'chars': ')'}, {'char_start': 128, 'char_end': 132, 'chars': 'str('},...
github.com/horazont/xmpp-http-upload/commit/82056540191e89f0cd697c81f57714c00962ed75
xhu.py
cwe-022
44
cwe-078
test_initialize_connection
def test_initialize_connection(self): self.driver._eql_execute = self.mox.\ CreateMock(self.driver._eql_execute) volume = {'name': self.volume_name} self.stubs.Set(self.driver, "_get_iscsi_properties", self._fake_get_iscsi_properties) self.driver._e...
def test_initialize_connection(self): self.driver._eql_execute = self.mox.\ CreateMock(self.driver._eql_execute) volume = {'name': self.volume_name} self.stubs.Set(self.driver, "_get_iscsi_properties", self._fake_get_iscsi_properties) self.driver._e...
{'deleted': [{'line_no': 10, 'char_start': 495, 'char_end': 547, 'line': " 'authmethod chap',\n"}], 'added': [{'line_no': 10, 'char_start': 495, 'char_end': 550, 'line': " 'authmethod', 'chap',\n"}]}
{'deleted': [], 'added': [{'char_start': 539, 'char_end': 541, 'chars': "',"}, {'char_start': 542, 'char_end': 543, 'chars': "'"}]}
github.com/thatsdone/cinder/commit/9e858bebb89de05b1c9ecc27f5bd9fbff95a728e
cinder/tests/test_eqlx.py
cwe-078
163
cwe-079
mode_keepalive
def mode_keepalive(self, request): """ This is called by render_POST when the client is replying to the keepalive. """ csessid = request.args.get('csessid')[0] self.last_alive[csessid] = (time.time(), False) return '""'
def mode_keepalive(self, request): """ This is called by render_POST when the client is replying to the keepalive. """ csessid = cgi.escape(request.args['csessid'][0]) self.last_alive[csessid] = (time.time(), False) return '""'
{'deleted': [{'line_no': 6, 'char_start': 155, 'char_end': 204, 'line': " csessid = request.args.get('csessid')[0]\n"}], 'added': [{'line_no': 6, 'char_start': 155, 'char_end': 212, 'line': " csessid = cgi.escape(request.args['csessid'][0])\n"}]}
{'deleted': [{'char_start': 185, 'char_end': 190, 'chars': '.get('}, {'char_start': 199, 'char_end': 200, 'chars': ')'}], 'added': [{'char_start': 173, 'char_end': 184, 'chars': 'cgi.escape('}, {'char_start': 196, 'char_end': 197, 'chars': '['}, {'char_start': 206, 'char_end': 207, 'chars': ']'}, {'char_start': 210, 'c...
github.com/evennia/evennia/commit/300261529b82f95414c9d1d7150d6eda4695bb93
evennia/server/portal/webclient_ajax.py
cwe-079
69
cwe-416
ip4_datagram_release_cb
void ip4_datagram_release_cb(struct sock *sk) { const struct inet_sock *inet = inet_sk(sk); const struct ip_options_rcu *inet_opt; __be32 daddr = inet->inet_daddr; struct flowi4 fl4; struct rtable *rt; if (! __sk_dst_get(sk) || __sk_dst_check(sk, 0)) return; rcu_read_lock(); inet_opt = rcu_dereference(inet-...
void ip4_datagram_release_cb(struct sock *sk) { const struct inet_sock *inet = inet_sk(sk); const struct ip_options_rcu *inet_opt; __be32 daddr = inet->inet_daddr; struct dst_entry *dst; struct flowi4 fl4; struct rtable *rt; rcu_read_lock(); dst = __sk_dst_get(sk); if (!dst || !dst->obsolete || dst->ops->che...
{'deleted': [{'line_no': 9, 'char_start': 208, 'char_end': 258, 'line': '\tif (! __sk_dst_get(sk) || __sk_dst_check(sk, 0))\n'}, {'line_no': 10, 'char_start': 258, 'char_end': 268, 'line': '\t\treturn;\n'}, {'line_no': 11, 'char_start': 268, 'char_end': 269, 'line': '\n'}, {'line_no': 20, 'char_start': 591, 'char_end':...
{'deleted': [{'char_start': 209, 'char_end': 212, 'chars': 'if '}, {'char_start': 213, 'char_end': 214, 'chars': '!'}, {'char_start': 235, 'char_end': 237, 'chars': '__'}, {'char_start': 238, 'char_end': 240, 'chars': 'k_'}, {'char_start': 243, 'char_end': 244, 'chars': '_'}, {'char_start': 251, 'char_end': 252, 'chars...
github.com/torvalds/linux/commit/9709674e68646cee5a24e3000b3558d25412203a
net/ipv4/datagram.c
cwe-416
207
cwe-476
mpeg4video_probe
static int mpeg4video_probe(AVProbeData *probe_packet) { uint32_t temp_buffer = -1; int VO = 0, VOL = 0, VOP = 0, VISO = 0, res = 0; int i; for (i = 0; i < probe_packet->buf_size; i++) { temp_buffer = (temp_buffer << 8) + probe_packet->buf[i]; if ((temp_buffer & 0xffffff00) != 0x100) ...
static int mpeg4video_probe(AVProbeData *probe_packet) { uint32_t temp_buffer = -1; int VO = 0, VOL = 0, VOP = 0, VISO = 0, res = 0; int i; for (i = 0; i < probe_packet->buf_size; i++) { temp_buffer = (temp_buffer << 8) + probe_packet->buf[i]; if (temp_buffer & 0xfffffe00) c...
{'deleted': [{'line_no': 9, 'char_start': 269, 'char_end': 318, 'line': ' if ((temp_buffer & 0xffffff00) != 0x100)\n'}, {'line_no': 16, 'char_start': 481, 'char_end': 519, 'line': ' else if (temp_buffer < 0x120)\n'}, {'line_no': 18, 'char_start': 537, 'char_end': 575, 'line': ' else if (temp_buffer...
{'deleted': [{'char_start': 281, 'char_end': 282, 'chars': '('}, {'char_start': 303, 'char_end': 304, 'chars': 'f'}, {'char_start': 308, 'char_end': 310, 'chars': '!='}, {'char_start': 311, 'char_end': 316, 'chars': '0x100'}], 'added': [{'char_start': 302, 'char_end': 303, 'chars': 'e'}, {'char_start': 306, 'char_end':...
github.com/libav/libav/commit/e5b019725f53b79159931d3a7317107cbbfd0860
libavformat/m4vdec.c
cwe-476
277
cwe-078
extend_volume
def extend_volume(self, volume, new_size): LOG.debug(_('enter: extend_volume: volume %s') % volume['id']) ret = self._ensure_vdisk_no_fc_mappings(volume['name'], allow_snaps=False) if not ret: exception_message = (_('extend_volume: ...
def extend_volume(self, volume, new_size): LOG.debug(_('enter: extend_volume: volume %s') % volume['id']) ret = self._ensure_vdisk_no_fc_mappings(volume['name'], allow_snaps=False) if not ret: exception_message = (_('extend_volume: ...
{'deleted': [{'line_no': 11, 'char_start': 544, 'char_end': 621, 'line': " ssh_cmd = ('svctask expandvdisksize -size %(amt)d -unit gb %(name)s'\n"}, {'line_no': 12, 'char_start': 621, 'char_end': 687, 'line': " % {'amt': extend_amt, 'name': volume['name']})\n"}], 'added': [{'line_no': 11, 'char...
{'deleted': [{'char_start': 594, 'char_end': 595, 'chars': '%'}, {'char_start': 596, 'char_end': 598, 'chars': 'am'}, {'char_start': 599, 'char_end': 600, 'chars': ')'}, {'char_start': 601, 'char_end': 614, 'chars': ' -unit gb %(n'}, {'char_start': 616, 'char_end': 617, 'chars': 'e'}, {'char_start': 618, 'char_end': 62...
github.com/thatsdone/cinder/commit/f752302d181583a95cf44354aea607ce9d9283f4
cinder/volume/drivers/storwize_svc.py
cwe-078
214
cwe-022
create_basename_core
def create_basename_core(basename): try: basename = basename.casefold() except Exception: basename = basename.lower() basename = basename.replace(' ', '-') basename = re.sub(r'<[^>]*>', r'', basename) basename = re.sub(r'[^a-z0-9\-]', r'', basename) basename = re.sub(r'\-\-', r'...
def create_basename_core(basename): try: basename = basename.casefold() except Exception: basename = basename.lower() basename = re.sub(r'[ \./]', r'-', basename) basename = re.sub(r'<[^>]*>', r'', basename) basename = re.sub(r'[^a-z0-9\-]', r'', basename) basename = re.sub(r'\-...
{'deleted': [{'line_no': 7, 'char_start': 143, 'char_end': 185, 'line': " basename = basename.replace(' ', '-')\n"}], 'added': [{'line_no': 7, 'char_start': 143, 'char_end': 192, 'line': " basename = re.sub(r'[ \\./]', r'-', basename)\n"}]}
{'deleted': [{'char_start': 158, 'char_end': 165, 'chars': 'basenam'}, {'char_start': 168, 'char_end': 175, 'chars': 'eplace('}], 'added': [{'char_start': 158, 'char_end': 159, 'chars': 'r'}, {'char_start': 161, 'char_end': 164, 'chars': 'sub'}, {'char_start': 165, 'char_end': 166, 'chars': 'r'}, {'char_start': 167, 'c...
github.com/syegulalp/mercury/commit/3f7c7442fa49aec37577dbdb47ce11a848e7bd03
MeTal/core/utils.py
cwe-022
96
cwe-089
init_user
def init_user(username, chat_id): conn = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\users\\" + username + '.db') conn2 = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + '\\cf.db') cursor = conn.cursor() cursor2 = conn2.cursor() cursor.execute("CREATE TABLE result (p...
def init_user(username, chat_id): conn = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\users\\" + username + '.db') conn2 = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + '\\cf.db') cursor = conn.cursor() cursor2 = conn2.cursor() cursor.execute("CREATE TABLE result (p...
{'deleted': [{'line_no': 22, 'char_start': 893, 'char_end': 894, 'line': '\n'}, {'line_no': 23, 'char_start': 894, 'char_end': 907, 'line': ' old = ""\n'}, {'line_no': 44, 'char_start': 1799, 'char_end': 1914, 'line': ' cursor.execute("select * from result where problem = \'" + s[3] + "\'and diff ...
{'deleted': [{'char_start': 893, 'char_end': 907, 'chars': '\n old = ""\n'}, {'char_start': 1872, 'char_end': 1883, 'chars': '\'" + s[3] +'}, {'char_start': 1884, 'char_end': 1886, 'chars': '"\''}, {'char_start': 1897, 'char_end': 1898, 'chars': "'"}, {'char_start': 1900, 'char_end': 1901, 'chars': '+'}, {'char_star...
github.com/lissrbay/codeforces_bot/commit/cc7f5143445a0030b1149ac60a65b1b1b9c92a90
bases/createuserbase.py
cwe-089
870
cwe-416
mrb_vm_exec
mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc) { /* mrb_assert(mrb_proc_cfunc_p(proc)) */ mrb_irep *irep = proc->body.irep; mrb_value *pool = irep->pool; mrb_sym *syms = irep->syms; mrb_code i; int ai = mrb_gc_arena_save(mrb); struct mrb_jmpbuf *prev_jmp = mrb->jmp; struct mrb_jmpbuf c_jm...
mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc) { /* mrb_assert(mrb_proc_cfunc_p(proc)) */ mrb_irep *irep = proc->body.irep; mrb_value *pool = irep->pool; mrb_sym *syms = irep->syms; mrb_code i; int ai = mrb_gc_arena_save(mrb); struct mrb_jmpbuf *prev_jmp = mrb->jmp; struct mrb_jmpbuf c_jm...
{'deleted': [{'line_no': 244, 'char_start': 6049, 'char_end': 6065, 'line': ' if (!e) {\n'}, {'line_no': 245, 'char_start': 6065, 'char_end': 6100, 'line': ' *regs_a = mrb_nil_value();\n'}, {'line_no': 248, 'char_start': 6121, 'char_end': 6152, 'line': ' *regs_a = e->stack[b];\n'}], 'added': [{'line_...
{'deleted': [{'char_start': 6059, 'char_end': 6060, 'chars': '!'}, {'char_start': 6083, 'char_end': 6085, 'chars': 'mr'}, {'char_start': 6086, 'char_end': 6098, 'chars': '_nil_value()'}, {'char_start': 6139, 'char_end': 6148, 'chars': 'e->stack['}, {'char_start': 6149, 'char_end': 6150, 'chars': ']'}], 'added': [{'char...
github.com/mruby/mruby/commit/1905091634a6a2925c911484434448e568330626
src/vm.c
cwe-416
16,994
cwe-079
screenshotcommentcounts
@register.tag @basictag(takes_context=True) def screenshotcommentcounts(context, screenshot): """ Returns a JSON array of current comments for a screenshot. Each entry in the array has a dictionary containing the following keys: =========== ================================================== Ke...
@register.tag @basictag(takes_context=True) def screenshotcommentcounts(context, screenshot): """ Returns a JSON array of current comments for a screenshot. Each entry in the array has a dictionary containing the following keys: =========== ================================================== Ke...
{'deleted': [{'line_no': 32, 'char_start': 1249, 'char_end': 1287, 'line': " 'text': comment.text,\n"}], 'added': [{'line_no': 32, 'char_start': 1249, 'char_end': 1295, 'line': " 'text': escape(comment.text),\n"}]}
{'deleted': [], 'added': [{'char_start': 1273, 'char_end': 1280, 'chars': 'escape('}, {'char_start': 1292, 'char_end': 1293, 'chars': ')'}]}
github.com/reviewboard/reviewboard/commit/7a0a9d94555502278534dedcf2d75e9fccce8c3d
reviewboard/reviews/templatetags/reviewtags.py
cwe-079
332
cwe-089
render_page_edit
@app.route('/<page_name>/edit') def render_page_edit(page_name): query = db.query("select page_content.content from page, page_content where page.id = page_content.page_id and page.page_name = '%s' order by page_content.id desc limit 1" % page_name) wiki_page = query.namedresult() if len(wiki_page) > 0: ...
@app.route('/<page_name>/edit') def render_page_edit(page_name): query = db.query("select page_content.content from page, page_content where page.id = page_content.page_id and page.page_name = $1 order by page_content.id desc limit 1", page_name) wiki_page = query.namedresult() if len(wiki_page) > 0: ...
{'deleted': [{'line_no': 3, 'char_start': 65, 'char_end': 254, 'line': ' query = db.query("select page_content.content from page, page_content where page.id = page_content.page_id and page.page_name = \'%s\' order by page_content.id desc limit 1" % page_name)\n'}], 'added': [{'line_no': 3, 'char_start': 65, 'char_en...
{'deleted': [{'char_start': 197, 'char_end': 201, 'chars': "'%s'"}, {'char_start': 240, 'char_end': 242, 'chars': ' %'}], 'added': [{'char_start': 197, 'char_end': 199, 'chars': '$1'}, {'char_start': 238, 'char_end': 239, 'chars': ','}]}
github.com/Pumala/python_wiki_app_redo/commit/65d60747cd8efb05970304234d3bd949d2088e8b
server.py
cwe-089
122
cwe-416
ap_limit_section
AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy, const char *arg) { const char *endp = ap_strrchr_c(arg, '>'); const char *limited_methods; void *tog = cmd->cmd->cmd_...
AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy, const char *arg) { const char *endp = ap_strrchr_c(arg, '>'); const char *limited_methods; void *tog = cmd->cmd->cmd_...
{'deleted': [], 'added': [{'line_no': 36, 'char_start': 1227, 'char_end': 1274, 'line': ' if (cmd->pool == cmd->temp_pool) {\n'}, {'line_no': 37, 'char_start': 1274, 'char_end': 1350, 'line': " /* In .htaccess, we can't globally register new methods. */\n"}, {'line_no': 38, 'char_start': 1350,...
{'deleted': [], 'added': [{'char_start': 1239, 'char_end': 1592, 'chars': 'if (cmd->pool == cmd->temp_pool) {\n /* In .htaccess, we can\'t globally register new methods. */\n return apr_psprintf(cmd->pool, "Could not register method \'%s\' "\n "for %s from...
github.com/apache/httpd/commit/29afdd2550b3d30a8defece2b95ae81edcf66ac9
server/core.c
cwe-416
470
cwe-125
ntlm_read_NegotiateMessage
SECURITY_STATUS ntlm_read_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer buffer) { wStream* s; size_t length; NTLM_NEGOTIATE_MESSAGE* message; message = &context->NEGOTIATE_MESSAGE; ZeroMemory(message, sizeof(NTLM_NEGOTIATE_MESSAGE)); s = Stream_New((BYTE*)buffer->pvBuffer, buffer->cbBuffer); if (!s) retu...
SECURITY_STATUS ntlm_read_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer buffer) { wStream* s; size_t length; NTLM_NEGOTIATE_MESSAGE* message; message = &context->NEGOTIATE_MESSAGE; ZeroMemory(message, sizeof(NTLM_NEGOTIATE_MESSAGE)); s = Stream_New((BYTE*)buffer->pvBuffer, buffer->cbBuffer); if (!s) retu...
{'deleted': [], 'added': [{'line_no': 25, 'char_start': 592, 'char_end': 631, 'line': '\tif (Stream_GetRemainingLength(s) < 4)\n'}, {'line_no': 26, 'char_start': 631, 'char_end': 634, 'line': '\t{\n'}, {'line_no': 27, 'char_start': 634, 'char_end': 659, 'line': '\t\tStream_Free(s, FALSE);\n'}, {'line_no': 28, 'char_sta...
{'deleted': [], 'added': [{'char_start': 593, 'char_end': 693, 'chars': 'if (Stream_GetRemainingLength(s) < 4)\n\t{\n\t\tStream_Free(s, FALSE);\n\t\treturn SEC_E_INVALID_TOKEN;\n\t}\n\t'}]}
github.com/FreeRDP/FreeRDP/commit/8fa38359634a9910b91719818ab02f23c320dbae
winpr/libwinpr/sspi/NTLM/ntlm_message.c
cwe-125
717
cwe-787
xdp_umem_reg
static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr) { bool unaligned_chunks = mr->flags & XDP_UMEM_UNALIGNED_CHUNK_FLAG; u32 chunk_size = mr->chunk_size, headroom = mr->headroom; unsigned int chunks, chunks_per_page; u64 addr = mr->addr, size = mr->len; int size_chk, err; if (chunk_size < XDP...
static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr) { bool unaligned_chunks = mr->flags & XDP_UMEM_UNALIGNED_CHUNK_FLAG; u32 chunk_size = mr->chunk_size, headroom = mr->headroom; unsigned int chunks, chunks_per_page; u64 addr = mr->addr, size = mr->len; int err; if (chunk_size < XDP_UMEM_MIN_...
{'deleted': [{'line_no': 7, 'char_start': 278, 'char_end': 298, 'line': '\tint size_chk, err;\n'}, {'line_no': 46, 'char_start': 1202, 'char_end': 1259, 'line': '\tsize_chk = chunk_size - headroom - XDP_PACKET_HEADROOM;\n'}, {'line_no': 47, 'char_start': 1259, 'char_end': 1278, 'line': '\tif (size_chk < 0)\n'}], 'added...
{'deleted': [{'char_start': 283, 'char_end': 293, 'chars': 'size_chk, '}, {'char_start': 1203, 'char_end': 1204, 'chars': 's'}, {'char_start': 1205, 'char_end': 1209, 'chars': 'ze_c'}, {'char_start': 1210, 'char_end': 1211, 'chars': 'k'}, {'char_start': 1227, 'char_end': 1238, 'chars': 'headroom - '}, {'char_start': 12...
github.com/torvalds/linux/commit/99e3a236dd43d06c65af0a2ef9cb44306aef6e02
net/xdp/xdp_umem.c
cwe-787
697
cwe-125
enc_untrusted_read
ssize_t enc_untrusted_read(int fd, void *buf, size_t count) { return static_cast<ssize_t>(EnsureInitializedAndDispatchSyscall( asylo::system_call::kSYS_read, fd, buf, count)); }
ssize_t enc_untrusted_read(int fd, void *buf, size_t count) { ssize_t ret = static_cast<ssize_t>(EnsureInitializedAndDispatchSyscall( asylo::system_call::kSYS_read, fd, buf, count)); if (ret != -1 && ret > count) { ::asylo::primitives::TrustedPrimitives::BestEffortAbort( "enc_untrusted_read: read ...
{'deleted': [{'line_no': 2, 'char_start': 62, 'char_end': 129, 'line': ' return static_cast<ssize_t>(EnsureInitializedAndDispatchSyscall(\n'}], 'added': [{'line_no': 2, 'char_start': 62, 'char_end': 136, 'line': ' ssize_t ret = static_cast<ssize_t>(EnsureInitializedAndDispatchSyscall(\n'}, {'line_no': 4, 'char_start'...
{'deleted': [{'char_start': 67, 'char_end': 70, 'chars': 'urn'}], 'added': [{'char_start': 64, 'char_end': 68, 'chars': 'ssiz'}, {'char_start': 69, 'char_end': 70, 'chars': '_'}, {'char_start': 71, 'char_end': 72, 'chars': ' '}, {'char_start': 73, 'char_end': 77, 'chars': 'et ='}, {'char_start': 189, 'char_end': 364, '...
github.com/google/asylo/commit/b1d120a2c7d7446d2cc58d517e20a1b184b82200
asylo/platform/host_call/trusted/host_calls.cc
cwe-125
52
cwe-079
get_queryset
def get_queryset(self, **kwargs): queryset = Article.objects.order_by('-time') for i in queryset: i.md = markdown(i.content, extensions=[ 'markdown.extensions.extra', 'markdown.extensions.codehilite', 'markdown.extensions.toc', ...
def get_queryset(self, **kwargs): queryset = Article.objects.order_by('-time') for i in queryset: i.md = safe_md(i.content) return queryset
{'deleted': [{'line_no': 4, 'char_start': 118, 'char_end': 170, 'line': ' i.md = markdown(i.content, extensions=[\n'}, {'line_no': 5, 'char_start': 170, 'char_end': 215, 'line': " 'markdown.extensions.extra',\n"}, {'line_no': 6, 'char_start': 215, 'char_end': 265, 'line': " 'mar...
{'deleted': [{'char_start': 137, 'char_end': 162, 'chars': 'markdown(i.content, exten'}, {'char_start': 163, 'char_end': 188, 'chars': "ions=[\n 'm"}, {'char_start': 189, 'char_end': 196, 'chars': 'rkdown.'}, {'char_start': 197, 'char_end': 232, 'chars': "xtensions.extra',\n '"}, {'char_st...
github.com/Cheng-mq1216/production-practice/commit/333dc34f5feada55d1f6ff1255949ca00dec0f9c
app/Index/views.py
cwe-079
61
cwe-190
UnicodeString::doAppend
UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLength) { if(!isWritable() || srcLength == 0 || srcChars == NULL) { return *this; } // Perform all remaining operations relative to srcChars + srcStart. // From this point forward, do not use srcStart. srcChars += srcStart; if...
UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLength) { if(!isWritable() || srcLength == 0 || srcChars == NULL) { return *this; } // Perform all remaining operations relative to srcChars + srcStart. // From this point forward, do not use srcStart. srcChars += srcStart; if...
{'deleted': [{'line_no': 18, 'char_start': 487, 'char_end': 532, 'line': ' int32_t newLength = oldLength + srcLength;\n'}], 'added': [{'line_no': 18, 'char_start': 487, 'char_end': 508, 'line': ' int32_t newLength;\n'}, {'line_no': 19, 'char_start': 508, 'char_end': 571, 'line': ' if (uprv_add32_overflow(oldLength, ...
{'deleted': [{'char_start': 507, 'char_end': 508, 'chars': '='}, {'char_start': 518, 'char_end': 520, 'chars': ' +'}], 'added': [{'char_start': 506, 'char_end': 509, 'chars': ';\n '}, {'char_start': 510, 'char_end': 512, 'chars': 'if'}, {'char_start': 513, 'char_end': 534, 'chars': '(uprv_add32_overflow('}, {'char_star...
github.com/unicode-org/icu/commit/b7d08bc04a4296982fcef8b6b8a354a9e4e7afca
icu4c/source/common/unistr.cpp
cwe-190
421
cwe-476
ExprResolveLhs
ExprResolveLhs(struct xkb_context *ctx, const ExprDef *expr, const char **elem_rtrn, const char **field_rtrn, ExprDef **index_rtrn) { switch (expr->expr.op) { case EXPR_IDENT: *elem_rtrn = NULL; *field_rtrn = xkb_atom_text(ctx, expr->ident.ident); *index_rtr...
ExprResolveLhs(struct xkb_context *ctx, const ExprDef *expr, const char **elem_rtrn, const char **field_rtrn, ExprDef **index_rtrn) { switch (expr->expr.op) { case EXPR_IDENT: *elem_rtrn = NULL; *field_rtrn = xkb_atom_text(ctx, expr->ident.ident); *index_rtr...
{'deleted': [{'line_no': 15, 'char_start': 552, 'char_end': 573, 'line': ' return true;\n'}], 'added': [{'line_no': 15, 'char_start': 552, 'char_end': 612, 'line': ' return (*elem_rtrn != NULL && *field_rtrn != NULL);\n'}, {'line_no': 20, 'char_start': 813, 'char_end': 882, 'line': '\tif (expr->array_ref....
{'deleted': [{'char_start': 569, 'char_end': 570, 'chars': 'u'}], 'added': [{'char_start': 567, 'char_end': 575, 'chars': '(*elem_r'}, {'char_start': 577, 'char_end': 593, 'chars': 'n != NULL && *fi'}, {'char_start': 594, 'char_end': 610, 'chars': 'ld_rtrn != NULL)'}, {'char_start': 811, 'char_end': 938, 'chars': ';\n\...
github.com/xkbcommon/libxkbcommon/commit/bb4909d2d8fa6b08155e449986a478101e2b2634
src/xkbcomp/expr.c
cwe-476
261
cwe-078
add_extra_args
def add_extra_args(self, args=None): """Add more args depending on how known args are set.""" parsed = vars(self.parse_known_args(nohelp=True)[0]) # find which image mode specified if any, and add additional arguments image_mode = parsed.get('image_mode', None) if image_mode...
def add_extra_args(self, args=None): """Add more args depending on how known args are set.""" parsed = vars(self.parse_known_args(args, nohelp=True)[0]) # find which image mode specified if any, and add additional arguments image_mode = parsed.get('image_mode', None) if imag...
{'deleted': [{'line_no': 3, 'char_start': 106, 'char_end': 167, 'line': ' parsed = vars(self.parse_known_args(nohelp=True)[0])\n'}], 'added': [{'line_no': 3, 'char_start': 106, 'char_end': 173, 'line': ' parsed = vars(self.parse_known_args(args, nohelp=True)[0])\n'}]}
{'deleted': [], 'added': [{'char_start': 150, 'char_end': 156, 'chars': 'args, '}]}
github.com/freedombenLiu/ParlAI/commit/601668d569e1276e0b8bf2bf8fb43e391e10d170
parlai/core/params.py
cwe-078
244
cwe-089
render_page_name
@app.route('/<page_name>') def render_page_name(page_name): query = db.query("select page_content.content, page.id as page_id, page_content.id as content_id from page, page_content where page.id = page_content.page_id and page.page_name = '%s' order by page_content.id desc limit 1" % page_name) wiki_page = quer...
@app.route('/<page_name>') def render_page_name(page_name): query = db.query("select page_content.content, page.id as page_id, page_content.id as content_id from page, page_content where page.id = page_content.page_id and page.page_name = $1 order by page_content.id desc limit 1", page_name) wiki_page = query.n...
{'deleted': [{'line_no': 3, 'char_start': 60, 'char_end': 300, 'line': ' query = db.query("select page_content.content, page.id as page_id, page_content.id as content_id from page, page_content where page.id = page_content.page_id and page.page_name = \'%s\' order by page_content.id desc limit 1" % page_name)\n'}], ...
{'deleted': [{'char_start': 243, 'char_end': 247, 'chars': "'%s'"}, {'char_start': 286, 'char_end': 288, 'chars': ' %'}], 'added': [{'char_start': 243, 'char_end': 245, 'chars': '$1'}, {'char_start': 284, 'char_end': 285, 'chars': ','}]}
github.com/Pumala/python_wiki_app_redo/commit/65d60747cd8efb05970304234d3bd949d2088e8b
server.py
cwe-089
216
cwe-125
modbus_reply
int modbus_reply(modbus_t *ctx, const uint8_t *req, int req_length, modbus_mapping_t *mb_mapping) { int offset; int slave; int function; uint16_t address; uint8_t rsp[MAX_MESSAGE_LENGTH]; int rsp_length = 0; sft_t sft; if (ctx == NULL) { errno = EINVAL; ...
int modbus_reply(modbus_t *ctx, const uint8_t *req, int req_length, modbus_mapping_t *mb_mapping) { int offset; int slave; int function; uint16_t address; uint8_t rsp[MAX_MESSAGE_LENGTH]; int rsp_length = 0; sft_t sft; if (ctx == NULL) { errno = EINVAL; ...
{'deleted': [{'line_no': 140, 'char_start': 6054, 'char_end': 6106, 'line': ' if (nb < 1 || MODBUS_MAX_WRITE_BITS < nb) {\n'}, {'line_no': 171, 'char_start': 7556, 'char_end': 7613, 'line': ' if (nb < 1 || MODBUS_MAX_WRITE_REGISTERS < nb) {\n'}], 'added': [{'line_no': 138, 'char_start': 5989, 'char_end': ...
{'deleted': [], 'added': [{'char_start': 6001, 'char_end': 6040, 'chars': 'nb_bits = req[offset + 5];\n int '}, {'char_start': 6136, 'char_end': 6156, 'chars': ' < nb || nb_bits * 8'}, {'char_start': 7557, 'char_end': 7597, 'chars': 'nb_bytes = req[offset + 5];\n int '}, {'char_start': 7703, 'char_end': 7...
github.com/stephane/libmodbus/commit/5ccdf5ef79d742640355d1132fa9e2abc7fbaefc
src/modbus.c
cwe-125
3,226
cwe-190
_gd2GetHeader
static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, int *fmt, int *ncx, int *ncy, t_chunk_info ** chunkIdx) { int i; int ch; char id[5]; t_chunk_info *cidx; int sidx; int nc; GD2_DBG(php_gd_error("Reading gd2 header info")); for (i = 0; i < 4; i++) { ch = gdGetC(in); if (ch == EO...
static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, int *fmt, int *ncx, int *ncy, t_chunk_info ** chunkIdx) { int i; int ch; char id[5]; t_chunk_info *cidx; int sidx; int nc; GD2_DBG(php_gd_error("Reading gd2 header info")); for (i = 0; i < 4; i++) { ch = gdGetC(in); if (ch == EO...
{'deleted': [], 'added': [{'line_no': 88, 'char_start': 1983, 'char_end': 2012, 'line': '\t\tif (overflow2(sidx, nc)) {\n'}, {'line_no': 89, 'char_start': 2012, 'char_end': 2027, 'line': '\t\t\tgoto fail1;\n'}, {'line_no': 90, 'char_start': 2027, 'char_end': 2031, 'line': '\t\t}\n'}, {'line_no': 96, 'char_start': 2133,...
{'deleted': [], 'added': [{'char_start': 1985, 'char_end': 2033, 'chars': 'if (overflow2(sidx, nc)) {\n\t\t\tgoto fail1;\n\t\t}\n\t\t'}, {'char_start': 2132, 'char_end': 2174, 'chars': '\n\t\tif (cidx == NULL) {\n\t\t\tgoto fail1;\n\t\t}\n'}]}
github.com/php/php-src/commit/7722455726bec8c53458a32851d2a87982cf0eac
ext/gd/libgd/gd_gd2.c
cwe-190
957