Message-ID: From: "ColinKYuen (@ColinKYuen)" To: "postgresql-interfaces/psqlodbc" Date: Sat, 12 Apr 2025 00:14:28 +0000 Subject: [postgresql-interfaces/psqlodbc] PR #108: feat: safe sscanf List-Id: X-GitHub-Author-Id: 70862826 X-GitHub-Author-Login: ColinKYuen X-GitHub-Issue: 108 X-GitHub-Repo: postgresql-interfaces/psqlodbc X-GitHub-State: merged X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/postgresql-interfaces/psqlodbc/pull/108 Content-Type: text/plain; charset=utf-8 ## Summary Replaces the usages of sscanf() for a safer implementation ## Description For character strings, the standard library uses the convention that strings are null-terminated: a string of n characters is represented as an array of n + 1 elements, the last of which is a NUL character ('\0'). For input conversion to various types, the C library provides the scanf() function family. The scanf() family of functions scans input according to supplied format string. This format may contain conversion specifications; the results from such conversions, if any, are stored in the locations pointed to by the pointer arguments that follow format. Each pointer argument must be of a type that is appropriate for the value returned by the corresponding conversion specification. scanf() also does not check the bounds of the inputs and may cause buffer overflows. ## Testing The regression tests have been built on - Windows 11, 24H2 - Linux, Ubuntu 24 - & M4 Max Mac, Sequoia 15.3.2 The test results match what is currently on mainline