mirror of https://github.com/sysown/proxysql
Address AI code review feedback on PgSQL FFTO tests (#5517)
Fixes from Copilot and CodeRabbit reviews on PR #5526: 1. Buffer overflow risk in mysql_real_escape_string: All 7 PgSQL test files used fixed 256-byte buffers for escaped credentials. Changed to VLAs sized from strlen() (2*len+1), matching the safe pattern used in the existing test_ffto_pgsql-t.cpp. 2. NULL dereference in polling loops: mysql_store_result() can return NULL, and calling mysql_fetch_row(NULL) is undefined behavior. Added NULL checks in all verify_pg_digest(), poll_pg_digest_count(), verify_digest(), and poll_digest_count() polling loops across both PgSQL and MySQL test files. In loop contexts, uses continue; in non-loop contexts, uses conditional fetch (res ? fetch(res) : NULL). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>v3.0-5517
parent
fd7ac876e2
commit
573a3fd256
Loading…
Reference in new issue