From 886a0212e82254d28d82ac0b84f1d9cc4b7b39f0 Mon Sep 17 00:00:00 2001 From: Darryl Miles Date: Mon, 30 Sep 2024 01:49:50 +0100 Subject: [PATCH] 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> --- database/DBtech.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/DBtech.c b/database/DBtech.c index 2ea3676f..47f8b818 100644 --- a/database/DBtech.c +++ b/database/DBtech.c @@ -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;