prompt
stringclasses
1 value
completions
listlengths
2
1.33k
labels
listlengths
2
1.33k
source
stringclasses
1 value
other_info
dict
index
int64
0
719
cwe
stringclasses
9 values
language
stringclasses
6 values
Determine whether the {function_name} code is vulnerable or not.
[ "def set_language(self, lang):\n \"\"\"\n Update language of user in the User object and in the database\n :param lang: string with language tag like \"en-US\"\n :return: None\n \"\"\"\n log.debug('Updating info about user %s language '\n 'in memory & datab...
[ 1, 1, 1, 0, 1, 0, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 416, "char_start": 415, "chars": "%" }, { "char_end": 495, "char_start": 453, "chars": "%s\")\n\n parameters = self.language, " }, { "char_end": 557, "char_start": 545,...
200
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def set_language(self, lang):\n \"\"\"\n Update language of user in the User object and in the database\n :param lang: string with language tag like \"en-US\"\n :return: None\n \"\"\"\n log.debug('Updating info about user %s language '\n 'in memory & datab...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 416, "char_start": 415, "chars": "%" }, { "char_end": 495, "char_start": 453, "chars": "%s\")\n\n parameters = self.language, " }, { "char_end": 557, "char_start": 545,...
200
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def tid_num_to_tag_nums(self, tid_num):\n ''' Returns list of the associated tag_nums to the given tid_num. '''\n", " q = \"SELECT tag FROM tid_tag WHERE tid = '\" + str(tid_num) + \"'\"\n self.query(q)", " return [i[0] for i in self.c.fetchall()]" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 173, "char_start": 172, "chars": "?" }, { "char_end": 204, "char_start": 195, "chars": ", tid_num" } ], "deleted": [ { "char_end": 194, "char_start": 172, "cha...
201
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def tid_num_to_tag_nums(self, tid_num):\n ''' Returns list of the associated tag_nums to the given tid_num. '''\n", " q = \"SELECT tag FROM tid_tag WHERE tid = ?\"\n self.query(q, tid_num)", " return [i[0] for i in self.c.fetchall()]" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 173, "char_start": 172, "chars": "?" }, { "char_end": 204, "char_start": 195, "chars": ", tid_num" } ], "deleted": [ { "char_end": 194, "char_start": 172, "cha...
201
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@app.route('/summary', methods=['GET'])\ndef summary():\n\tif 'username' in session:", "\t\tconn = mysql.connect()\n\t\tcursor = conn.cursor()", "\t\t#select the maximum score from the results table", "\t\tcursor.execute(\"SELECT courseConcentration FROM results WHERE total = (SELECT MAX(total) FROM (SELECT ...
[ 1, 1, 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 366, "char_start": 364, "chars": "%s" }, { "char_end": 368, "char_start": 367, "chars": "," }, { "char_end": 370, "char_start": 369, "chars": "(" }, { ...
202
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@app.route('/summary', methods=['GET'])\ndef summary():\n\tif 'username' in session:", "\t\tconn = mysql.connect()\n\t\tcursor = conn.cursor()", "\t\t#select the maximum score from the results table", "\t\tcursor.execute(\"SELECT courseConcentration FROM results WHERE total = (SELECT MAX(total) FROM (SELECT ...
[ 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 366, "char_start": 364, "chars": "%s" }, { "char_end": 368, "char_start": 367, "chars": "," }, { "char_end": 370, "char_start": 369, "chars": "(" }, { ...
202
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def add_post(content):\n \"\"\"Add a post to the 'database' with the current timestamp.\"\"\"\n conn = psycopg2.connect(\"dbname=forum\")\n cursor = conn.cursor()", " cursor.execute(\"insert into posts values ('%s')\" % content)", " conn.commit()\n conn.close()" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 178, "char_start": 157, "chars": "one_post = content\n " }, { "char_end": 225, "char_start": 224, "chars": "," }, { "char_end": 227, "char_start": 226, "chars": "(" ...
203
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def add_post(content):\n \"\"\"Add a post to the 'database' with the current timestamp.\"\"\"\n conn = psycopg2.connect(\"dbname=forum\")\n cursor = conn.cursor()", " one_post = content\n cursor.execute(\"insert into posts values (%s)\", (one_post,))", " conn.commit()\n conn.close()" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 178, "char_start": 157, "chars": "one_post = content\n " }, { "char_end": 225, "char_start": 224, "chars": "," }, { "char_end": 227, "char_start": 226, "chars": "(" ...
203
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def delete_playlist(id, db):", " db.execute(\"DELETE FROM playlist where id={id};\".format(id=id))" ]
[ 1, 0 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 77, "char_start": 75, "chars": "%s" }, { "char_end": 81, "char_start": 79, "chars": ", " }, { "char_end": 85, "char_start": 84, "chars": "," } ], "delete...
204
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def delete_playlist(id, db):", " db.execute(\"DELETE FROM playlist where id=%s;\", (id,))" ]
[ 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 77, "char_start": 75, "chars": "%s" }, { "char_end": 81, "char_start": 79, "chars": ", " }, { "char_end": 85, "char_start": 84, "chars": "," } ], "delete...
204
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def writeToDb(self, url):\n try:", " self.cursor.execute(\"INSERT INTO queue (url, visited) VALUES ('{}', '0');\".format(url))", " self.db.commit()\n except Exception as e:\n print(e)" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 118, "char_start": 117, "chars": "?" }, { "char_end": 128, "char_start": 126, "chars": ", " } ], "deleted": [ { "char_end": 121, "char_start": 117, "chars": "'...
205
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def writeToDb(self, url):\n try:", " self.cursor.execute(\"INSERT INTO queue (url, visited) VALUES (?, '0');\", url)", " self.db.commit()\n except Exception as e:\n print(e)" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 118, "char_start": 117, "chars": "?" }, { "char_end": 128, "char_start": 126, "chars": ", " } ], "deleted": [ { "char_end": 121, "char_start": 117, "chars": "'...
205
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@frappe.whitelist(allow_guest=True)\ndef send_message(subject=\"Website Query\", message=\"\", sender=\"\", status=\"Open\"):\n\tfrom frappe.www.contact import send_message as website_send_message\n\tlead = customer = None", "\twebsite_send_message(subject, message, sender)", "\tcustomer = frappe.db.sql(\"\"\"...
[ 1, 1, 1, 0, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 441, "char_start": 440, "chars": " " }, { "char_end": 445, "char_start": 442, "chars": " %s" }, { "char_end": 450, "char_start": 448, "chars": ", " } ], ...
206
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@frappe.whitelist(allow_guest=True)\ndef send_message(subject=\"Website Query\", message=\"\", sender=\"\", status=\"Open\"):\n\tfrom frappe.www.contact import send_message as website_send_message\n\tlead = customer = None", "\twebsite_send_message(subject, message, sender)", "\tcustomer = frappe.db.sql(\"\"\"...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 441, "char_start": 440, "chars": " " }, { "char_end": 445, "char_start": 442, "chars": " %s" }, { "char_end": 450, "char_start": 448, "chars": ", " } ], ...
206
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@jwt_required\n def delete(self, email):\n \"\"\" Deletes admin with the corresponding email \"\"\"", " return database_utilities.execute_query(f\"\"\"delete from admins where email = '{email}'\"\"\")" ]
[ 1, 0 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 199, "char_start": 191, "chars": "%s\"\"\", (" }, { "char_end": 207, "char_start": 204, "chars": ", )" } ], "deleted": [ { "char_end": 193, "char_start": 191, ...
207
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@jwt_required\n def delete(self, email):\n \"\"\" Deletes admin with the corresponding email \"\"\"", " return database_utilities.execute_query(f\"\"\"delete from admins where email = %s\"\"\", (email, ))" ]
[ 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 199, "char_start": 191, "chars": "%s\"\"\", (" }, { "char_end": 207, "char_start": 204, "chars": ", )" } ], "deleted": [ { "char_end": 193, "char_start": 191, ...
207
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def delete_playlists_videos(playlist_id, db):", " db.execute(\"DELETE FROM video where playlist_id={playlist_id};\".format(\n playlist_id=playlist_id))" ]
[ 1, 0 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 99, "char_start": 98, "chars": "%" }, { "char_end": 104, "char_start": 102, "chars": ", " }, { "char_end": 117, "char_start": 116, "chars": "," } ], "del...
208
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def delete_playlists_videos(playlist_id, db):", " db.execute(\"DELETE FROM video where playlist_id=%s;\", (playlist_id,))" ]
[ 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 99, "char_start": 98, "chars": "%" }, { "char_end": 104, "char_start": 102, "chars": ", " }, { "char_end": 117, "char_start": 116, "chars": "," } ], "del...
208
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@staticmethod\n def upsert_mapped_projects(user_id: int, project_id: int):\n \"\"\" Adds projects to mapped_projects if it doesn't exist \"\"\"", " sql = \"select * from users where id = {0} and projects_mapped @> '{{{1}}}'\".format(user_id, project_id)\n result = db.engine.execute(sql)",...
[ 1, 0, 1, 1, 0, 1, 0 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 204, "char_start": 196, "chars": ":user_id" }, { "char_end": 232, "char_start": 231, "chars": ":" }, { "char_end": 246, "char_start": 242, "chars": "}}'\"" }, ...
209
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@staticmethod\n def upsert_mapped_projects(user_id: int, project_id: int):\n \"\"\" Adds projects to mapped_projects if it doesn't exist \"\"\"", " sql = \"select * from users where id = :user_id and projects_mapped @> '{{:project_id}}'\"\n result = db.engine.execute(text(sql), user_id=us...
[ 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 204, "char_start": 196, "chars": ":user_id" }, { "char_end": 232, "char_start": 231, "chars": ":" }, { "char_end": 246, "char_start": 242, "chars": "}}'\"" }, ...
209
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_first_ranked_month(db, scene, player):", " sql = \"select date from ranks where scene='{}' and player='{}' order by date limit 1;\".format(scene, player)\n res = db.exec(sql)", " date = res[0][0]\n return date" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 100, "char_start": 95, "chars": "scene" }, { "char_end": 122, "char_start": 116, "chars": "player" }, { "char_end": 153, "char_start": 148, "chars": "\n " }, ...
210
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_first_ranked_month(db, scene, player):", " sql = \"select date from ranks where scene='{scene}' and player='{player}' order by date limit 1;\"\n args = {'scene': scene, 'player': player}\n res = db.exec(sql, args)", " date = res[0][0]\n return date" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 100, "char_start": 95, "chars": "scene" }, { "char_end": 122, "char_start": 116, "chars": "player" }, { "char_end": 153, "char_start": 148, "chars": "\n " }, ...
210
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@hook.command(adminonly=True)\ndef openPoll(question, reply=None, db=None):\n \"\"\"Creates a new poll.\"\"\"\n if not db_ready: db_init(db)\n try:\n active = db.execute(\"SELECT pollID FROM polls WHERE active = 1\").fetchone()[0]\n if active: \n reply(\"There already is an open p...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 403, "char_start": 402, "chars": "?" }, { "char_end": 410, "char_start": 408, "chars": ", " }, { "char_end": 420, "char_start": 419, "chars": "," } ], "d...
211
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@hook.command(adminonly=True)\ndef openPoll(question, reply=None, db=None):\n \"\"\"Creates a new poll.\"\"\"\n if not db_ready: db_init(db)\n try:\n active = db.execute(\"SELECT pollID FROM polls WHERE active = 1\").fetchone()[0]\n if active: \n reply(\"There already is an open p...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 403, "char_start": 402, "chars": "?" }, { "char_end": 410, "char_start": 408, "chars": ", " }, { "char_end": 420, "char_start": 419, "chars": "," } ], "d...
211
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def view_grocery_list():\n print(\"grocery== list\")\n groceryListFrame = Frame(self)\n groceryListFrame.rowconfigure(0, weight=1)\n groceryListFrame.columnconfigure(0, weight=1)\n groceryListFrame.rowconfigure(1, weight=3)\n groceryListFrame.column...
[ 1, 1, 1, 0, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 807, "char_start": 805, "chars": "?;" }, { "char_end": 811, "char_start": 810, "chars": "," }, { "char_end": 813, "char_start": 812, "chars": "(" }, { ...
212
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def view_grocery_list():\n print(\"grocery== list\")\n groceryListFrame = Frame(self)\n groceryListFrame.rowconfigure(0, weight=1)\n groceryListFrame.columnconfigure(0, weight=1)\n groceryListFrame.rowconfigure(1, weight=3)\n groceryListFrame.column...
[ 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 807, "char_start": 805, "chars": "?;" }, { "char_end": 811, "char_start": 810, "chars": "," }, { "char_end": 813, "char_start": 812, "chars": "(" }, { ...
212
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@app.route('/<page_name>/history/record')\ndef view_page_record(page_name):\n content_id = request.args.get('id')", " query = db.query(\"select page_content.content, page_content.timestamp from page, page_content where page.id = page_content.page_id and page_content.id = '%s'\" % content_id)", " page_...
[ 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 274, "char_start": 272, "chars": "$1" }, { "char_end": 276, "char_start": 275, "chars": "," } ], "deleted": [ { "char_end": 276, "char_start": 272, "chars": "'...
213
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@app.route('/<page_name>/history/record')\ndef view_page_record(page_name):\n content_id = request.args.get('id')", " query = db.query(\"select page_content.content, page_content.timestamp from page, page_content where page.id = page_content.page_id and page_content.id = $1\", content_id)", " page_rec...
[ 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 274, "char_start": 272, "chars": "$1" }, { "char_end": 276, "char_start": 275, "chars": "," } ], "deleted": [ { "char_end": 276, "char_start": 272, "chars": "'...
213
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def update_inverter(self, inverter_serial, ts, status, etoday, etotal):\n query = '''\n UPDATE Inverters\n SET ", " TimeStamp='%s', \n Status='%s', \n eToday='%s',\n eTotal='%s'\n WHERE Serial='%s';\n '...
[ 1, 0 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 173, "char_start": 172, "chars": "?" }, { "char_end": 200, "char_start": 199, "chars": "?" }, { "char_end": 227, "char_start": 226, "chars": "?" }, { ...
214
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def update_inverter(self, inverter_serial, ts, status, etoday, etotal):\n query = '''\n UPDATE Inverters\n SET ", " TimeStamp=?, \n Status=?, \n eToday=?,\n eTotal=?\n WHERE Serial=?;\n '''\n sel...
[ 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 173, "char_start": 172, "chars": "?" }, { "char_end": 200, "char_start": 199, "chars": "?" }, { "char_end": 227, "char_start": 226, "chars": "?" }, { ...
214
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def insert(key, value):\n connection = psycopg2.connect(host=config['HOST'], port=config['PORT'], database=config['NAME'], user=config['USER'], password=config['PASSWORD'])\n cur = connection.cursor()\n try:", " cur.execute(\"insert into reply_map values('{}', '{}')\".format(key, value))", " ...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 265, "char_start": 264, "chars": "?" }, { "char_end": 268, "char_start": 267, "chars": "?" }, { "char_end": 272, "char_start": 270, "chars": ", " } ], "d...
215
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def insert(key, value):\n connection = psycopg2.connect(host=config['HOST'], port=config['PORT'], database=config['NAME'], user=config['USER'], password=config['PASSWORD'])\n cur = connection.cursor()\n try:", " cur.execute(\"insert into reply_map values(?, ?)\", (key, value))", " connec...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 265, "char_start": 264, "chars": "?" }, { "char_end": 268, "char_start": 267, "chars": "?" }, { "char_end": 272, "char_start": 270, "chars": ", " } ], "d...
215
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def save_failure_transaction(self, user_id, project_id, money):", " self.cursor.execute(\"insert into transactions (project_id,user_id, money, timestamp, state) values (%s, %s, %s, now(), 'failed' )\" % (project_id, user_id, money))", " self.db.commit()" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 215, "char_start": 184, "chars": "\"\n \"" }, { "char_end": 238, "char_start": 237, "chars": "," } ], "deleted": [ { "char_end": 208, "char_...
216
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def save_failure_transaction(self, user_id, project_id, money):", " self.cursor.execute(\"insert into transactions (project_id,user_id, money, timestamp, state) values (%s, %s, \"\n \"%s, now(), 'failed' )\", (project_id, user_id, money))", " self.db.commit()" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 215, "char_start": 184, "chars": "\"\n \"" }, { "char_end": 238, "char_start": 237, "chars": "," } ], "deleted": [ { "char_end": 208, "char_...
216
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@unpack\n def test_process_as_form(self, job_number, dcn_key, was_prev_matched,\n was_prev_closed, was_prev_tracked):\n email_obj = {\n 'sender' : \"Alex Roy <Alex.Roy@dilfo.com>\",\n 'subject' : \"DO NOT MODIFY MESSAGE BELOW - JUST HIT `SEND`\",\n 'date' : \"T...
[ 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 844, "char_start": 843, "chars": "?" }, { "char_end": 872, "char_start": 871, "chars": "?" }, { "char_end": 1011, "char_start": 1010, "chars": "?" }, { ...
217
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@unpack\n def test_process_as_form(self, job_number, dcn_key, was_prev_matched,\n was_prev_closed, was_prev_tracked):\n email_obj = {\n 'sender' : \"Alex Roy <Alex.Roy@dilfo.com>\",\n 'subject' : \"DO NOT MODIFY MESSAGE BELOW - JUST HIT `SEND`\",\n 'date' : \"T...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 844, "char_start": 843, "chars": "?" }, { "char_end": 872, "char_start": 871, "chars": "?" }, { "char_end": 1011, "char_start": 1010, "chars": "?" }, { ...
217
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@app.route('/<page_name>')\ndef 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)", " ...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 245, "char_start": 243, "chars": "$1" }, { "char_end": 285, "char_start": 284, "chars": "," } ], "deleted": [ { "char_end": 247, "char_start": 243, "chars": "'...
218
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@app.route('/<page_name>')\ndef 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)", " w...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 245, "char_start": 243, "chars": "$1" }, { "char_end": 285, "char_start": 284, "chars": "," } ], "deleted": [ { "char_end": 247, "char_start": 243, "chars": "'...
218
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def tid_to_tid_num(self, tid):\n ''' Returns tid_num, given tid. '''\n", " q = \"SELECT rowid FROM tids WHERE tid = '\" + tid + \"'\"\n self.query(q)", " return self.c.fetchone()[0]" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 129, "char_start": 128, "chars": "?" }, { "char_end": 156, "char_start": 151, "chars": ", tid" } ], "deleted": [ { "char_end": 141, "char_start": 128, "chars":...
219
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def tid_to_tid_num(self, tid):\n ''' Returns tid_num, given tid. '''\n", " q = \"SELECT rowid FROM tids WHERE tid = ?\"\n self.query(q, tid)", " return self.c.fetchone()[0]" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 129, "char_start": 128, "chars": "?" }, { "char_end": 156, "char_start": 151, "chars": ", tid" } ], "deleted": [ { "char_end": 141, "char_start": 128, "chars":...
219
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_old_sourcebyinstitution_number(conn, sqlite, sourcebyinstitution):\n \"\"\"\n Get all the old sourcebyinstitution number from the SQLite database.\n \"\"\"\n query = \"\"\"\n SELECT\n titles\n FROM\n history\n WHERE", " sourcebyinstitution...
[ 1, 0, 1, 0, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 296, "char_start": 295, "chars": "?" }, { "char_end": 411, "char_start": 387, "chars": ", (sourcebyinstitution,)" } ], "deleted": [ { "char_end": 299, "char_start": 29...
220
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_old_sourcebyinstitution_number(conn, sqlite, sourcebyinstitution):\n \"\"\"\n Get all the old sourcebyinstitution number from the SQLite database.\n \"\"\"\n query = \"\"\"\n SELECT\n titles\n FROM\n history\n WHERE", " sourcebyinstitution...
[ 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 296, "char_start": 295, "chars": "?" }, { "char_end": 411, "char_start": 387, "chars": ", (sourcebyinstitution,)" } ], "deleted": [ { "char_end": 299, "char_start": 29...
220
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def top_karma(bot, trigger):\n \"\"\"\n Show karma status for the top n number of IRC users.\n \"\"\"\n try:\n top_limit = int(trigger.group(2).strip())\n except ValueError:\n top_limit = 5", " query = \"SELECT slug, value FROM nick_values NATURAL JOIN nicknames \\", " WH...
[ 1, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 336, "char_start": 335, "chars": "?" }, { "char_end": 375, "char_start": 374, "chars": "," }, { "char_end": 380, "char_start": 376, "chars": "str(" }, { ...
221
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def top_karma(bot, trigger):\n \"\"\"\n Show karma status for the top n number of IRC users.\n \"\"\"\n try:\n top_limit = int(trigger.group(2).strip())\n except ValueError:\n top_limit = 5", " query = \"SELECT slug, value FROM nick_values NATURAL JOIN nicknames \\", " WH...
[ 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 336, "char_start": 335, "chars": "?" }, { "char_end": 375, "char_start": 374, "chars": "," }, { "char_end": 380, "char_start": 376, "chars": "str(" }, { ...
221
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def retrieve_playlist_by_id(id, db):\n db.execute(", " \"SELECT id, name, video_position from playlist WHERE id={id};\".format(id=id))", " row = db.fetchone()\n return row" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 119, "char_start": 117, "chars": "%s" }, { "char_end": 123, "char_start": 121, "chars": ", " }, { "char_end": 127, "char_start": 126, "chars": "," } ], "...
222
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def retrieve_playlist_by_id(id, db):\n db.execute(", " \"SELECT id, name, video_position from playlist WHERE id=%s;\", (id,))", " row = db.fetchone()\n return row" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 119, "char_start": 117, "chars": "%s" }, { "char_end": 123, "char_start": 121, "chars": ", " }, { "char_end": 127, "char_start": 126, "chars": "," } ], "...
222
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@bot.message_handler(func = lambda message: get_current_state(message.chat.id) == config.States.S_GET_TASK.value)\ndef get_task(message):\n settings = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + \"\\\\bases\\\\settings.db\")\n conn = settings.cursor()", " conn.execute(\"select * from us...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 321, "char_start": 320, "chars": "?" }, { "char_end": 323, "char_start": 322, "chars": "," }, { "char_end": 325, "char_start": 324, "chars": "(" }, { ...
223
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@bot.message_handler(func = lambda message: get_current_state(message.chat.id) == config.States.S_GET_TASK.value)\ndef get_task(message):\n settings = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + \"\\\\bases\\\\settings.db\")\n conn = settings.cursor()", " conn.execute(\"select * from us...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 321, "char_start": 320, "chars": "?" }, { "char_end": 323, "char_start": 322, "chars": "," }, { "char_end": 325, "char_start": 324, "chars": "(" }, { ...
223
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@bot.message_handler(commands=['stats'])\ndef stats(message):\n settings = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + \"\\\\bases\\\\settings.db\")\n conn = settings.cursor()", " conn.execute(\"select * from users where chat_id = '\" + str(message.chat.id) + \"'\")", " name = conn...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 245, "char_start": 244, "chars": "?" }, { "char_end": 247, "char_start": 246, "chars": "," }, { "char_end": 249, "char_start": 248, "chars": "(" }, { ...
224
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@bot.message_handler(commands=['stats'])\ndef stats(message):\n settings = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + \"\\\\bases\\\\settings.db\")\n conn = settings.cursor()", " conn.execute(\"select * from users where chat_id = ?\", (str(message.chat.id),))", " name = conn.fetch...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 245, "char_start": 244, "chars": "?" }, { "char_end": 247, "char_start": 246, "chars": "," }, { "char_end": 249, "char_start": 248, "chars": "(" }, { ...
224
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@jwt_required\n def delete(self, user_id):\n \"\"\" Deletes user with the corresponding user_id \"\"\"", " return database_utilities.execute_query(f\"\"\"delete from users where user_id = '{user_id}'\"\"\")" ]
[ 1, 0 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 203, "char_start": 195, "chars": "%s\"\"\", (" }, { "char_end": 213, "char_start": 210, "chars": ", )" } ], "deleted": [ { "char_end": 197, "char_start": 195, ...
225
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@jwt_required\n def delete(self, user_id):\n \"\"\" Deletes user with the corresponding user_id \"\"\"", " return database_utilities.execute_query(f\"\"\"delete from users where user_id = %s\"\"\", (user_id, ))" ]
[ 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 203, "char_start": 195, "chars": "%s\"\"\", (" }, { "char_end": 213, "char_start": 210, "chars": ", )" } ], "deleted": [ { "char_end": 197, "char_start": 195, ...
225
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def verify_rno(self, rno):", " query = \"SELECT COUNT(rno) FROM rides WHERE rno = {rno}\".format(rno = rno)\n self.cursor.execute(query)", " result = self.cursor.fetchone()\n if (int(result[0]) > 0):\n return True \n else:\n return False" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 55, "char_start": 39, "chars": "self.cursor.exec" }, { "char_end": 57, "char_start": 56, "chars": "t" }, { "char_end": 59, "char_start": 58, "chars": "(" }, ...
226
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def verify_rno(self, rno):", " self.cursor.execute(\"SELECT COUNT(rno) FROM rides WHERE rno = :rno\", {'rno': rno})", " result = self.cursor.fetchone()\n if (int(result[0]) > 0):\n return True \n else:\n return False" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 55, "char_start": 39, "chars": "self.cursor.exec" }, { "char_end": 57, "char_start": 56, "chars": "t" }, { "char_end": 59, "char_start": 58, "chars": "(" }, ...
226
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_requested_day(self, date):", " data = dict()", " day_start, day_end = self.get_epoch_day(date)\n data['interval'] = {'from': self.convert_local_ts_to_utc(day_start, self.local_timezone), 'to': self.convert_local_ts_to_utc(day_end, self.local_timezone)}", " query = '''\n ...
[ 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 416, "char_start": 415, "chars": "?" }, { "char_end": 422, "char_start": 421, "chars": "?" }, { "char_end": 538, "char_start": 537, "chars": "," }, { ...
227
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_requested_day(self, date):", " data = dict()", " day_start, day_end = self.get_epoch_day(date)\n data['interval'] = {'from': self.convert_local_ts_to_utc(day_start, self.local_timezone), 'to': self.convert_local_ts_to_utc(day_end, self.local_timezone)}", " query = '''\n ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 416, "char_start": 415, "chars": "?" }, { "char_end": 422, "char_start": 421, "chars": "?" }, { "char_end": 538, "char_start": 537, "chars": "," }, { ...
227
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def add_language(lang):\n try:", " cur.execute(f\"INSERT INTO language (name) VALUES ('{lang}')\")", " except Exception as e:\n pass", " cur.execute(f\"SELECT language_id FROM language where name='{lang}'\")", " lang_id = cur.fetchone()[0]\n if conn.commit():\n return la...
[ 1, 0, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 97, "char_start": 90, "chars": "%s)\", (" }, { "char_end": 103, "char_start": 101, "chars": ", " }, { "char_end": 213, "char_start": 207, "chars": "%s\", (" }, ...
228
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def add_language(lang):\n try:", " cur.execute(\"INSERT INTO language (name) VALUES (%s)\", (lang, ))", " except Exception as e:\n pass", " cur.execute(\"SELECT language_id FROM language where name=%s\", (lang, ))", " lang_id = cur.fetchone()[0]\n if conn.commit():\n ret...
[ 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 97, "char_start": 90, "chars": "%s)\", (" }, { "char_end": 103, "char_start": 101, "chars": ", " }, { "char_end": 213, "char_start": 207, "chars": "%s\", (" }, ...
228
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def makeJudge(judge):", "\tdb.execute(\"UPDATE players SET Judge = 1 WHERE Name = '%s' COLLATE NOCASE\" % (judge)) ", "\tdatabase.commit()" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 78, "char_start": 77, "chars": "?" }, { "char_end": 95, "char_start": 94, "chars": "," } ], "deleted": [ { "char_end": 81, "char_start": 77, "chars": "'%s'" ...
229
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def makeJudge(judge):", "\tdb.execute(\"UPDATE players SET Judge = 1 WHERE Name = ? COLLATE NOCASE\", judge) ", "\tdatabase.commit()" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 78, "char_start": 77, "chars": "?" }, { "char_end": 95, "char_start": 94, "chars": "," } ], "deleted": [ { "char_end": 81, "char_start": 77, "chars": "'%s'" ...
229
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def isValidAdmToken(adm_token):\n conn, c = connectDB()", " req = \"SELECT * from {} where adm_token='{}'\".format(CFG(\"admintoken_table_name\"), adm_token)\n answer = bool(queryOne(c, req))", " closeDB(conn)\n return answer" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 104, "char_start": 103, "chars": "?" }, { "char_end": 190, "char_start": 176, "chars": ", (adm_token,)" } ], "deleted": [ { "char_end": 107, "char_start": 103, ...
230
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def isValidAdmToken(adm_token):\n conn, c = connectDB()", " req = \"SELECT * from {} where adm_token=?\".format(CFG(\"admintoken_table_name\"))\n answer = bool(queryOne(c, req, (adm_token,)))", " closeDB(conn)\n return answer" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 104, "char_start": 103, "chars": "?" }, { "char_end": 190, "char_start": 176, "chars": ", (adm_token,)" } ], "deleted": [ { "char_end": 107, "char_start": 103, ...
230
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@staticmethod\n def get_mapped_projects(user_id: int, preferred_locale: str) -> UserMappedProjectsDTO:\n \"\"\" Get all projects a user has mapped on \"\"\"", " # This query looks scary, but we're really just creating an outer join between the query that gets the\n # counts of all mapped ...
[ 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1254, "char_start": 1246, "chars": ":user_id" }, { "char_end": 1320, "char_start": 1312, "chars": ":user_id" }, { "char_end": 1690, "char_start": 1682, "chars": ":user...
231
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@staticmethod\n def get_mapped_projects(user_id: int, preferred_locale: str) -> UserMappedProjectsDTO:\n \"\"\" Get all projects a user has mapped on \"\"\"", " # This query looks scary, but we're really just creating an outer join between the query that gets the\n # counts of all mapped ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1254, "char_start": 1246, "chars": ":user_id" }, { "char_end": 1320, "char_start": 1312, "chars": ":user_id" }, { "char_end": 1690, "char_start": 1682, "chars": ":user...
231
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def delete_data(self, session, id):\n self._openContainer(session)\n sid = str(id)\n if (self.idNormalizer is not None):\n sid = self.idNormalizer.process_string(session, str(id))", " query = \"DELETE FROM %s WHERE identifier = '%s';\" % (self.table, sid)\n self._que...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 265, "char_start": 263, "chars": "$1" }, { "char_end": 313, "char_start": 308, "chars": ", sid" } ], "deleted": [ { "char_end": 267, "char_start": 263, "chars"...
232
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def delete_data(self, session, id):\n self._openContainer(session)\n sid = str(id)\n if (self.idNormalizer is not None):\n sid = self.idNormalizer.process_string(session, str(id))", " query = \"DELETE FROM %s WHERE identifier = $1;\" % (self.table)\n self._query(quer...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 265, "char_start": 263, "chars": "$1" }, { "char_end": 313, "char_start": 308, "chars": ", sid" } ], "deleted": [ { "char_end": 267, "char_start": 263, "chars"...
232
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def user_verify(self):\n eid = self.email\n code = self.password\n if eid.strip() == '':\n return\n if code.strip() == '':\n return", " query = '''select * from usr where email like\\''''+eid+'\\''\n cursor = g.conn.execute(query)", " for r...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 234, "char_start": 231, "chars": " %s" }, { "char_end": 282, "char_start": 273, "chars": ", (eid, )" } ], "deleted": [ { "char_end": 199, "char_start": 197, "c...
233
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def user_verify(self):\n eid = self.email\n code = self.password\n if eid.strip() == '':\n return\n if code.strip() == '':\n return", " query = 'select * from usr where email like %s'\n cursor = g.conn.execute(query, (eid, ))", " for row in...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 234, "char_start": 231, "chars": " %s" }, { "char_end": 282, "char_start": 273, "chars": ", (eid, )" } ], "deleted": [ { "char_end": 199, "char_start": 197, "c...
233
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@app.route('/movies/search', methods=['GET', 'POST'])\ndef search_films():\n form = SearchForm()\n if not form.validate_on_submit():\n return render_template('search.html', title='Search for films', form=form)\n search_terms = form.data['term'].split(' ')\n search_string = ' & '.join(search_term...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 384, "char_start": 377, "chars": "%s)\", (" }, { "char_end": 399, "char_start": 397, "chars": ", " } ], "deleted": [ { "char_end": 329, "char_start": 328, "cha...
234
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@app.route('/movies/search', methods=['GET', 'POST'])\ndef search_films():\n form = SearchForm()\n if not form.validate_on_submit():\n return render_template('search.html', title='Search for films', form=form)\n search_terms = form.data['term'].split(' ')\n search_string = ' & '.join(search_term...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 384, "char_start": 377, "chars": "%s)\", (" }, { "char_end": 399, "char_start": 397, "chars": ", " } ], "deleted": [ { "char_end": 329, "char_start": 328, "cha...
234
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def getGameCountInSeriesSoFar(submission):\n database = sqlite3.connect('database.db')\n cursor = database.cursor()", " return cursor.execute(\"SELECT COUNT(*) FROM ChallengeRankings WHERE SeriesTitle = '\" + getTitle(submission) + \"' AND Date <= '\" + getSubmissionDateFromDatabase(submission) + \"'\")...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 207, "char_start": 206, "chars": "?" }, { "char_end": 211, "char_start": 208, "chars": "AND" }, { "char_end": 225, "char_start": 212, "chars": "Date <= ?\", [" }...
235
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def getGameCountInSeriesSoFar(submission):\n database = sqlite3.connect('database.db')\n cursor = database.cursor()", " return cursor.execute(\"SELECT COUNT(*) FROM ChallengeRankings WHERE SeriesTitle = ? AND Date <= ?\", [getTitle(submission), getSubmissionDateFromDatabase(submission)]).fetchone()[0]",...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 207, "char_start": 206, "chars": "?" }, { "char_end": 211, "char_start": 208, "chars": "AND" }, { "char_end": 225, "char_start": 212, "chars": "Date <= ?\", [" }...
235
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@mod.route('/add', methods=['GET', 'POST'])\ndef add():\n if request.method == 'POST':\n msg_id = int(request.form['msg_id'])\n user_id = session['logged_id']\n content = request.form['content']\n c_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')", " sql = \"INSERT INTO ...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 287, "char_start": 284, "chars": "cur" }, { "char_end": 299, "char_start": 288, "chars": "or.execute(" }, { "char_end": 360, "char_start": 359, "chars": "s" }, ...
236
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@mod.route('/add', methods=['GET', 'POST'])\ndef add():\n if request.method == 'POST':\n msg_id = int(request.form['msg_id'])\n user_id = session['logged_id']\n content = request.form['content']\n c_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')", " cursor.execute(\"INS...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 287, "char_start": 284, "chars": "cur" }, { "char_end": 299, "char_start": 288, "chars": "or.execute(" }, { "char_end": 360, "char_start": 359, "chars": "s" }, ...
236
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_mod_taken_together_with(code):\n '''\n Retrieves the list of modules taken together with the specified\n module code in the same semester.", " Returns a table of lists (up to 10 top results). Each list contains\n (specified code, module code of mod taken together, aySem, nu...
[ 1, 1, 1, 1, 0, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 707, "char_start": 705, "chars": "%s" }, { "char_end": 1065, "char_start": 1056, "chars": ", (code,)" } ], "deleted": [ { "char_end": 719, "char_start": 705, "...
237
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_mod_taken_together_with(code):\n '''\n Retrieves the list of modules taken together with the specified\n module code in the same semester.", " Returns a table of lists (up to 10 top results). Each list contains\n (specified code, module code of mod taken together, aySem, nu...
[ 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 707, "char_start": 705, "chars": "%s" }, { "char_end": 1065, "char_start": 1056, "chars": ", (code,)" } ], "deleted": [ { "char_end": 719, "char_start": 705, "...
237
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@endpoints.route(\"/wins\")\ndef wins():\n if db == None:\n init()", " player = request.args.get('tag', default=\"christmasmike\")", " sql = \"SELECT * FROM matches WHERE winner = '\"+str(player)+\"' ORDER BY date DESC;\"\n result = db.exec(sql)", "\n result = [str(x) for x in result]\n...
[ 1, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 185, "char_start": 184, "chars": "{" }, { "char_end": 192, "char_start": 191, "chars": "}" }, { "char_end": 249, "char_start": 219, "chars": "args = {'player': player}...
238
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@endpoints.route(\"/wins\")\ndef wins():\n if db == None:\n init()", " player = request.args.get('tag', default=\"christmasmike\")", " sql = \"SELECT * FROM matches WHERE winner = '{player}' ORDER BY date DESC;\"\n args = {'player': player}\n result = db.exec(sql, args)", "\n result ...
[ 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 185, "char_start": 184, "chars": "{" }, { "char_end": 192, "char_start": 191, "chars": "}" }, { "char_end": 249, "char_start": 219, "chars": "args = {'player': player}...
238
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def delete_event(self, event_id):", " sql = \"\"\"DELETE FROM events\n WHERE event_id = {0}\n \"\"\".format(event_id)\n affected_count = self.cur.execute(sql)", " self.conn.commit()\n return affected_count" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 70, "char_start": 55, "chars": "\n " }, { "char_end": 122, "char_start": 120, "chars": "%s" }, { "char_end": 199, "char_start": 186, "chars": ", (event_id...
239
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def delete_event(self, event_id):", " sql = \"\"\"\n DELETE FROM events\n WHERE event_id = %s\n \"\"\"\n affected_count = self.cur.execute(sql, (event_id,))", " self.conn.commit()\n return affected_count" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 70, "char_start": 55, "chars": "\n " }, { "char_end": 122, "char_start": 120, "chars": "%s" }, { "char_end": 199, "char_start": 186, "chars": ", (event_id...
239
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def add_item(self, item):\n \"\"\"\"Add new item.\"\"\"\n if self.connection:", " self.cursor.execute('insert into item (name, shoppinglistid) values (\"%s\", \"%s\")' % (item[0], item[1]))", " self.connection.commit()" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 136, "char_start": 99, "chars": "t = (item[0], item[1], )\n " }, { "char_end": 206, "char_start": 205, "chars": "?" }, { "char_end": 209, "char_start": 208, ...
240
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def add_item(self, item):\n \"\"\"\"Add new item.\"\"\"\n if self.connection:", " t = (item[0], item[1], )\n self.cursor.execute('insert into item (name, shoppinglistid) values (?, ?)', t)", " self.connection.commit()" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 136, "char_start": 99, "chars": "t = (item[0], item[1], )\n " }, { "char_end": 206, "char_start": 205, "chars": "?" }, { "char_end": 209, "char_start": 208, ...
240
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def fetch_issue(cursor, id):\n \"\"\"\n Fetch an issue by id along with its tags. Returns None if no issue\n with the specified id exists in the database.\n \"\"\"", " cursor.execute(f\"\"\"", " SELECT\n issue.id,\n issue.title,\n issue.description,\n ...
[ 1, 0, 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 480, "char_start": 479, "chars": "?" }, { "char_end": 495, "char_start": 488, "chars": ", (id,)" } ], "deleted": [ { "char_end": 186, "char_start": 185, "chars...
241
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def fetch_issue(cursor, id):\n \"\"\"\n Fetch an issue by id along with its tags. Returns None if no issue\n with the specified id exists in the database.\n \"\"\"", " cursor.execute(\"\"\"", " SELECT\n issue.id,\n issue.title,\n issue.description,\n ...
[ 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 480, "char_start": 479, "chars": "?" }, { "char_end": 495, "char_start": 488, "chars": ", (id,)" } ], "deleted": [ { "char_end": 186, "char_start": 185, "chars...
241
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def also_add(name, also):\n db = db_connect()\n cursor = db.cursor()\n try:\n cursor.execute('''", " INSERT INTO isalso(name,also) VALUES('{}','{}')\n '''.format(name, also))", " db.commit()\n logger.debug('added to isalso name {} with value {}'.format(\n ...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 166, "char_start": 158, "chars": "%(name)s" }, { "char_end": 175, "char_start": 167, "chars": "%(also)s" }, { "char_end": 194, "char_start": 192, "chars": ", " }...
242
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def also_add(name, also):\n db = db_connect()\n cursor = db.cursor()\n try:\n cursor.execute('''", " INSERT INTO isalso(name,also) VALUES(%(name)s,%(also)s)\n ''', (\n name,\n also,\n ))", " db.commit()\n logger.debug('added to is...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 166, "char_start": 158, "chars": "%(name)s" }, { "char_end": 175, "char_start": 167, "chars": "%(also)s" }, { "char_end": 194, "char_start": 192, "chars": ", " }...
242
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def getCommentsLike(self,commentid):", " sqlText=\"select userid from comment_like where commentid=%d\"%(commentid)\n result=sql.queryDB(self.conn,sqlText)", " return result;" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 108, "char_start": 107, "chars": "s" }, { "char_end": 126, "char_start": 109, "chars": "\n params=[" }, { "char_end": 136, "char_start": 135, "chars": "]" ...
243
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def getCommentsLike(self,commentid):", " sqlText=\"select userid from comment_like where commentid=%s\"\n params=[commentid]\n result=sql.queryDB(self.conn,sqlText,params)", " return result;" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 108, "char_start": 107, "chars": "s" }, { "char_end": 126, "char_start": 109, "chars": "\n params=[" }, { "char_end": 136, "char_start": 135, "chars": "]" ...
243
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def update_theory_base(tag, link):\n theory = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + \"\\\\theory.db\")\n conn = theory.cursor()", " conn.execute(\"insert into \" + str(tag) + \" values (?)\", (str(link), ))", " theory.commit()\n theory.close()" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 182, "char_start": 181, "chars": "?" }, { "char_end": 202, "char_start": 197, "chars": "tag, " } ], "deleted": [ { "char_end": 197, "char_start": 181, "chars":...
244
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def update_theory_base(tag, link):\n theory = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + \"\\\\theory.db\")\n conn = theory.cursor()", " conn.execute(\"insert into ? values (?)\", (tag, str(link)))", " theory.commit()\n theory.close()" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 182, "char_start": 181, "chars": "?" }, { "char_end": 202, "char_start": 197, "chars": "tag, " } ], "deleted": [ { "char_end": 197, "char_start": 181, "chars":...
244
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@app.route('/get_asset_and_volume')\ndef get_asset_and_volume():\n asset_id = request.args.get('asset_id')", " if not isObject(asset_id):\n ws.send('{\"id\":1, \"method\":\"call\", \"params\":[0,\"lookup_asset_symbols\",[[\"' + asset_id + '\"], 0]]}')\n result_l = ws.recv()\n j_l = jso...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1484, "char_start": 1483, "chars": "%" }, { "char_end": 1521, "char_start": 1508, "chars": ", (asset_id,)" } ], "deleted": [ { "char_end": 1487, "char_start": 1483, ...
245
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@app.route('/get_asset_and_volume')\ndef get_asset_and_volume():\n asset_id = request.args.get('asset_id')", " if not isObject(asset_id):\n ws.send('{\"id\":1, \"method\":\"call\", \"params\":[0,\"lookup_asset_symbols\",[[\"' + asset_id + '\"], 0]]}')\n result_l = ws.recv()\n j_l = jso...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1484, "char_start": 1483, "chars": "%" }, { "char_end": 1521, "char_start": 1508, "chars": ", (asset_id,)" } ], "deleted": [ { "char_end": 1487, "char_start": 1483, ...
245
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def reportMatch(winner, loser):\n \"\"\"Records the outcome of a single match between two players.", " Args:\n winner: the id number of the player who won\n loser: the id number of the player who lost\n \"\"\"\n try:\n int(winner)\n int(loser)\n except ValueError:\n ...
[ 1, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 557, "char_start": 555, "chars": "c." }, { "char_end": 559, "char_start": 558, "chars": "x" }, { "char_end": 562, "char_start": 560, "chars": "cu" }, { ...
246
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def reportMatch(winner, loser):\n \"\"\"Records the outcome of a single match between two players.", " Args:\n winner: the id number of the player who won\n loser: the id number of the player who lost\n \"\"\"\n try:\n int(winner)\n int(loser)\n except ValueError:\n ...
[ 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 557, "char_start": 555, "chars": "c." }, { "char_end": 559, "char_start": 558, "chars": "x" }, { "char_end": 562, "char_start": 560, "chars": "cu" }, { ...
246
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def getPlayer(player):", "\tdb.execute(\"SELECT * FROM players WHERE Name = '%s' COLLATE NOCASE\" % player)", "\tplayerstats = dict(db.fetchone())\n\treturn playerstats" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 72, "char_start": 71, "chars": "?" }, { "char_end": 89, "char_start": 88, "chars": "," } ], "deleted": [ { "char_end": 75, "char_start": 71, "chars": "'%s'" ...
247
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def getPlayer(player):", "\tdb.execute(\"SELECT * FROM players WHERE Name = ? COLLATE NOCASE\", player)", "\tplayerstats = dict(db.fetchone())\n\treturn playerstats" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 72, "char_start": 71, "chars": "?" }, { "char_end": 89, "char_start": 88, "chars": "," } ], "deleted": [ { "char_end": 75, "char_start": 71, "chars": "'%s'" ...
247
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def karma_sub(name):\n karma = karma_ask(name)\n db = db_connect()\n cursor = db.cursor()\n if karma is None:\n try:\n cursor.execute('''", " INSERT INTO people(name,karma,shame) VALUES('{}',-1,0)\n '''.format(name))", " db.commit()\n ...
[ 1, 0, 1, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 230, "char_start": 222, "chars": "%(name)s" }, { "char_end": 258, "char_start": 256, "chars": ", " }, { "char_end": 265, "char_start": 263, "chars": ", " }, ...
248
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def karma_sub(name):\n karma = karma_ask(name)\n db = db_connect()\n cursor = db.cursor()\n if karma is None:\n try:\n cursor.execute('''", " INSERT INTO people(name,karma,shame) VALUES(%(name)s,-1,0)\n ''', (name, ))", " db.commit()\n ...
[ 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 230, "char_start": 222, "chars": "%(name)s" }, { "char_end": 258, "char_start": 256, "chars": ", " }, { "char_end": 265, "char_start": 263, "chars": ", " }, ...
248
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@app.route('/', methods=['POST'])\ndef login():\n print('login')\n user = str(request.form['username'])\n password = str(request.form['password'])", " cur.execute('SELECT * FROM users WHERE name = \\'{}\\' AND password = \\'{}\\';'.format(user, password))", " response = cur.fetchone()\n if re...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 169, "char_start": 168, "chars": "\"" }, { "char_end": 203, "char_start": 202, "chars": "?" }, { "char_end": 220, "char_start": 219, "chars": "?" }, { ...
249
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@app.route('/', methods=['POST'])\ndef login():\n print('login')\n user = str(request.form['username'])\n password = str(request.form['password'])", " cur.execute(\"SELECT * FROM users WHERE name = ? AND password = ?;\", [user, password])", " response = cur.fetchone()\n if response != None:\n...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 169, "char_start": 168, "chars": "\"" }, { "char_end": 203, "char_start": 202, "chars": "?" }, { "char_end": 220, "char_start": 219, "chars": "?" }, { ...
249
cwe-089
py