Files
Open_Ultra_SAST/benchmarks/pairs/github/sven-cwe-089-execute-percent/fixed.py
T
Marius Ciepluch 1ae41eea19 feat(propose-adjudicate-prove): overlay adjudicates inventory before prove
Regex inventory stays the proposer. MAP attaches promote/demote/unadjudicated/coverage
from intra-file taint (tree-sitter when a grammar parses, Python ast as last resort).
Deep sandboxes promotions only, ordered by the existing heuristic ranker plus optional
OpenRouter mechanism recall. The SAST pair slice scores overlay outcomes; the stage-1
detection gate and local pair gate stay inventory-only.
2026-09-04 13:57:33 +02:00

23 lines
646 B
Python

# Provenance: SVEN train CWE-89 function pair from
# https://github.com/russ-lewis/ttt_-_python_cgi/commit/6096f43fd4b2d91211eec4614b7960c0816900da
# file cgi/common.py function build_board
def build_board(conn, game, size):
board = []
for i in range(size):
board.append([""] * size)
cursor = conn.cursor()
cursor.execute("SELECT x,y,letter FROM moves WHERE gameID = %d;", (game,))
counts = {"X": 0, "O": 0}
for move in cursor.fetchall():
(x, y, letter) = move
x = int(x)
y = int(y)
board[x][y] = letter
counts[letter] += 1
cursor.close()
return (board, counts)