diff --git a/KSystemInformer/util.c b/KSystemInformer/util.c index 52f3b873f..793bcba59 100644 --- a/KSystemInformer/util.c +++ b/KSystemInformer/util.c @@ -41,6 +41,16 @@ PVOID KphBinarySearch( { KPH_NPAGED_CODE_HIGH_MAX(); + if (!Key || !Base || !NumberOfElements || !SizeOfElement) + { + return NULL; + } + + if (SizeOfElement > (ULONG_MAX / NumberOfElements)) + { + return NULL; + } + return bsearch_s(Key, Base, NumberOfElements,