database/DBtech.c: Incorrect return-value check for a 'scanf'-like function

Fix code scanning alert no. 135: Incorrect return-value check for a 'scanf'-like function (#12)

* Create codeql.yml

* Fix code scanning alert no. 135: Incorrect return-value check for a 'scanf'-like function

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
Darryl Miles 2024-09-30 01:49:50 +01:00 committed by Tim Edwards
parent 2a00ab7eb8
commit 886a0212e8
1 changed files with 1 additions and 1 deletions

View File

@ -223,7 +223,7 @@ DBTechSetVersion(sectionName, argc, argv)
major = minor = rev = 0;
rmajor = rminor = rrev = 0;
if (sscanf(vstring, "%d.%d.%d", &rmajor, &rminor, &rrev) == 0)
if (sscanf(vstring, "%d.%d.%d", &rmajor, &rminor, &rrev) != 3)
{
TechError("Badly formed magic version string, should be major.minor.rev\n");
return FALSE;