From d9f9b289baade97227942fc9d70a1245349dfd80 Mon Sep 17 00:00:00 2001 From: Vlad Khorsun Date: Tue, 20 Aug 2024 13:25:59 +0300 Subject: [PATCH] Fixed bug #8221 : Crash when MAKE_DBKEY() is called with 0 or 1 arguments --- src/jrd/SysFunction.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/jrd/SysFunction.cpp b/src/jrd/SysFunction.cpp index 0088dfc0c0..ad7ff7ba5d 100644 --- a/src/jrd/SysFunction.cpp +++ b/src/jrd/SysFunction.cpp @@ -861,11 +861,14 @@ void setParamsMakeDbkey(DataTypeUtilBase*, const SysFunction*, int argsCount, ds { // MAKE_DBKEY ( REL_NAME | REL_ID, RECNUM [, DPNUM [, PPNUM] ] ) - if (args[0]->isUnknown()) - args[0]->makeLong(0); + if (argsCount > 1) + { + if (args[0]->isUnknown()) + args[0]->makeLong(0); - if (args[1]->isUnknown()) - args[1]->makeInt64(0); + if (args[1]->isUnknown()) + args[1]->makeInt64(0); + } if (argsCount > 2 && args[2]->isUnknown()) args[2]->makeInt64(0);